Пример #1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->params['name'])) {
         $bName = trim($this->params['name']);
     } else {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $this->_board = Board::getInstance($bName);
         if ($this->_board->isDir()) {
             throw new BoardNullException();
         }
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_NONE);
     }
     if (isset($this->params['mode'])) {
         $mode = (int) trim($this->params['mode']);
         if (!$this->_board->setMode($mode)) {
             $this->error(ECode::$BOARD_NOPERM);
         }
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
 }
Пример #2
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!Configure::read('refer.enable')) {
         $this->error(ECode::$REFER_DISABLED);
     }
     $this->requestLogin();
 }
Пример #3
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->requestLogin();
     if (!isset($this->params['num'])) {
         $this->params['num'] = 0;
     }
 }
Пример #4
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->requestLogin();
 }