Пример #1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!in_array('vote', Configure::read('plugins.install'))) {
         $this->error("未安装投票插件");
     }
 }
Пример #2
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     App::import("vendor", array("model/board", "inc/pagination"));
     if (!isset($this->params['name'])) {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $boardName = $this->params['name'];
         if (preg_match("/^\\d+\$/", $boardName)) {
             throw new BoardNullException();
         }
         $this->_board = Board::getInstance($boardName);
         if ($this->_board->isDir()) {
             throw new BoardNullException();
         }
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_UNKNOW);
     }
     if (isset($this->params['url']['mode'])) {
         $mode = (int) trim($this->params['url']['mode']);
         $this->_board->setMode($mode);
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
 }
Пример #3
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!Configure::read('refer.enable')) {
         $this->error(ECode::$REFER_DISABLED);
     }
     $this->requestLogin();
 }
Пример #4
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->requestLogin();
 }
Пример #5
0
 public function beforeFilter()
 {
     $this->ApiAuth->allow('login');
     return parent::beforeFilter();
 }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $this->components[] = "Thumbnail";
 }