Exemple #1
0
 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  */
 public function before()
 {
     ACL::required('administer comment');
     $this->_destination = '?destination=' . Route::get('admin/comment')->uri(array('action' => $this->request->action()));
     $this->_form_action = Route::get('admin/comment')->uri(array('action' => 'process')) . $this->_destination;
     parent::before();
 }
Exemple #2
0
 public function before()
 {
     parent::before();
     if ($this->current_user->group->id != 6) {
         \Response::redirect('admin');
     }
 }
Exemple #3
0
 public function before()
 {
     parent::before();
     $this->template->scripts[] = 'media/js/jquery-1.6.2.min.js';
     $this->template->scripts[] = 'media/js/jquery.MultiFile.pack.js';
     $this->template->scripts[] = 'media/js/upload.js';
 }
Exemple #4
0
 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in('admin')) {
         header('Location: /auto/login');
         exit;
     }
 }
Exemple #5
0
 public function before()
 {
     parent::before();
     if (is_null($this->_model)) {
         throw new Extasy_Exception('Model not defined');
     }
     $this->template->set_layout(Kohana::$config->load('layout')->admin);
 }
Exemple #6
0
 public function before()
 {
     Core::close_buffers(false);
     $this->phprpc = PHPRPC::server();
     $this->auto_add_action();
     $this->before_start();
     if (IS_DEBUG) {
         $this->phprpc->setDebugMode(true);
     }
     $this->phprpc->start();
     parent::before();
 }
Exemple #7
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Видео';
     \View::set_global('subnav', array('videos' => 'active'));
 }
Exemple #8
0
 public function action_login()
 {
     if (HTTP_Request::POST == $this->request->method() && Security::check(Arr::get($this->request->post(), 'csrf', '')) && Captcha::valid($_POST['captcha'])) {
         $remember = array_key_exists('remember', $this->request->post()) ? (bool) $this->request->post('remember') : FALSE;
         $user = Auth::instance()->login($this->request->post('username'), $this->request->post('password'), $remember);
         if ($user) {
             HTTP::redirect($this->config->get('admin_url'));
         } else {
             Session::instance()->set('error', 'Логин или пароль не верный');
             $errors = array('Логин или пароль не верный.');
         }
     }
     $this->template = 'login';
     parent::before();
     $captcha = Captcha::instance();
     $csrf = Security::token(true);
     $this->template->title = 'Вход в админ панель';
     $this->template->bind('errors', $errors)->bind('csrf', $csrf)->bind('captcha', $captcha);
     $errors = null;
     if (Auth::instance()->get_user()) {
         $auth = Auth::instance();
         $has_admin_role = $auth->logged_in('admin');
         if ($has_admin_role) {
             $session = Session::instance();
             $session->set('redirectAfterLogin', $_SERVER['REQUEST_URI']);
             HTTP::redirect('/' . $this->admin_url . '/');
         }
     }
 }
Exemple #9
0
 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  */
 public function before()
 {
     ACL::required('administer users');
     parent::before();
 }
Exemple #10
0
 public function before()
 {
     parent::before();
     list(, $this->user_id) = Auth::get_user_id();
 }
Exemple #11
0
 public function before()
 {
     $this->template = Session::get('template');
     parent::before();
 }
Exemple #12
0
 /**
  * Get upload base
  */
 public function before()
 {
     parent::before();
     $this->_base = DOCROOT . Kohana::config('cms.upload.folder') . '/';
 }
Exemple #13
0
 public function before()
 {
     parent::before();
     \View::set_global('subnav', array('competitions' => 'active'));
     $this->template->title = "Сезоны";
 }
 public function before()
 {
     parent::before();
     Breadcrumbs::instance()->add('Management', 'admin')->add('Announcements', 'admin/announcements');
 }
Exemple #15
0
 public function before()
 {
     parent::before();
     $menu = Request::factory('widgets/menu')->execute();
     $this->template->block_left = array($menu);
 }
Exemple #16
0
 public function before()
 {
     parent::before();
     \View::set_global('subnav', array('media' => 'active'));
 }
 public function before()
 {
     parent::before();
     $this->template->title = "Фотогалереи";
     \View::set_global('subnav', array('media' => 'active'));
 }
Exemple #18
0
 public function before()
 {
     parent::before();
     $config_main = (array) Kohana::$config->load('main');
     $this->admin_url = $config_main['admin_url'];
 }
Exemple #19
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Голосования';
     \View::set_global('subnav', array('votes' => 'active'));
 }
Exemple #20
0
 public function before()
 {
     parent::before();
     $this->template->title = "Команда";
     \View::set_global('subnav', array('players' => 'active'));
 }
Exemple #21
0
 public function before()
 {
     parent::before();
     $this->template->scripts = array('media/js/jquery-1.7.2.min.js', 'media/tinymce/tinymce.min.js', 'media/js/edit_tech.js');
     $this->template->submenu = Widget::load('SubMenuMain');
 }
Exemple #22
0
 public function before()
 {
     //parent::before();
     $this->_paginationConfig = array('prev_img' => Asset::img('pagination/prev.png', array("alt" => "Previous", 'class' => "prev-img")), 'prev_img_active' => Asset::img('pagination/prev.png', array("alt" => "Previous", 'class' => "prev-img-active")), 'first_img' => Asset::img('pagination/first.png', array("alt" => "first", 'class' => "first-img")), 'first_img_active' => Asset::img('pagination/first.png', array("alt" => "first", 'class' => "first-img-active")), 'next_img' => Asset::img('pagination/next.png', array("alt" => "Next", 'class' => "next-img")), 'next_img_active' => Asset::img('pagination/next.png', array("alt" => "Next", 'class' => "next-img-active")), 'last_img' => Asset::img('pagination/last.png', array("alt" => "Last", 'class' => "last-img")), 'last_img_active' => Asset::img('pagination/last.png', array("alt" => "Last", 'class' => "last-img-active")), 'css_id_prefix' => 'Dates', 'ajax_method' => 'loadDatesGrid', 'limit_default' => 30, 'limiter_choices' => array(30, 60, 100), 'limiter_prefix' => 'Dates');
     parent::before();
 }
Exemple #23
0
 public function before()
 {
     parent::before();
 }
Exemple #24
0
 public function before()
 {
     parent::before();
     $this->template->submenu = null;
 }