예제 #1
0
파일: handler.php 프로젝트: ortodesign/cms
 public function before()
 {
     parent::before();
     $this->_ctx = Context::instance();
     $this->_ctx->request($this->request)->response($this->response);
     View_Front::bind_global('ctx', $this->_ctx);
 }
예제 #2
0
파일: cron.php 프로젝트: g-a-g/its2015
 public function before()
 {
     if (PHP_SAPI != 'cli') {
         throw new Http_Exception_403('Доступ запрещен');
         return;
     }
     parent::before();
 }
예제 #3
0
 public function before()
 {
     parent::before();
     if ($this->auth_required === TRUE and !Auth::is_logged_in() and !in_array($this->request->action(), $this->public_actions)) {
         $this->_deny_access();
     }
     if ($this->auth_required === TRUE and !in_array($this->request->action(), $this->allowed_actions) and !ACL::check($this->request)) {
         $this->_deny_access();
     }
 }
예제 #4
0
파일: security.php 프로젝트: g-a-g/its2015
 public function before()
 {
     parent::before();
     //					 if (isset($this->request->post('exit')) OR isset($this->request->query('exit')))
     //           {
     //							Auth::instance()->logout();
     //							$this->redirect(URL::base(true));
     //            }
     $action_name = $this->request->action();
     // Проверяем права на доступ к текущей странице
     if ($this->auth_required !== FALSE and Auth::instance()->logged_id($this->auth_required) === FALSE or is_array($this->secure_actions) and array_key_exists($action_name, $this->secure_actions) and Auth::instance()->logged_in($this->secure_actions[$action_name]) === FALSE) {
         // Если нет прав и AJAX запрос, то выдаем эксепшен
         if (Auth::instance()->logged_in() or $this->request->is_ajax()) {
             throw new HTTP_Exception_403('У вас нет прав доступа к текущей странице');
         } else {
             $this->request->redirect(Route::url('user', array('action' => 'login', 'next_url' => rawurldecode(Request::current()->uri()))));
         }
     }
 }
예제 #5
0
파일: front.php 프로젝트: ZerGabriel/cms-1
 public function after()
 {
     parent::after();
     Observer::notify('frontpage_after_render');
 }