/**
  * Event
  *
  * @param Event $event event
  * @return void
  */
 public function beforeFilter(\Cake\Event\Event $event)
 {
     $this->loadModel('Notifications.NotificationQueue');
     $this->loadModel('Notifications.NotificationContents');
     $this->loadModel('Users');
     parent::beforeFilter($event);
 }
 /**
  * Event
  *
  * @param Event $event event
  * @return void
  */
 public function beforeFilter(\Cake\Event\Event $event)
 {
     $this->loadModel('Notifications.NotificationContents');
     if (Configure::check('Notifications.default_language')) {
         $this->NotificationContents->locale(Configure::read('Notifications.default_language'));
     } else {
         $this->NotificationContents->locale('eng');
     }
     parent::beforeFilter($event);
 }
 /**
  * Prevent redirects triggered from AuthComponent.
  *
  * @param mixed $url redirect url
  * @param int $status status code
  * @return Cake\Network\Response
  */
 public function redirect($url, $status = null)
 {
     if ($this->request->is('ajax')) {
         return $this->notAuthenticated();
     }
     return parent::redirect($url, $status);
 }