public function startup() { parent::startup(); if (!$this->lang) { $this->lang = 'cs'; } }
public function startup() { parent::startup(); if ($this->context->parameters['SHOP_ENABLE'] != 1) { $this->redirect(':Front:Underconstruction:default'); } }
public function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->redirect('Home:default'); } }
public function startup() { parent::startup(); $user = $this->getUser(); $backlink = $this->storeRequest(); if (!$this->context->parameters['productionMode'] && ($this->name == "Changelog:Changelog" || $this->name == 'Secured')) { // User can run changelog } else { // Ckecks if user is logged in, if not, redirect him to log in page if (!$user->isLoggedIn() || !$user->isALlowed("Admin:Homepage", 'view')) { if ($user->getLogoutReason() === User::INACTIVITY) { $this->flashMessage('You have been logged out due to long inactivity.', 'warning'); } // Fix for new ACL $this->user->logout(TRUE); $this->redirect(':Login:'******'backlink' => $backlink)); $this->terminate(); } // Check for access to current presenter && view, else throw exception $manageActionsArray = array("edit", "delete", "add"); $requiredPrivilege = "view"; foreach ($manageActionsArray as $action) { if (strpos($this->getAction(), $action) !== FALSE) { $requiredPrivilege = "manage"; } } if (!$user->isAllowed($this->getName(), $requiredPrivilege)) { $this->logger->logUnauthorizedAccess(); throw new HQ\UnauthorizedAccessException("Sorry, you are not authorized to enter this site."); } } }
protected function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->redirect('sign:in'); } }
/** * {@inheritdoc} */ protected function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->redirect('Sign:in', ['backlink' => $this->storeRequest()]); } }
function startup() { parent::startup(); $cache = NEnvironment::getCache(); if (!isset($cache['acl'])) { $cache['acl'] = new Acl(); } NEnvironment::getUser()->setAuthorizator($cache['acl']); $user = NEnvironment::getUser(); $aclModel = new AclModel(); // user authentication if (!$this->user->isLoggedIn()) { $backlink = $this->application->storeRequest(); $this->redirect(':Admin:Login:default', array('backlink' => $backlink, 'lang' => $this->lang)); } if (!$this->user->isAllowed('cms', 'edit')) { $this->flashMessage('Nemáte dostatočné prava.'); $backlink = $this->application->storeRequest(); $this->redirect(':Admin:Login:default', array('backlink' => $backlink, 'lang' => $this->lang)); } // <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> $this['header']['css']->addFile('../templates/admin/css/index.css'); $this['header']['css']->addFile('ajax.css'); $this['header']['css']->addFile('../jscripts/jquery/flick/jquery-ui-1.8.6.custom.css'); $this['header']['css']->addFile('../jscripts/jquery/tags/jquery.tagsinput.css'); $this['header']['js']->addFile('jquery/tags/jquery.tagsinput.js'); // $this['header']['js']->addFile('/jquery/jquery-1.4.2.js'); $this['header']['js']->addFile('/jquery/jquery.nette.js'); $this['header']['js']->addFile('/jquery/jquery.livequery.js'); $this['header']['js']->addFile('jquery/jquery-ui-1.8.5.custom.min.js'); $this['header']['js']->addFile('jquery/jquery.highlight.js'); $this['header']['js']->addFile('jquery/jquery.easy-confirm-dialog.js'); $this['header']['js']->addFile('confl.js'); // $this['header']->setHtmlTag( NHtml::el('script type="text/javacript"')->add( 'alert(1)' ) ); }
/** * startup method * @return void */ public function startup() { parent::startup(); $this->groups = array_merge(array('' => _("All")), $this->model->getConfig()["groups"]); $this->compressions = $this->model->getConfig()["compressions"]; return; }
protected function startup() { parent::startup(); $this->template->module = "foo"; $rbb = $this->getParam('__rbb'); if ($rbb) { $this->isRequestButton = $this->template->isRequestButton = true; } else { $this->isRequestButton = $this->template->isRequestButton = false; } //Debug::dump($this->presenterName); //Debug::dump($this->action); /** * Nastaveni obecneho pristupu do administrace */ if (!$this->context->user->isAllowed('backend', 'default')) { $backlink = $this->storeRequest(); $this->redirect(':Sign:in', $backlink); } /** * Nastaveni pristupu na urovni presenter-action if (!$this->context->user->isAllowed(strtolower($this->presenterName), strtolower($this->action))) { $this->flashMessage('You are not allowed to access in this module.', 'info'); $backlink = $this->getApplication()->storeRequest(); $this->redirect(':Auth:login', $backlink); } */ // Debug::dump($this->mainSession->sorting); $this->orderBy = isset($this->mainSession->sorting['orderBy']) ? $this->mainSession->sorting['orderBy'] : $this->orderBy; $this->sort = isset($this->mainSession->sorting['sort']) ? $this->mainSession->sorting['sort'] : $this->sort; $this->template->sort = $this->sort; $this->template->orderBy = $this->orderBy; }
public function startup() { parent::startup(); if (!$this->user->isAllowed('errors', 'view')) { throw new \Nette\Application\BadRequestException('Forbidden', 403); } }
/** * Protect for secured, if not logged in redirect to the Sign */ public function startup() { parent::startup(); if ($this->user->isLoggedIn() === FALSE) { $this->redirect('Sign:in', array('backlink' => $this->storeRequest())); } }
protected function startup() { if (!Environment::isConsole()) { throw new InvalidStateException('Access allowed only from console!'); } parent::startup(); }
/** * (non-phpDoc) * * @see Nette\Application\Presenter#startup() */ public function startup() { parent::startup(); $this['header']['css']->addFile('acl/acl.css'); $this['header']['js']->addFile('acl/create-key.js'); $this->cache = NEnvironment::getCache(); }
protected function startup() { parent::startup(); if (!$this->getUser()->isLoggedIn()) { $this->redirect('Sign:in'); } }
public function startup() { parent::startup(); if (!$this->installed) { $this->redirect(':Install:Default:default'); } }
/** * startup description * @throws \Nette\Application\BadRequestException */ public function startup() { parent::startup(); if (!$this->getRequest()->isMethod(\Nette\Application\Request::FORWARD)) { $this->error(); } }
protected function startup() { parent::startup(); $httpRequest = $this->context->getService('httpRequest'); $url = $httpRequest->getUrl()->host; $this->logger = $this->getService('logger'); $this->logger->setId_uzivatele(''); }
public function startup() { parent::startup(); $this['header']['css']->addFile('authentication/auth.css'); $this['header']['js']->addFile('jquery/In-Field-Labels/src/jquery.infieldlabel.min.js'); $this->session->start(); // required by $form->addProtection() }
protected function startup() { parent::startup(); $captcha = new CaptchaBase(); $captcha->setExtension(new SeznamCaptcha()); //$captcha->setExtension(new reCaptcha()); NFormContainer::extensionMethod('addCaptcha', [$captcha, 'captcha']); }
protected function startup() { parent::startup(); // we don't want authenticated users see the login form again if ($this->getUser()->isLoggedIn()) { $this->redirect('HomePage:'); } }
protected function startup() { parent::startup(); $this->logger = $this->getService('logger'); $this->getUser()->logout(TRUE); $this->osobyRepository = $this->getService('osobyRepository'); $this->odeslani_mailu = $this->getService('odeslaniMailu'); }
/** * Setup presenter - only users with view privileges can view * @return void */ public function startup() { parent::startup(); if (!$this->user->isAllowed("config", "view")) { $this->flashMessage(_("You are not allowed to manage server !"), "danger"); $this->redirect(":Homepage:default"); } return; }
protected function startup() { parent::startup(); if (($page = $this->pageRepository->findOneBy(array('special' => 'tags'))) === NULL) { $this->flashMessage($this->translator->translate('Page with tags does not exist.'), 'warning'); } else { $this->extendedPage = $this->getEntityManager()->getRepository($page->class)->findOneBy(array('page' => $page)); } }
/** * Startup */ public function startup() { parent::startup(); $texy = $this->getService('Texy'); $this->baseFolderPath = $texy->imageModule->fileRoot; $this->baseFolderUri = $texy->imageModule->root; $this->tempDir = TEMP_DIR; $this->tempUri = $this->template->basePath . "/temp"; }
public function startup() { parent::startup(); if ($this->user->isAllowed("Admin:Board")) { $this->redirect("Board:default"); } else { $this->redirect("PersonalChange:default"); } }
/** * Startup */ public function startup() { parent::startup(); $texy = Environment::getService("Texy"); $this->baseFolderPath = $texy->imageModule->fileRoot; $this->baseFolderUri = $texy->imageModule->root; $this->tempDir = WWW_DIR . "/webtemp"; $this->tempUri = Environment::getVariable("baseUri") . "/webtemp"; }
protected function startup() { parent::startup(); $this->model = new UsersModel(); $this->config = Environment::getConfig('forgottenPass'); $this->tempLoginExpiration = $this->config->tempLoginExpiration; $this->tempLoginTokenExpiration = $this->config->tempLoginTokenExpiration; // set already here because it's used in tempLoginFormSubmitted() $this->template->loginExpiration = substr($this->tempLoginExpiration, 1); }
public function startup() { parent::startup(); $this->template->addFilter("dicomString", function ($text) { return \Nette\Utils\Strings::replace($text, "/\\^/", " "); }); $this->template->addFilter("dicomDate", function ($text) { return date("d-m-Y", strtotime($text)); }); return; }
protected function startup() { parent::startup(); $this->model = new Model(); $this->fileModel = new FileModel(); $user = Environment::getUser(); if (!$user->isLoggedIn()) { // je uživatel přihlášen? $this->redirect(':Admin:Login:'); } }
public function startup() { parent::startup(); if ($this->lang == 'cs') { $this->categories = $this->categoriesCs; $this->subcategories = $this->subcategoriesCs; } else { $this->categories = $this->categoriesEn; $this->subcategories = $this->subcategoriesEn; } }