public function startup() { parent::startup(); if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) { $this->error(); } }
public function startup() { parent::startup(); if (!$this->isAdmin()) { $this->redirect(':Front:Homepage:'); } }
public function startup() { parent::startup(); if (!$this->user->isAllowed('Article', 'moderate')) { throw new Nette\Application\ForbiddenRequestException(); } }
{ /** * @inject * @var DbTable\Druh */ public $druh; /** * @inject * @var DbTable\Udaje_typ */
* @license * @link http://petak23.echo-msz.eu * @version 1.0.7a */ class SliderPresenter extends \App\AdminModule\Presenters\BasePresenter { /** * @inject * @var DbTable\Slider */
public function startup() { parent::startup(); // redirect if not logged in (new \App\Tools\UserAuxFactory($this))->testLoginStatus(); $role = $this->user->getIdentity()->getData()['role']; if (!$this->_permission->isAllowed($role, 'Admin:Article:Insert')) { $this->flashMessage('Přístup odmítnut!'); $this->redirect('Homepage:Default'); } }
protected function startup() { parent::startup(); if (NULL !== $this->getParameter('moduleid')) { $this->loadModule($this->getParameter('moduleid')); } else { if (NULL !== $this->getParameter('id')) { $this->loadModule($this->getParameter('id')); } } }
protected function startup() { parent::startup(); if ($this->getUser()->isLoggedIn() === false) { if ($this->getUser()->getLogoutReason() === IUserStorage::INACTIVITY) { $this->flashMessage($this->translator->translate('locale.sign.session_expired')); } $this->redirect(':Front:Homepage:default'); } $this->registerFormExtendingMethods(); }
/** Vychodzie nastavenia */ protected function startup() { parent::startup(); //Z DB zisti ako budu oznamy usporiadane if (($pomocna = $this->udaje->getKluc("oznam_usporiadanie")) !== FALSE) { $this->oznam_usporiadanie = (bool) $pomocna->text; } if (($pomocna = $this->udaje->getKluc("oznam_komentare")) !== FALSE) { $oznam_komentare = (bool) $pomocna->text; } else { $oznam_komentare = FALSE; } $this->template->oznam_komentare = $oznam_komentare; $this->template->oznam_title_image_en = (bool) $this->udaje->getUdajInt("oznam_title_image_en"); }
public function startup() { parent::startup(); if ($this->getName() != 'Admin:Sign' && !$this->user->isLoggedIn()) { $this->redirect('Sign:default'); } //nastavim prava foreach ($this->roles->getAll() as $role) { $this->acl->addRole($role['system_name']); } foreach ($this->resources->getAll() as $resource) { $this->acl->addResource($resource['system_name']); } foreach ($this->permissions->getAll() as $permission) { $this->acl->allow($permission->role->system_name, $permission->resource->system_name, $permission->privilege->system_name); } $this->acl->addRole('super_admin'); $this->acl->allow('super_admin'); //homepage a sign maji pristup vsichni $this->acl->addResource('homepage'); $this->acl->allow(\App\AdminModule\Components\Authorizator::ALL, 'homepage'); $this->acl->addResource('sign'); $this->acl->allow(\App\AdminModule\Components\Authorizator::ALL, 'sign'); //vychozi role $this->acl->addRole('guest'); //kontrola prav if ($this->getName() != 'Admin:Image' && $this->getAction() != 'ordering' && $this->getAction() != 'orderingCategory' && $this->getAction() != 'deleteImage' && $this->getAction() != 'changePassword' && $this->getAction() != 'getCity' && $this->getAction() != 'download') { if (!$this->getUser()->isAllowed($this->getNameSimple(), $this->getAction())) { $this->flashMessage($this->translator->translate('admin.login.noAccess'), 'error'); $this->redirect('Homepage:default'); } } //projedu vsek moduly a pokusim se najit presentery $presenters = array(); $vsekDir = dirname(__FILE__) . '/../../../'; $ch = opendir($vsekDir); while (($file = readdir($ch)) !== false) { if (!in_array($file, array('.', '..'))) { if (file_exists($vsekDir . $file . '/src/setting.xml')) { $xml = simplexml_load_file($vsekDir . $file . '/src/setting.xml'); if (isset($xml->presenter)) { $this->menuModules[] = array('name' => (string) $xml->presenter->name, 'resource' => (string) $xml->presenter->resource); } } } } closedir($ch); }
/** * Inicializace třídních proměnných */ public function startup() { parent::startup(); $pages = $this->pagesRepository->getAll()->fetch(); if ($pages === FALSE) { $page = new PagesEntity(); $page->level(0); $page->lft(1); $page->rgt(2); $page->parent(0); $page->active(1); $page->date(new DateTime()); $page->upDate(new DateTime()); $page->name('root'); $page->menuTitle('root'); $page->title('root'); $page->url('/'); $this->pagesRepository->save($page); } }
public function startup() { parent::startup(); $this->userTable = $this->database->table(Model\UserManager::TABLE_NAME); }
protected function startup() { parent::startup(); $this->template->page = $this->database->table("pages")->get($this->getParameter("id")); }
protected function startup() { parent::startup(); $this->template->signed = FALSE; }
protected function startup() { parent::startup(); //Premenne pre formulare $this->jaz = $this->lang->findAll(); }
public $clanok_komponenty; /** * @inject * @var ForUploads\Images */ public $for_uploads; // -- Formulare /** @var Forms\Produkt\ProduktEditFormFactory @inject*/
/** @var DbTable\User_profiles @inject */ public $user_profiles; // --- Forms --- /** @var Forms\User\AddUserFormFactory @inject*/ public $addUserForm;
public function startup() { parent::startup(); // redirect if not logged in (new \App\Tools\UserAuxFactory($this))->testLoginStatus(); }
/** * Inicializace třídních proměnných */ public function startup() { parent::startup(); }
protected function startup() { parent::startup(); $this->template->pageId = $this->getParameter("type"); }
protected function startup() { parent::startup(); }
public function startup() { parent::startup(); $this->template->type = $this->getParameter("type"); }