Posted By

sevennbsp on 05/15/10


Tagged

auth cakephp deny setup components allow beforeFilter loginAction loginRedirect logoutRedirect


Versions (?)

app_controller auth setup


 / Published in: PHP
 

URL: http://www.jbcrawford.net/archives/45

this is the entire app_controller code with auth setup and use in it.

  1. <?php
  2. class AppController extends Controller {
  3. var $components = array('Auth');
  4.  
  5. function beforeFilter() {
  6. $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
  7. $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
  8. $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'index');
  9. $this->Auth->allow('*');
  10. $this->Auth->deny('delete','view','index');
  11. }
  12. }
  13. ?>

Report this snippet  

You need to login to post a comment.