Author Archive
How to use AuthComponent in Cakephp 1.2
How do you use AuthComponent and AclComponent to authenticate users? On app_controller.php, put this code: <?php class AppController extends Controller { var $components = array(‘Acl’,’Auth’,’Cookie’,’Session’); function beforeFilter() { $this->Auth->loginAction = ‘/users/login’; $this->Auth->loginRedirect = ‘/questions/Various-Topics’; $this->Auth->authorize = ‘actions’; } ?> and, on every controller, create a beforeFilter function and put this : function beforeFilter() { //var_dump($this->params); [...]
