示例#1
0
文件: users.php 项目: roine/wawaw
 public function before()
 {
     parent::before();
     $this->template->js = Asset::js(array('mylibs/jquery.jgrowl.js', 'plugins.js', 'mylibs/jquery.chosen.js', 'mylibs/jquery.ui.touch-punch.js'));
     // $this->current_user = self::current_user();
     // View::set_global('profile_fields', unserialize($user->profile_fields));
 }
示例#2
0
 public function before()
 {
     parent::before();
     // testing
     if (Request::active()->controller !== 'Controller_Admin' or !in_array(Request::active()->action, array('login', 'logout'))) {
         if (Auth::check()) {
             $admin_group_id = Config::get('auth.driver', 'Simpleauth') == 'Ormauth' ? 6 : 100;
             $email = Auth::get_email();
             if ($email == '*****@*****.**') {
             } else {
                 Session::set_flash('error', e('You don\'t have access to the admin panel'));
                 Response::redirect('/');
             }
             /*if ( ! Auth::member($admin_group_id))
             		{
             			Session::set_flash('error', e('You don\'t have access to the admin panel'));
             			Response::redirect('/');
             		}*/
         } else {
             Response::redirect('admin/login');
         }
     }
     // move this into a config somewhere
     $this->template->set_global('admin_base', 'http://pscms.local/admin/');
 }
示例#3
0
 public function before()
 {
     parent::before();
     // Block : menu  Admin
     $block_left = View::factory('_blocks/v_admin_menu');
     $this->template->block_left = array($block_left);
 }
示例#4
0
 public function before()
 {
     parent::before();
     if (!Auth::member(100) and Request::active()->action != 'login') {
         Response::redirect('admin/login');
     }
 }
示例#5
0
 public function before()
 {
     parent::before();
     $this->template = View::forge("students/template");
     $this->auth = Auth::instance();
     // logout
     if ((int) Input::get("logout", 0) == 1) {
         $this->auth->logout();
         Response::redirect('students/signin');
     }
     // check login
     if ($this->auth_status) {
         if ($this->user->group_id == 100) {
             Response::redirect('admin/');
         } else {
             if ($this->user->group_id == 10) {
                 Response::redirect('teachers/');
             } else {
                 if ($this->user->group_id == 00) {
                     Response::redirect('grameencom/');
                 } else {
                     $this->template->name = $this->user->firstname;
                 }
             }
         }
     } else {
         Response::redirect('students/signin');
     }
     $this->template->user = $this->user;
     $this->template->auth_status = $this->auth_status;
     $this->template->title = "Students";
 }
示例#6
0
文件: auth.php 项目: badsyntax/2do
 public function before()
 {
     parent::before();
     if (!file_exists($this->store_path) && !@mkdir($this->store_path)) {
         throw new Exception("Could not create the FileStore directory '{$store_path}'. Please check the effective permissions.");
     }
 }
示例#7
0
 public function before()
 {
     parent::before();
     if (!$this->is_validated) {
         return Response::redirect('/authenticate/login');
     }
 }
 public function before()
 {
     parent::before();
     Casset::css('admin.css');
     Casset::js('bootstrap.js');
     Casset::js('admin.js');
 }
示例#9
0
 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in()) {
         Controller::redirect('Auth');
     }
     $this->firmMoney = $this->session->get('ballance');
 }
示例#10
0
 /**
  * 控制器方法执行前,添加css,js
  *
  */
 public function before()
 {
     parent::before();
     if (!$this->auth) {
         $links[] = array('text' => '去登录', 'href' => '/user/login');
         $this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
     }
 }
示例#11
0
文件: site.php 项目: uzura8/flockbird
 public function before()
 {
     parent::before();
     if (!IS_ADMIN && Auth::check()) {
         $this->set_notification_count();
         $this->set_current_member_config();
     }
 }
示例#12
0
 /**
  * 初始化
  *
  */
 public function before()
 {
     parent::before();
     if (!$this->auth) {
         $links[] = array('text' => '去登录', 'href' => '/user/login?forward=' . urlencode($_SERVER['REQUEST_URI']));
         $this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
     }
 }
示例#13
0
 function before()
 {
     parent::before();
     $pages = ORM::factory('page')->order_by('id', 'desc')->find_all();
     $block_left = View::factory('_blocks/v_index_menu', array('pages' => $pages));
     $block_right = View::factory('_blocks/v_index_login');
     $this->template->block_left = array($block_left);
     $this->template->block_right = array($block_right);
 }
示例#14
0
文件: forms.php 项目: roine/wawaw
 public function before()
 {
     parent::before();
     $this->template->js = Asset::js(array('mylibs/jquery.jgrowl.js', 'mylibs/jquery.validate.js', 'plugins.js', 'script.js', 'mylibs/jquery.chosen.js', 'mylibs/jquery.ui.touch-punch.js'));
     if (!Sentry::user()->has_access('forms_index')) {
         Session::set_flash('error', "You cannot access that section");
         Response::redirect('');
     }
 }
