User authentication systems are a common part of many web applications. In CakePHP there are several systems for authenticating users, each of which provides different options. At its core the authentication component will check to see if a user has an account with a site. If they do, the component will give access to that user to the complete site.In short, authentication is a turnkey option in CakePHP. All you need to do to enable it is open and edit your app controller at site_name/app/app_controller.php, adding:
var $components = array('Auth');
This single line will implicitly password-protect your entire site. For explicit, group-or-user-based password protection, add to Auth the ACL:
This component can be combined with the ACL (access control lists) component to create more complex levels of access within a site. The ACL Component, for example, could allow you to grant one user access to public site areas, while granting another user access to protected administrative portions of the site.Finally, don't forget to run by the fridge for a cold can of PBR, 'cause you're going to want to celebrate the ease of this authentication framework.
CakePHP's AuthComponent can be used to create such a system easily and quickly.
3 comments:
This is a really good read for me. Must agree that you are one of the coolest bloggers I ever saw. Thanks for posting this informative article.
Thanks, I'll take it. ;)
take a look at full guide how to authorize actions in cake php:
http://www.designaeon.com/authorize-using-auth-cakephp/
Post a Comment