public function after() { if ($this->has_controller_and_action()) { $this->_controller_base->after(); } else { parent::after(); } }
public function before() { if (!Auth::instance()->logged_in('admin')) { exit; } parent::before(); }
public function beforeFilter() { if (isset($this->Auth)) { $this->Auth->allow('config'); } parent::beforeFilter(); }
public function before() { $fullBaseUrl = Url::base(true); //was user on our site? if (strpos($this->request->referrer(), $fullBaseUrl) === 0) { //now check that a controller set, it wasn't the user controller, and that the session var "noReturn" is not false $uri = parse_url($this->request->referrer(), PHP_URL_PATH); // correct the path for url_base and index_file, in part taken from Kohana_Request::detect_uri() // Get the path from the base URL, including the index file $base_url = parse_url(Kohana::$base_url, PHP_URL_PATH); if (strpos($uri, $base_url) === 0) { // Remove the base URL from the URI $uri = (string) substr($uri, strlen($base_url)); } if (Kohana::$index_file and strpos($uri, Kohana::$index_file) === 0) { // Remove the index file from the URI $uri = (string) substr($uri, strlen(Kohana::$index_file)); } $processedRef = Request::process_uri($uri); $referrerController = Arr::path($processedRef, 'params.controller', false); if ($referrerController && $referrerController != 'user' && !Session::instance()->get('noReturn', false)) { Session::instance()->set('returnUrl', $this->request->referrer()); } } parent::before(); }
public function before() { $baseUrl = Url::base(true); if (substr($this->request->referrer(), 0, strlen($baseUrl)) == $baseUrl) { $urlPath = ltrim(parse_url($this->request->referrer(), PHP_URL_PATH), '/'); $processedRef = Request::process_uri($urlPath); $referrerController = Arr::path($processedRef, 'params.controller', false); if ($referrerController && $referrerController != 'user' && !Session::instance()->get('noReturn', false)) { Session::instance()->set('returnUrl', $this->request->referrer()); } } parent::before(); }
/** * Before action * * @throws HTTP_Exception_403 */ public function before() { parent::before(); $this->auth = Auth::instance(); $this->user = $this->auth->get_user(); $this->is_admin = $this->auth->logged_in('admin'); // Проверяем права на доступ к текущей странице if ($this->auth_required !== false and $this->auth->logged_in($this->auth_required) === false or is_array($this->secure_actions) and array_key_exists($this->request->action(), $this->secure_actions) and $this->auth->logged_in($this->secure_actions[$this->request->action()]) === false) { // Если нет прав и AJAX запрос, то выдаем эксепшен if ($this->auth->logged_in() and $this->request->is_ajax()) { throw new HTTP_Exception_403('Unauthorised access attempt'); } else { throw new HTTP_Exception_403('Unauthorised access attempt'); Message::error(__('Unauthorised access attempt!')); HTTP::redirect(Route::url('f_home')); } } }
public function before() { $baseUrl = URL::base(true); if (substr($this->request->referrer(), 0, strlen($baseUrl)) == $baseUrl) { $urlPath = ltrim(parse_url($this->request->referrer(), PHP_URL_PATH), '/'); $processedRef = Request::process(new Request($urlPath)); $referrerController = Arr::path($processedRef, 'params.controller', false); if ($referrerController && $referrerController != 'user' && !Session::instance()->get('noReturn', false)) { Session::instance()->set('returnUrl', $this->request->referrer()); } } if ($this->request->action() == "profile") { if (isset($_GET["old"])) { $this->template = "admin"; } else { $this->template = "admin"; } } parent::before(); }
public function after() { View::set_global('model', $this->model); View::set_global('parent', $this->parent); View::set_global('parent_id', $this->parent_id); View::set_global('title', $this->title); View::set_global('belongs_to', $this->belongs_to); View::set_global('has_many', $this->has_many); View::set_global('labels', $this->labels); View::set_global('model_name', $this->model_name); View::set_global('image_fields', $this->image_fields); View::set_global('upload_fields', $this->upload_fields); View::set_global('boolean_fields', $this->boolean_fields); View::set_global('boolean_fields_labels', $this->boolean_fields_labels); View::set_global('ignore_actions', $this->ignore_actions); View::set_global('form_actions', $this->form_actions()); View::set_global('breadcrumb', $this->breadcrumb()); View::set_global('search_view', $this->search_view()); View::set_global('scripts', $this->scripts()); View::set_global('breadcrumbs', $this->breadcrumbs); View::set_global('actions', $this->actions); View::set_global('ignore_fields', $this->ignore_fields); View::set_global('can_export', $this->can_export); View::set_global('can_search', $this->can_search); View::set_global('bootstrap_css', $this->bootstrap_css); if ($this->parent) { View::set_global('parent_title', ucfirst($this->parent)); View::set_global('foreign_key', $this->parent); View::set_global('parent_model', $this->parent_model); } View::set_global('url', $this->url()); parent::after(); }
/** * Método para permitir acciones sin estar autenticado * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) * @version 2015-12-24 */ public function beforeFilter() { $this->Auth->allow('index', 'generar_xml', 'generar_pdf', 'generar_libro', 'generar_libro_guia', 'firmar_xml'); parent::beforeFilter(); }
public static function _init() { parent::_init(); // Config::set('language', 'th'); // Lang::load('Docmk011'); }
/** * Método para permitir acciones sin estar autenticado * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) * @version 2015-09-13 */ public function beforeFilter() { $this->Auth->allow('index', 'set_pruebas', 'simulacion', 'intercambio', 'muestras_impresas', 'set_pruebas_dte', 'set_pruebas_ventas', 'set_pruebas_compras'); parent::beforeFilter(); }
/** * Método para permitir acciones sin estar autenticado * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) * @version 2015-12-12 */ public function beforeFilter() { $this->Auth->allow('pdf', 'xml'); parent::beforeFilter(); }
/** * Método para permitir acciones sin estar autenticado * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) * @version 2016-01-07 */ public function beforeFilter() { $this->Auth->allow('index', 'produccion', 'certificacion', 'grafico_usuarios_ingreso'); parent::beforeFilter(); }
/** * Método para permitir acciones sin estar autenticado * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) * @version 2015-12-12 */ public function beforeFilter() { $this->Auth->allow('consultar'); parent::beforeFilter(); }
public static function _init() { parent::_init(); $objects = \Model_Group::find('all', array('order_by' => 'level')); static::$groups = Petro::obj_to_keyval($objects, 'level', 'name'); }
public function after() { parent::after(); }