Example #1
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isInRole(UserManager::ROLE_ADMIN)) {
         throw new BadRequestException();
     }
 }
Example #2
0
 public function startup()
 {
     parent::startup();
     // TODO: Change the autogenerated stub
     $this->steelCheck('Pro správu tagů musíš být přihlášen.', []);
     $this->template->title = 'Tagy';
 }
 protected function startup()
 {
     if (!$this->getUser()->isLoggedIn()) {
         $this->redirect(':Sign:in');
     }
     parent::startup();
 }
 public function startup()
 {
     parent::startup();
     $session = $this->getSession('mysection');
     $session->user = '******';
     dump($session);
 }
 protected function beforeRender()
 {
     $file = '/static/bundle.js';
     parent::beforeRender();
     $bundleJs = $this->context->getParameters()['wwwDir'] . $file;
     $this->template->bundleJsVersion = file_exists($bundleJs) ? md5(file_get_contents($this->context->getParameters()['wwwDir'] . $file)) : "404";
 }
 public function startup()
 {
     parent::startup();
     if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) {
         $this->error();
     }
 }
 public function renderDefault($id)
 {
     parent::renderDefault($id);
     $this->template->current_category = $this->category->get($id);
     $this->template->title = 'Unread ' . $this->template->current_category->name;
     $this->template->articles = $this->article->category($id);
 }
Example #8
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Login:');
     }
 }
Example #9
0
 public function beforeRender()
 {
     parent::beforeRender();
     $this->setActiveMenuItem('Eshop');
     $this->setLayout('layoutEshop');
     $this->template->eshopCategories = $this->categoryModel->findEshopCategories();
 }
Example #10
0
 public function startup()
 {
     parent::startup();
     // if (!$this->user->isLoggedIn()) {
     // 	$this->redirect('Sign:in');
     // }
 }
Example #11
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->isAllowed('Admin', 'can')) {
         throw new \Nette\Application\ForbiddenRequestException();
     }
 }
 protected function startup()
 {
     parent::startup();
     $this->oModel = $this->context->getService("article");
     $this->oMenu = $this->context->getService("menu");
     $this->oUser = $this->context->getService("userss");
 }
Example #13
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->loggedIn) {
         $this->redirect('Homepage:');
     }
 }
Example #14
0
 public function startup()
 {
     parent::startup();
     if ($this->user->loggedIn) {
         $this->redirect('Admin:directives');
     }
 }
Example #15
0
 public function renderDefault()
 {
     CliLogger::log("\nSomething bad!\n", CliLogger::ERROR);
     if ($this->params["exception"]->getCode() == 404) {
         BasePresenter::Help();
     }
 }
 public function startup()
 {
     parent::startup();
     // TODO: Change the autogenerated stub
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
 }
Example #17
0
 protected function startup()
 {
     parent::startup();
     $parameters = $this->context->parameters;
     $this->appDir = $parameters['appDir'];
     $this->contactEmail = $parameters['contactEmail'];
     $this->registerFormExtendingMethods();
 }
Example #18
0
 /** MapPresenter constructor*/
 protected function startUp()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->flashMessage('Pro přístup k mapám je nutné se přihlásit.', 'danger');
         $this->redirect('Login:');
     }
 }
Example #19
0
 protected function createTemplate()
 {
     $template = parent::createTemplate();
     $template->addFilter('wikiname', function ($value) {
         return $this->wiki->getPageName($value);
     });
     return $template;
 }
 public function __construct(ShoppingCart $shoppingCart, IShoppingCartControlFactory $shoppingCartControlFactory, CurrencyConvertor $currencyConvertor, ISignRegisterControlFactory $srff, IOrderFormControlFactory $off)
 {
     parent::__construct($shoppingCart);
     $this->shoppingCartControlFactory = $shoppingCartControlFactory;
     $this->currencyConvertor = $currencyConvertor;
     $this->srff = $srff;
     $this->off = $off;
 }
Example #21
0
 public function startup()
 {
     parent::startup();
     if (!$this->getUser()->isLoggedIn()) {
         $this->flashMessage("Pro vstup do této sekce je vyžadováno přihlášení.");
         $this->redirect(":Homepage:");
     }
 }
Example #22
0
 public function __construct(AppManager $appManager, LabelsManager $labelsManager, GroupsManager $groupsManager, CommentsManager $commentsManager)
 {
     parent::__construct();
     $this->appManager = $appManager;
     $this->labelsManager = $labelsManager;
     $this->groupsManager = $groupsManager;
     $this->commentsManager = $commentsManager;
 }
Example #23
0
 public function beforeRender()
 {
     parent::beforeRender();
     $form = $this['loginForm'];
     if ($form->isSubmitted()) {
         $this->login($form, $form->getValues());
     }
 }
Example #24
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->isInRole('admin')) {
         $this->flashMessage('Akci nelze provést, protože nemáte oprávnění administrátora. ' . 'Přihlaste se administrátorským účtem.', 'error');
         $this->redirect("Sign:in", array('backlink' => $this->storeRequest()));
     }
     $this->formLatteAddress = __DIR__ . "/../templates/form.latte";
 }
Example #25
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->flashMessage("To access Steel, you must be Steel.");
         $this->redirect('Sign:in');
     }
     $this->template->title = "Steelasdf";
 }
Example #26
0
 public function startup()
 {
     parent::startup();
     if ($this->user->isLoggedIn()) {
         if ($this->getParameter('id') != $this->user->getId()) {
             $this->redirect('Sign:in');
         }
     }
 }
 /**
  * Verify token.
  */
 public function startup()
 {
     parent::startup();
     $token = $this->getParameter('token');
     if (!$this->usersRepository->verifyToken($token)) {
         $this->flashMessage('The token is invalid.', 'alert alert-danger');
         $this->redirect('LogIn:default');
     }
 }
Example #28
0
 protected function beforeRender()
 {
     parent::beforeRender();
     $this->template->articleRepository = $this->articleRepository;
     $this->template->imageRepository = $this->imageRepository;
     $this->template->videoRepository = $this->videoRepository;
     $this->template->wikiRepository = $this->wikiRepository;
     $this->template->tagRepository = $this->tagRepository;
     $this->template->uploadDir = $this->context->parameters['uploadDir'];
 }
Example #29
0
 protected function startup()
 {
     parent::startup();
     //....
     // get settings
     $this->settings = $this->settingRepository->getSettings();
     $arrsdfsdfsdf = ['AoAco' => 'asdas', 'naeco' => 'asdas', 'naecaovbnm' => 'asdas'];
     $arrr = ['a' => '4', 'b' => 'c'];
     $a = ['a' => 1];
 }
Example #30
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->loggedIn) {
         $this->redirect("Sign:in", ["backlink" => $this->storeRequest()]);
     }
     $this->translator->setLocale("en");
     if ($this->getParameter("no_layout", false)) {
         $this->setLayout(false);
     }
 }