protected function startup()
 {
     parent::startup();
     if ($this->getParameter('debug', FALSE)) {
         \Nette\Diagnostics\Debugger::$productionMode = FALSE;
     }
 }
Esempio n. 2
0
 protected function startup()
 {
     parent::startup();
     $this->items = $this->context->createServiceFiles();
     $this->template->setFile('');
     // nebude shanet sablonu
 }
Esempio n. 3
0
 protected function startup()
 {
     parent::startup();
     if (!$this->type) {
         $this->type = key($this->securityManager->getUserTypes());
     }
 }
Esempio n. 4
0
 /**
  * startup method
  * @return void
  */
 public function startup()
 {
     parent::startup();
     $this->lang = $this->translator->setLanguage($this->lang);
     $this->user = $this->getUser();
     return;
 }
Esempio n. 5
0
 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'));
     }
 }
Esempio n. 6
0
 protected function startup()
 {
     parent::startup();
     $this->template->page = $this->getName();
     $this->template->cartCount = 1;
     $this->template->cartPrice = 3600;
 }
Esempio n. 7
0
 protected function startup()
 {
     parent::startup();
     if (!$this->getUser()->isLoggedIn()) {
         //throw new BadRequestException;
     }
 }
Esempio n. 8
0
 protected function startup()
 {
     parent::startup();
     if ($this->authentication->getCredential() !== substr($this->httpRequest->getHeader('authorization'), 6)) {
         //throw new AuthenticationException();
     }
 }
Esempio n. 9
0
 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();
     }
 }
Esempio n. 11
0
 /**
  * @throws \LiveTranslator\TranslatorException
  */
 public function startup()
 {
     parent::startup();
     if ($this->user->isLoggedIn()) {
         //$this->usermanager->lastLogged($this->user->id);
     }
 }
Esempio n. 12
0
 public function startup()
 {
     parent::startup();
     if (!in_array($this->locale, array('cs', 'en'))) {
         $this->redirect('this', array('locale' => 'en'));
     }
 }
Esempio n. 13
0
 public function startup()
 {
     parent::startup();
     $this->template->max_rating = $this->global_settings->getMaxRating();
     $this->template->image_dir = __DIR__ . '/../../www/images/games/';
     $this->template->title = '';
 }
Esempio n. 14
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Sign:in', array('backlink' => $this->storeRequest()));
     }
 }
Esempio n. 15
0
 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');
     }
 }
Esempio n. 17
0
 /**
  * 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;
 }
Esempio n. 18
0
 protected function startup()
 {
     //Nejsi-li admin, vyfič!
     if (!$this->user->isAllowed('admin', 'view')) {
         $this->redirect(':Homepage:');
     }
     parent::startup();
 }
Esempio n. 19
0
 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");
     }
 }
Esempio n. 20
0
 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 = [];
 }
Esempio n. 22
0
 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');
 }
Esempio n. 23
0
 protected function startup()
 {
     parent::startup();
     Container::extensionMethod('addDatePicker', function (Container $container, $name, $label = NULL) {
         return $container[$name] = new DatePicker($label);
     });
     $this->setErrorPresenter();
 }
Esempio n. 24
0
 protected function startup()
 {
     parent::startup();
     //kontrola přihlášení
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Sign:in');
     }
 }
Esempio n. 25
0
 public function startup()
 {
     $dev = isset($_COOKIE['debug_please']) && $_COOKIE['debug_please'] == 'idontgiveabuck07';
     // $cli = php_sapi_name() == 'cli';
     if (!$dev) {
         $this->setView('noapp');
     }
     parent::startup();
 }
Esempio n. 26
0
 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;
     }
 }
Esempio n. 27
0
 public function startup()
 {
     parent::startup();
     if ($this->nodeLabel === null) {
         $this->setView('noNode');
     } else {
         $this->node = $this->graph->getNode($this->nodeLabel);
     }
 }
Esempio n. 28
0
 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;
     }
 }
Esempio n. 29
0
 protected function startup()
 {
     parent::startup();
     $user = parent::getUser();
     $user->getStorage()->setNamespace('App\\AdminModule');
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Sign:in');
     }
 }
Esempio n. 30
0
 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();
 }