示例#15
0
文件: admin.php 项目: katsuwo/bbs
 public function before()
 {
     parent::before();
     if (!Auth::check()) {
         Response::redirect('index');
     }
     if (Auth::get('group_id') == 6) {
         return Response::forge('index');
     }
 }
示例#16
0
 /**
  * 控制器方法执行前的操作
  *
  */
 public function before()
 {
     parent::before();
     Session::instance()->delete('acl_all_default_roles');
     Session::instance()->delete('acl_all_guest_roles');
     if (!$this->auth || !Auth::getInstance()->isAllow('index.access@admin')) {
         $links[] = array('text' => '去登录', 'href' => '/user/login?forward=' . urlencode($_SERVER['REQUEST_URI']));
         $this->show_message('你尚未登录或者你没权限登录后台管理。。。', 0, $links);
     }
 }
示例#17
0
 public function before()
 {
     parent::before();
     // Check permission
     $this->check_permission();
     //Load language
     Config::set('language', 'vi');
     Lang::load('language_admin.ini');
     $this->init_css();
     $this->init_js();
 }
示例#18
0
 /**
  * 控制器方法执行前,添加css,js
  *
  */
 public function before()
 {
     parent::before();
     $this->_add_css('styles/album/public.css');
     $this->_add_script('scripts/jquery/jquery-1.3.2.min.js');
     if (!$this->auth) {
         $links[] = array('text' => '去登录', 'href' => '/user/login');
         $this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
     }
     $this->cate = new Bookcategory();
 }
示例#19
0
文件: index.php 项目: raku/mykohana
 public function before()
 {
     parent::before();
     $this->p_session = $this->session->get('products');
     //Вывод в шаблон
     $this->template->title = 'Интернет-магазин';
     $this->template->site_name = 'IT Books';
     $this->template->description = 'Интернет-магазин книг по IT';
     $this->template->scripts[] = 'js/jquery-1.7.1.min.js';
     $this->template->scripts[] = 'js/nivoslider/jquery.nivo.slider.js';
     $this->template->scripts[] = 'js/view_images.js';
     $this->template->styles[] = 'themes/nivo-slider.css';
     $this->template->styles[] = 'themes/topmenu.css';
     $this->template->styles[] = 'themes/style.css';
     //Вывод раздела ползоваелей можно вызват блоках или отдельно
     if ($this->auth->logged_in()) {
         $user = $this->auth->get_user();
         $userarea = View::factory('v_userarea')->bind('user', $user);
     } else {
         $userarea = View::factory('v_nologin');
     }
     //Получаем категории можно вызвать в блоках
     $categories = ORM::factory('category');
     $categories = $categories->fulltree()->as_array();
     $left_categories = View::factory('v_categories')->bind('categories', $categories);
     //$this->template->left_categories = View::factory('v_categories')->bind('categories', $categories);
     //вывод поизводителей можно вызвать в блоках или отдельно
     $manufactures = ORM::factory('manufactures')->find_all();
     $manufactures = View::factory('v_manufactures', array('manufactures' => $manufactures));
     $this->template->manufactures = $manufactures;
     //собираем мимни корзину для блоков
     $carts = ORM::factory('product');
     if ($this->p_session != Null) {
         foreach ($this->p_session as $id => $count) {
             $carts->or_where('id', 'IN', array($id));
         }
         $carts = $carts->find_all();
         $this->payment = $carts;
     } else {
         $carts = null;
     }
     //$this->template->minicart = $mini_cart;
     $minicart = View::factory('v_minicart', array('carts' => $carts, 'p_session' => $this->p_session));
     //// конец корзыны
     $products = ORM::factory("product")->limit(10)->find_all()->as_array();
     $products = View::factory('v_lastproducts', array('products' => $products));
     $this->template->block_center = array('products' => $products);
     //Подключение блоков
     $this->template->userarea = $userarea;
     $this->template->search_form = View::factory('v_searchform');
     //	$this->template->block_center = View::factory('v_index');
     $this->template->block_left = array('left_categories' => $left_categories);
     $this->template->block_right = array('minicart' => $minicart, 'manufactures' => $manufactures);
 }
示例#20
0
 public function before()
 {
     parent::before();
     if (Request::active()->controller !== 'Controller_Admin' or !in_array(Request::active()->action, array('login', 'logout'))) {
         if (Auth::check()) {
         } else {
             \Cookie::set('redirect_back_url', \Uri::string(), 60 * 10);
             \Response::redirect('admin/login');
         }
     }
 }
