protected function startup() { parent::startup(); if ($this->getParameter('debug', FALSE)) { \Nette\Diagnostics\Debugger::$productionMode = FALSE; } }
protected function startup() { parent::startup(); $this->items = $this->context->createServiceFiles(); $this->template->setFile(''); // nebude shanet sablonu }
protected function startup() { parent::startup(); if (!$this->type) { $this->type = key($this->securityManager->getUserTypes()); } }
/** * startup method * @return void */ public function startup() { parent::startup(); $this->lang = $this->translator->setLanguage($this->lang); $this->user = $this->getUser(); return; }
protected function startup() { parent::startup(); // Login check if ($this->getName() != 'Admin:Sign') { $role = $this->user->getRoles(); $roleCheck = $this->database->table("users_roles")->get($role[0]); if ($roleCheck->admin_access == 0) { $this->flashMessage($this->translator->translate('messages.sign.invalidLogin'), "error"); $this->redirect(':Admin:Sign:in'); } if ($this->user->isLoggedIn()) { } else { if ($this->user->logoutReason === Nette\Security\IUserStorage::INACTIVITY) { $this->flashMessage($this->translator->translate('messages.sign.youWereLoggedIn'), "note"); } $this->redirect('Sign:in', array('backlink' => $this->storeRequest())); } } if ($this->user->isLoggedIn()) { $this->template->isLoggedIn = TRUE; $this->template->member = $this->database->table("users")->get($this->user->getId()); } // Set values from db $this->template->settings = $this->database->table("settings")->fetchPairs("setkey", "setvalue"); $this->template->appDir = APP_DIR; $this->template->signed = TRUE; $this->template->langSelected = $this->translator->getLocale(); // Set language from cookie if ($this->context->httpRequest->getCookie('language_admin') == '') { $this->translator->setLocale($this->translator->getDefaultLocale()); } else { $this->translator->setLocale($this->context->httpRequest->getCookie('language_admin')); } }
protected function startup() { parent::startup(); $this->template->page = $this->getName(); $this->template->cartCount = 1; $this->template->cartPrice = 3600; }
protected function startup() { parent::startup(); if (!$this->getUser()->isLoggedIn()) { //throw new BadRequestException; } }
protected function startup() { parent::startup(); if ($this->authentication->getCredential() !== substr($this->httpRequest->getHeader('authorization'), 6)) { //throw new AuthenticationException(); } }
function startup() { parent::startup(); if (isset($this->module)) { Options::extend($this->module, $this->moduleparams); Options::read($this->params); } if (array_key_exists("conffile", $this->params)) { Options::read(array("conffile" => $this->params["conffile"])); } else { if (getenv("MONDARC")) { Options::readFile(getenv("MONDARC")); } } Options::readEnv(); Options::read($this->params); if (Options::get("configinfo")) { foreach (Options::get() as $key => $val) { $arr = Options::info($key); if ($arr["default"]) { CliLogger::log(sprintf("Option %s => Value:'%s', set from:defaults\n", $key, $arr["value"]), Debugger::ERROR); } else { CliLogger::log(sprintf("Option %s => Value:'%s', set from:%s\n", $key, $arr["value"], $arr["setfrom"]), Debugger::ERROR); } } self::mexit(); } if ($this->name == $this->action) { $this->Help(Options::get("xhelp")); } }
public function startup() { parent::startup(); if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) { $this->error(); } }
/** * @throws \LiveTranslator\TranslatorException */ public function startup() { parent::startup(); if ($this->user->isLoggedIn()) { //$this->usermanager->lastLogged($this->user->id); } }
public function startup() { parent::startup(); if (!in_array($this->locale, array('cs', 'en'))) { $this->redirect('this', array('locale' => 'en')); } }
public function startup() { parent::startup(); $this->template->max_rating = $this->global_settings->getMaxRating(); $this->template->image_dir = __DIR__ . '/../../www/images/games/'; $this->template->title = ''; }
protected function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->redirect('Sign:in', array('backlink' => $this->storeRequest())); } }
protected function startup() { parent::startup(); if (!$this->user->isLoggedIn() && $this->name != "Sign") { $this->redirect("Sign:in"); } }
public function startup() { parent::startup(); if (!$this->user->isLoggedIn() && !$this->presenter instanceof SignPresenter) { $this->redirect('Sign:in'); } }
/** * Converts params from AMF call to named */ protected function startup() { parent::startup(); $inputParams = $this->request->getParameters(); if (!isset($inputParams[0])) { return; } $actionMethod = $this->formatActionMethod($this->getAction()); $presenterReflection = $this->getReflection(); $outputParams = $inputParams; if ($presenterReflection->hasMethod($actionMethod)) { $method = $presenterReflection->getMethod($actionMethod); $methodParameters = $method->getParameters(); $outputParams = ['action' => $inputParams['action']]; $counter = 0; foreach ($methodParameters as $param) { if (!isset($methodParameters[$counter])) { continue; } $parameter = isset($inputParams[$counter]) ? $inputParams[$counter] : NULL; $type = $param->isArray() ? 'array' : ($param->isDefaultValueAvailable() && $param->isOptional() ? gettype($param->getDefaultValue()) : 'NULL'); if ($type === 'array') { $parameter = !$parameter ? [] : (array) $parameter; } if ($type === 'integer' && !$parameter) { $parameter = NULL; } $outputParams[$param->name] = $parameter; $counter++; } } $this->params = $outputParams; }
protected function startup() { //Nejsi-li admin, vyfič! if (!$this->user->isAllowed('admin', 'view')) { $this->redirect(':Homepage:'); } parent::startup(); }
public function startup() { parent::startup(); if (!$this->user->isLoggedIn()) { $this->flashMessage('Pouze přihlášení uživatelé mají přístup na tuto stránku', 'info'); $this->redirect(":Sign:in"); } }
public function startup() { if ($this->getParameter('__terminate') === TRUE) { $this->terminate(); } parent::startup(); $this->onStartup($this); }
protected function startup() { parent::startup(); foreach ($this->forms as $name => $callback) { $this->addComponent($callback(), $name); } $this->forms = []; }
protected function startup() { parent::startup(); $this->size = $this->getParameter('size'); $this->format = $this->getParameter('format'); $this->type = $this->getParameter('type'); $this->url = $this->getParameter('url'); }
protected function startup() { parent::startup(); Container::extensionMethod('addDatePicker', function (Container $container, $name, $label = NULL) { return $container[$name] = new DatePicker($label); }); $this->setErrorPresenter(); }
protected function startup() { parent::startup(); //kontrola přihlášení if (!$this->user->isLoggedIn()) { $this->redirect('Sign:in'); } }
public function startup() { $dev = isset($_COOKIE['debug_please']) && $_COOKIE['debug_please'] == 'idontgiveabuck07'; // $cli = php_sapi_name() == 'cli'; if (!$dev) { $this->setView('noapp'); } parent::startup(); }
protected function startup() { parent::startup(); // TODO : nemit to tu tak natvrdo if ($this->language != 'cs' && $this->language != 'en') { $this->language = 'en'; // throw new Nette\Application\BadRequestException; } }
public function startup() { parent::startup(); if ($this->nodeLabel === null) { $this->setView('noNode'); } else { $this->node = $this->graph->getNode($this->nodeLabel); } }
protected function startup() { parent::startup(); if (!filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) { $this->template->liveReload = TRUE; } else { $this->template->liveReload = FALSE; } }
protected function startup() { parent::startup(); $user = parent::getUser(); $user->getStorage()->setNamespace('App\\AdminModule'); if (!$this->user->isLoggedIn()) { $this->redirect('Sign:in'); } }
protected function startup() { parent::startup(); $settings = $this->context->settings->getAll(); $this->template->title = "Title"; $this->settings = $settings; $this->template->settings = $settings; $this->template->menu = $this->context->menu->getMenu(); }