Ejemplo n.º 1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     // $this->set($this->User->enumValues());
     $this->set('model', $this->modelClass);
     $this->_setupAuth();
 }
 /**
  * Called before the controller action.  You can use this method to configure and customize components
  * or perform logic that needs to happen before each controller action.
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Security) && $this->request->is('ajax')) {
         $this->Security->csrfCheck = false;
         $this->Security->validatePost = false;
     }
 }
Ejemplo n.º 3
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->_setupAuth();
     $this->set('model', $this->modelClass);
     if (!Configure::read('App.defaultEmail')) {
         Configure::write('App.defaultEmail', 'reply@' . env('HTTP_HOST'));
     }
 }
Ejemplo n.º 4
0
 /**
  * beforeFilter callback
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow('register', 'reset', 'verify', 'logout', 'index', 'view', 'reset_password');
     if ($this->action == 'register') {
         $this->Auth->enabled = false;
     }
     if ($this->action == 'login') {
         $this->Auth->autoRedirect = false;
     }
     $this->set('model', $this->modelClass);
     if (!Configure::read('App.defaultEmail')) {
         Configure::write('App.defaultEmail', 'noreply@' . env('HTTP_HOST'));
     }
 }
Ejemplo n.º 5
0
 /**
  * beforeFilter
  *
  * @return void
  * @access public
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->request->is('post') && in_array($this->request->params['action'], array('admin_login', 'login'))) {
         $field = $this->Auth->authenticate['all']['fields']['username'];
         if (!empty($this->request->data) && empty($this->request->data['User'][$field])) {
             $this->redirect(array('action' => $this->request->params['action']));
         }
         $cacheName = 'auth_failed_' . $this->request->data['User'][$field];
         if (Cache::read($cacheName, 'users_login') >= Configure::read('User.failed_login_limit')) {
             $this->Session->setFlash(__('You have reached maximum limit for failed login attempts. Please try again after a few minutes.'), 'default', array('class' => 'error'));
             $this->redirect(array('action' => $this->request->params['action']));
         }
     }
 }
Ejemplo n.º 6
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow('login', 'logout', 'register', 'forgot_password', 'reset_password');
 }
Ejemplo n.º 7
0
 /**
  * beforeFilter callback
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->_setupAuth();
     $this->_setupPagination();
     $this->set('model', $this->modelClass);
     $this->_setDefaultEmail();
 }
 function beforeFilter()
 {
     $this->Auth->allow('login', 'admin_login', 'logout', 'forgotten_password', 'reset_password', 'admin_forgotten_password', 'admin_reset_password', 'register', 'activate_with_ticket');
     $this->set('pagePath', $this->adminPagePath);
     parent::beforeFilter();
 }
Ejemplo n.º 9
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->notice(__d('users', 'ACL is not currently in use'), array('level' => 'warning', 'redirect' => true));
 }