Ejemplo n.º 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');
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 5
0
 /**
  * @param \Nette\Callback $mailControlFactory
  */
 public function __construct(Callback $mailControlFactory)
 {
     parent::__construct();
     $this->mailControlFactory = $mailControlFactory;
 }