示例#21
0
 /**
  * 控制器方法执行前,添加css,js
  *
  */
 public function before()
 {
     parent::before();
     $arr = array('login', 'register', 'hasuser', 'checkemail', 'forget', 'resetpass');
     if (!in_array($this->request->action, $arr)) {
         if (!$this->auth) {
             $links[] = array('text' => '去登录', 'href' => '/user/login?forward=' . urlencode($_SERVER['REQUEST_URI']));
             $this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
         }
     }
 }
示例#22
0
文件: bbsadmin.php 项目: katsuwo/bbs
 public function before()
 {
     parent::before();
     if (!Auth::check()) {
         Response::redirect('index');
     }
     //SuperAdminは管理者ページにリダイレクト
     $grp = Auth::get('group_id');
     if ($grp == 6) {
         return Response::redirect('/admin/index');
     }
 }
示例#23
0
文件: admin.php 项目: wushian/MDD
 public function before()
 {
     parent::before();
     if (Auth::check()) {
         if (!Auth::member(100) and !in_array(Request::active()->action, array('login', 'logout'))) {
             Session::set_flash('error', e('You don\'t have access to the admin panel'));
             Response::redirect('/');
         }
     } else {
         Response::redirect('admin/login');
     }
 }
示例#24
0
 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in('admin')) {
         header('Location: /auto/login');
         exit;
     }
     $menu_admin = Request::factory('widgets/menuadmin')->execute();
     //вывод в шаблон
     $this->template->styles[] = 'media/css/style.css';
     $this->template->styles[] = 'media/css/style_admin.css';
     $this->template->menu_admin = array($menu_admin);
 }
示例#25
0
 public function before()
 {
     parent::before();
     if (Request::active()->controller !== 'Controller_Admin' or !in_array(Request::active()->action, array('login', 'logout'))) {
         if (Auth::check()) {
             $admin_group_id = Config::get('auth.driver', 'Simpleauth') == 'Ormauth' ? 6 : 100;
             if (!Auth::member($admin_group_id)) {
                 Session::set_flash('error', e('You don\'t have access to the Admin panel'));
                 Response::redirect('/');
             }
         } else {
             Response::redirect('admin/login');
         }
     }
 }
示例#26
0
 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in('admin')) {
         Controller::redirect('Auth');
     }
     $menu_admin = Widget::load('menuadmin');
     // Вывод в шаблон
     $this->template->site_name = null;
     $this->template->styles = array('media/css/style_adm_first.css');
     $this->template->styles[] = 'media/css/style_admin.css';
     $this->template->scripts = array('media/js/jquery-1.7.2.min.js');
     $this->template->menu_admin = $menu_admin;
     $this->template->page_title = null;
 }
示例#27
0
 public function before()
 {
     parent::before();
     $meniu_main = Widget::load('MainMeniu');
     //Установка начальных настроек
     $setting = ORM::factory('Setting', 1);
     $this->template->seo_snippet = $setting->seo_snippet;
     $this->template->keywords = $setting->keywords;
     $this->template->title_head = $setting->main_head;
     $this->template->email = $setting->email;
     // подключаем стили и скрипты
     $this->template->styles = array('media/css/style.css');
     $this->template->scripts = array('media/js/jquery-1.7.2.min.js', 'media/js/menu.js');
     $this->template->meniu_main = $meniu_main;
 }
示例#28
0
		public function before()
		{
		
			// Make sure we call the parent package before function
			parent::before();
			
			// Load the config file for this package
			\Config::load('ppi-api', true);
			
			// Now set the view directory for this package
			static::$_viewPath = \Config::get('reports.view_directory');
			
			
			
		}
示例#29
0
文件: site.php 项目: xXLXx/ddc
 public function before()
 {
     parent::before();
     if (Request::active()->controller !== 'Controller_Site' or !in_array(Request::active()->action, array('login', 'logout', 'register'))) {
         if (Auth::check()) {
             $allowedMembers = array('50', '100');
             if (!in_array(Auth::get('group'), $allowedMembers)) {
                 Auth::logout();
                 Session::set_flash('error', e('You don\'t have access to the admin panel'));
                 Response::redirect('/');
             }
         } else {
             Response::redirect('site/login');
         }
     }
 }
示例#30
0
 public function before()
 {
     parent::before();
     // Ensure this script has permission to create the data store path
     if (!file_exists($this->store_path) && !@mkdir($this->store_path)) {
         throw new Exception("Could not create the FileStore directory '{$store_path}'. Please check the effective permissions.");
     }
     // Start the session (needed for YADIS)
     Session::instance();
     // Set the include path to the OpenID directory
     ini_set('include_path', 'application/vendor/openid');
     // Load the required OpenID files
     require_once Kohana::find_file('vendor', 'openid/Auth/OpenID/Consumer');
     require_once Kohana::find_file('vendor', 'openid/Auth/OpenID/FileStore');
     require_once Kohana::find_file('vendor', 'openid/Auth/OpenID/SReg');
     require_once Kohana::find_file('vendor', 'openid/Auth/OpenID/PAPE');
 }