public function beforeAction($action) { if (Yii::app()->user->isGuest) { $this->redirect('/'); } return parent::beforeAction($action); }
public function beforeAction($action) { $base = Cshop::$rootpath; $jsfilename = $base . "/static/cache/final.js"; if (!file_exists($jsfilename)) { $filename = $base . "/static/js/jquery.js"; $js = file_get_contents($filename); $filename = $base . "/static/js/jquery-ui.js"; $js .= file_get_contents($filename); $filename = $base . "/static/js/jquery.mousewheel.js"; $js .= file_get_contents($filename); $filename = $base . "/static/js/perfect-scrollbar.js"; $js .= file_get_contents($filename); $filename = $base . "/static/js/jquery.placeholder.js"; $js .= file_get_contents($filename); $filename = $base . "/static/js/jquery.noty.packaged.min.js"; $js .= file_get_contents($filename); $filename = $base . "/static/js/script.js"; $js .= file_get_contents($filename); $js = JSMin::minify($js); file_put_contents($jsfilename, $js); } $cssfilename = $base . "/static/cache/final.css"; if (!file_exists($cssfilename)) { $filename = $base . "/static/css/style.css"; $css = file_get_contents($filename); $filename = $base . "/static/css/perfect-scrollbar.css"; $css .= file_get_contents($filename); $minify = new CSSmin(); $css = $minify->run($css, true); file_put_contents($cssfilename, $css); } return parent::beforeAction($action); }
public function beforeAction($action) { $noAuthActions = ['get-faqs']; if (in_array($action->id, $noAuthActions)) { return true; } return parent::beforeAction($action); }
protected function beforeAction($action) { // Sample code to be used when RBAC is fully implemented. // if (!Yii::app()->user->checkAccess('admin')) { // throw new CHttpException(403, 'You are not authorised to perform this action.'); // } return parent::beforeAction($action); }
protected function beforeAction($action) { $route = $this->id . '/' . $action->id; if (!$this->allowIp(Yii::app()->request->userHostAddress) and $route !== 'main/error') { throw new CHttpException(403, "У вас недостаточно прав для просмотра данной страницы. Ваш IP-адрес: " . Yii::app()->request->userHostAddress); } return parent::beforeAction($action); }
protected function beforeAction($action) { // Pull in the admin layout controls for ease of UI setup Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10); Yii::app()->assetManager->registerCssFile('components/font-awesome/css/font-awesome.css', null, 10); $this->manager = new WorklistManager(); return parent::beforeAction($action); }
public function beforeAction($action) { $before = parent::beforeAction($action); $assetManager = Yii::app()->getAssetManager(); $assetManager->getClientScript()->reset(); $this->user = User::model()->findByPk(Yii::app()->user->id); return $before; }
public function beforeAction($action) { $userid = Yii::app()->session['user']->id; if ($userid != 2103 and $userid != 122 and $userid != 613 and $userid != 1330 and $userid != 1) { return false; } return parent::beforeAction($action); }
protected function beforeAction($action) { Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10); Yii::app()->assetManager->registerCssFile('components/font-awesome/css/font-awesome.css', null, 10); Yii::app()->assetManager->registerScriptFile('js/admin.js', null, 10); $this->jsVars['items_per_page'] = $this->items_per_page; return parent::beforeAction($action); }
protected function beforeAction($action) { Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10); Yii::app()->assetManager->registerScriptFile('js/admin.js', null, 10); $this->jsVars['items_per_page'] = $this->items_per_page; if (!empty($_POST['GenericAdminModel'])) { $this->handleGenericAdmin(); } return parent::beforeAction($action); }
protected function beforeAction($action) { if (!Yii::app()->params['profile_user_can_edit']) { $this->redirect('/'); } Yii::app()->assetManager->registerCssFile('css/admin.css'); Yii::app()->assetManager->registerScriptFile('js/profile.js'); $this->jsVars['items_per_page'] = $this->items_per_page; return parent::beforeAction($action); }
protected function beforeAction($action) { parent::storeData(); $this->firm = Firm::model()->findByPk($this->selectedFirmId); if (!isset($this->firm)) { // No firm selected, reject throw new CHttpException(403, 'You are not authorised to view this page without selecting a firm.'); } return parent::beforeAction($action); }
function beforeAction() { define('AUTH_REQUIRED', true); parent::beforeAction(); $this->set("tab", 'index'); $this->setWrapperDir("/admin"); $this->aNav = $this->backend->getNavigationTree(); $this->set('aNav', $this->aNav); $this->aPages = $this->backend->getPages(); $this->set('aPages', $this->aPages); }
public function beforeAction($action) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { CShop::app()->getCache()->flush(); } if ($action != 'login') { $this->user->isLogin('login.php'); } elseif ($this->user->isLogin()) { CShop::app()->redirect('index.php'); } return parent::beforeAction($action); }
public function beforeAction(CAction $action) { // Если заход на страницу авторизации или на заглушку - пускаем if (in_array($action->id, array('login', 'cap'))) { return parent::beforeAction($action); } // Если установлено "Закрыть общий доступ к сайту" и при этом смотрит не админ - // Показываем заглушку if (Yii::app()->config->adminonly and Yii::app()->user->isGuest) { $this->redirect('/site/cap'); } return parent::beforeAction($action); }
/** * * @param type $action * @return boolean */ public function beforeAction($action) { // Yii::$app->user->loginUrl[0] ดูที่ config.php $this->redirectLogin = $this->redirectLogin === null ? Yii::$app->user->loginUrl[0] : $this->redirectLogin; if (!parent::beforeAction($action)) { return false; } if (Yii::$app->requestedRoute === Yii::$app->user->loginUrl[0]) { return true; } if (Yii::$app->user->isGuest) { Yii::$app->user->setReturnUrl(Yii::$app->request->url); Yii::$app->getResponse()->redirect([$this->redirectLogin])->send(); return false; } return true; }
protected function beforeAction($action) { parent::beforeAction($action); Yii::app()->assetManager->registerCssFile('css/reports.css', null, 10); Yii::app()->assetManager->registerScriptFile('js/reports.js'); if ($this->module) { $this->modulePathAlias = 'application.modules.' . $this->getModule()->name; $this->assetPathAlias = $this->modulePathAlias . '.assets'; // Set asset path if (file_exists(Yii::getPathOfAlias($this->assetPathAlias))) { $this->assetPath = Yii::app()->assetManager->getPublishedPathOfAlias('application.modules.' . $this->getModule()->name . '.assets'); } if (file_exists(getcwd() . '/protected/modules/' . $this->module->id . '/assets/js/reports.js')) { Yii::app()->clientScript->registerScriptFile("{$this->assetPath}/js/reports.js", CClientScript::POS_END); } } else { if (file_exists(getcwd() . '/protected/assets/js/report_' . $action->id . '.js')) { Yii::app()->assetManager->registerScriptFile('js/report_' . $action->id . '.js'); } } $this->jsVars['items_per_page'] = $this->items_per_page; return true; }
function beforeAction() { define('AUTH_REQUIRED', false); parent::beforeAction(); $this->set("tab", 'index'); }
public function beforeAction($action) { $userid = Yii::app()->session['user']->id; //if (($userid != 2103)and($userid != 122)and($userid != 613)and($userid != 1330)and($userid != 1)) return false; return parent::beforeAction($action); }
function beforeAction() { parent::beforeAction(); $this->setWrapperDir("/access"); }
public function beforeAction($action) { return parent::beforeAction($action); }
protected function beforeAction($action) { $theme = $this->getTheme(); Yii::app()->theme = is_null($theme) ? 'default_dark' : $theme; return parent::beforeAction($action); }
public function beforeAction($action) { parent::storeData(); $this->firm = Firm::model()->findByPk($this->selectedFirmId); return parent::beforeAction($action); }
protected function beforeAction() { parent::beforeAction(); return true; }
function beforeAction() { parent::beforeAction(); $this->set("tab", 'index'); }
/** * Sets up various standard js and css files for modules * * @param CAction $action * @return bool * (non-phpdoc) * @see parent::beforeAction($action) */ protected function beforeAction($action) { if ($this->event_type && $this->event_type->disabled) { // disabled module $this->redirectToPatientEpisodes(); } // Set the module CSS class name. $this->moduleNameCssClass = strtolower($this->module->id); // Register module assets. $this->registerAssets(); return parent::beforeAction($action); }