Example #1
0
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->redirect('Route', array('special' => 'login', 'backlink' => $this->storeRequest()));
     }
     if (!$this->user->identity instanceof UserEntity) {
         $this->flashMessage($this->translator->translate('This page works only for regular account.'), 'warning');
     }
 }
Example #2
0
 protected function startup()
 {
     parent::startup();
     if ($this->extendedPage->redirect) {
         $this->redirect(301, 'this', array('route' => $this->extendedPage->redirect->mainRoute));
     } elseif ($this->extendedPage->redirectUrl) {
         $this->redirectUrl($this->extendedPage->redirectUrl);
     } else {
         throw new \Nette\Application\BadRequestException();
     }
 }
Example #3
0
 protected function startup()
 {
     parent::startup();
     if (!$this->type) {
         throw new BadRequestException();
     }
     $this->setView($this->type);
     $this->template->productRepository = $this->productRepository;
     $this->template->page = $this->extendedPage;
     $url = $this->getHttpRequest()->getUrl();
     $this->template->server = $url->scheme . '://' . $url->host;
 }
Example #4
0
 protected function startup()
 {
     parent::startup();
     if (!$this->pageRepository->findOneBy(array('special' => 'users'))) {
         $this->template->hideForm = true;
         $this->flashMessage($this->translator->translate('User page does not exist.'), 'warning', false);
     }
     if (!$this->extendedPage->userType) {
         $this->template->hideForm = true;
         $this->flashMessage($this->translator->translate('Userform has not been set'), 'warning', false);
     }
 }
Example #5
0
 /**
  * @param \Nette\Callback $mailControlFactory
  */
 public function __construct(Callback $mailControlFactory)
 {
     parent::__construct();
     $this->mailControlFactory = $mailControlFactory;
 }