/**
  * Initialize
  */
 public function init()
 {
     parent::init();
     $this->defaultAction = 'index';
     $this->_activated = SystemManager::activated();
     //	Remote login errors?
     $_error = FilterInput::request('error', null, FILTER_SANITIZE_STRING);
     $_message = FilterInput::request('error_description', null, FILTER_SANITIZE_STRING);
     if (!empty($_error)) {
         $this->_remoteError = $_error . (!empty($_message) ? ' (' . $_message . ')' : null);
     }
 }
 /**
  * {@InheritDoc}
  */
 public function init()
 {
     //  Admins only!
     if (!Session::isSystemAdmin()) {
         throw new \CHttpException(HttpResponse::Forbidden, 'Access Denied.');
     }
     parent::init();
     //	We want merged update/create...
     $this->setSingleViewMode(true);
     $this->layout = 'mobile';
     $this->defaultAction = 'index';
     //	Everything is auth-required
     $this->addUserActions(static::Authenticated, array('cache', 'index', 'update', 'error', 'create'));
     //  Set the command map
     static::$_cacheCommandMap = array('flush' => function () {
         return Platform::storeDeleteAll();
     });
 }
Beispiel #3
0
 /**
  * Error action
  */
 public function actionError()
 {
     if (null === ($_error = Pii::currentError())) {
         parent::actionError();
     } else {
         if (Pii::ajaxRequest()) {
             echo $_error['message'];
             return;
         }
         if ($_error['code'] == 404) {
             $this->layout = 'error';
         }
         $this->render('error', $_error);
     }
 }