Beispiel #1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!in_array('vote', Configure::read('plugins.install'))) {
         $this->error("未安装投票插件");
     }
 }
Beispiel #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();
 }
Beispiel #3
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!Configure::read('refer.enable')) {
         $this->error(ECode::$REFER_DISABLED);
     }
     $this->requestLogin();
 }
Beispiel #4
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->requestLogin();
 }
Beispiel #5
0
 public function beforeFilter()
 {
     $this->ApiAuth->allow('login');
     return parent::beforeFilter();
 }
 public function __construct()
 {
     parent::__construct();
     $this->components[] = "Thumbnail";
 }