public function beforeFilter() { parent::beforeFilter(); if (!in_array('vote', Configure::read('plugins.install'))) { $this->error("未安装投票插件"); } }
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(); }
public function beforeFilter() { parent::beforeFilter(); if (!Configure::read('refer.enable')) { $this->error(ECode::$REFER_DISABLED); } $this->requestLogin(); }
public function beforeFilter() { parent::beforeFilter(); $this->requestLogin(); }
public function beforeFilter() { $this->ApiAuth->allow('login'); return parent::beforeFilter(); }