Ejemplo n.º 1
0
 public function beforeAction($action)
 {
     if ($action->id == "create-img-ajax" || $action->id == "filemanager" || $action->id == "crop-ajax") {
         $this->enableCsrfValidation = false;
     }
     return parent::beforeAction($action);
 }
Ejemplo n.º 2
0
 /**
  * @param \yii\base\Action $action
  * @return bool
  */
 public function beforeAction($action)
 {
     parent::beforeAction($action);
     if (\Yii::$app->user->identity->role != User::ROLE_ADMIN) {
         throw new \Exception('非管理员不能操作:(');
     }
     return true;
 }
Ejemplo n.º 3
0
 /**
  * @param \yii\base\Action $action
  * @return bool
  */
 public function beforeAction($action)
 {
     parent::beforeAction($action);
     if (!GlobalHelper::isValidAdmin()) {
         throw new \Exception(yii::t('conf', 'you are not active'));
     }
     return true;
 }
Ejemplo n.º 4
0
 /**
  * @param \yii\base\Action $action
  * @return bool
  */
 public function beforeAction($action)
 {
     parent::beforeAction($action);
     if (!GlobalHelper::isValidAdmin()) {
         throw new \Exception('项目管理员尚未通过其它项目管理员的审核,无操作项目权限:)');
     }
     return true;
 }
Ejemplo n.º 5
0
 public function beforeAction($action)
 {
     Yii::$app->response->is_backend = true;
     $headers = Yii::$app->response->getHeaders();
     $headers->set('X-Robots-Tag', 'none');
     $headers->set('X-Frame-Options', 'SAMEORIGIN');
     $headers->set('X-Content-Type-Options', 'nosniff');
     return parent::beforeAction($action);
 }
Ejemplo n.º 6
0
 public function beforeAction($action)
 {
     if (parent::beforeAction($action)) {
         // change layout for error action
         if ($action->id == 'error') {
             $this->layout = '//_clear';
         }
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 7
0
 public function beforeAction($actionName)
 {
     $key = Config::value('FORUM_SECTION_ID_KEY');
     switch (Config::value('FORUM_SECTION_ID_SOURCE')) {
         case 'get':
             if (isset($_GET[$key])) {
                 $this->sectionId = $_GET[$key];
             }
             break;
         case 'post':
             if (isset($_POST[$key])) {
                 $this->sectionId = $_POST[$key];
             }
             break;
         case 'session':
             if (Session::get()->exists($key)) {
                 $this->sectionId = Session::get()->value($key);
             }
             break;
     }
     if (!in_array($actionName, ['notFound', 'accesDenied'])) {
         $section = ForumSection::findByPk($this->sectionId);
         if (!$section) {
             $this->goToPage('special', 'notFound');
         }
         $this->forumTitle = str_replace('__SECTION__', 'Main' == $section->name ? '' : $section->name . ' ', $this->forumTitle);
     }
     return parent::beforeAction($actionName);
 }
 public function beforeAction($action)
 {
     Yii::$app->session["_last_game"] = Yii::$app->request->absoluteUrl;
     return parent::beforeAction($action);
 }
Ejemplo n.º 9
0
 /**
  * @param \yii\base\Action $action
  * @return bool
  */
 public function beforeAction($action)
 {
     return parent::beforeAction($action);
 }