public function startup()
 {
     parent::startup();
     if (!$this->isAdmin()) {
         $this->redirect(':Front:Homepage:');
     }
 }
Beispiel #2
0
 public function startup()
 {
     parent::startup();
     if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) {
         $this->error();
     }
 }
Beispiel #3
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->isAllowed('Article', 'moderate')) {
         throw new Nette\Application\ForbiddenRequestException();
     }
 }
 /**
  * @param CarsModel $carsModel
  * @param ProductsModel $productsModel
  * @param OrdersModel $ordersModel
  */
 public function __construct(CarsModel $carsModel, ProductsModel $productsModel, OrdersModel $ordersModel)
 {
     parent::__construct();
     $this->productsModel = $productsModel;
     $this->carsModel = $carsModel;
     $this->ordersModel = $ordersModel;
 }
Beispiel #5
0
{
    /** 
   * @inject
   * @var DbTable\Druh */
    public $druh;
    /**
   * @inject 
   * @var DbTable\Udaje_typ */
Beispiel #6
0
 * @license
 * @link       http://petak23.echo-msz.eu
 * @version 1.0.7a
 */
class SliderPresenter extends \App\AdminModule\Presenters\BasePresenter
{
    /** 
   * @inject
   * @var DbTable\Slider */
Beispiel #7
0
 public function beforeRender()
 {
     parent::beforeRender();
     $this->template->picturecount = $this->pictures->countBy();
     $this->template->tagcount = $this->tags->countBy();
     $this->template->usercount = $this->users->countBy();
     if (!$this->user->isAllowed('Admin:Admin', Authorizator::CREATE)) {
         $this->flashMessage('Nacházíte se v **demo** ukázce administrace. Máte právo prohlížet, nikoliv však editovat...', 'info');
     }
 }
 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'));
         }
     }
 }
Beispiel #10
0
 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();
 }
Beispiel #11
0
 /** 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");
 }
Beispiel #12
0
 /**
  * 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);
     }
 }
 protected function startup()
 {
     parent::startup();
     $this->template->page = $this->database->table("pages")->get($this->getParameter("id"));
 }
 /**
  * @param ProductsModel $productsModel
  */
 public function __construct(ProductsModel $productsModel)
 {
     parent::__construct();
     $this->productsModel = $productsModel;
 }
Beispiel #15
0
        }
        $this->redirect('this');
    }
    /** Formular pre editaciu kategorie produktu.
	 * @return Nette\Application\UI\Form
	 */
    public function createComponentKategorieEditForm()
    {
        $form = new Form();
Beispiel #16
0
 protected function startup()
 {
     parent::startup();
     $this->template->signed = FALSE;
 }
Beispiel #17
0
 public function beforeRender()
 {
     parent::beforeRender();
     $this->template->setTranslator($this->translator);
     $this->template->menuPresenters = $this->menuModules;
     $this->template->languages = $this->languages->getAll();
     $this->template->webLanguage = $this->webLanguage;
 }
Beispiel #18
0
      $form = $this->editUserForm->create($this->user_view_fields);
      $form['uloz']->onClick[] = function ($button) {
          $this->flashOut(!count($button->getForm()->errors), 'User:'******'Údaje boli uložené!', 'Došlo k chybe a údaje sa neuložili. Skúste neskôr znovu...');
      };
      $form['cancel']->onClick[] = function () {
          $this->redirect('User:');
      };
      return $this->_vzhladForm($form);
  }
  /**
 * Edit categori form component factory. Tovarnicka na formular pre editaciu kategorie
 public function startup()
 {
     parent::startup();
     // redirect if not logged in
     (new \App\Tools\UserAuxFactory($this))->testLoginStatus();
 }
Beispiel #20
0
 protected function startup()
 {
     parent::startup();
     //Premenne pre formulare
     $this->jaz = $this->lang->findAll();
 }
Beispiel #21
0
 /**
  * Vytvorenie spolocnych helperov pre sablony
  * @param type $class
  * @return type */
 protected function createTemplate($class = NULL)
 {
     $servise = $this;
     $template = parent::createTemplate($class);
     $template->addFilter('vlastnik', function ($id_user_profiles = 0, $action = 'edit') use($servise) {
         $user = $servise->user;
         // Vrati true ak: si prihlaseny && si admin || (mas opravnenie a si valstnik)
         $out = $user->isLoggedIn() ? $user->isInRole('admin') ? TRUE : ($user->isAllowed($servise->name, $action) ? $id_user_profiles ? $user->getIdentity()->id == $id_user_profiles : FALSE : FALSE) : FALSE;
         return $out;
     });
     return $template;
 }
Beispiel #22
0
 public function __construct(UserManager $user_manager)
 {
     parent::__construct();
     $this->user_manager = $user_manager;
 }
 /**
  * @param UsersModel $usersModel
  */
 public function __construct(UsersModel $usersModel)
 {
     parent::__construct();
     $this->usersModel = $usersModel;
 }
 public function startup()
 {
     parent::startup();
     $this->userTable = $this->database->table(Model\UserManager::TABLE_NAME);
 }
Beispiel #25
0
 /**
  * Inicializace třídních proměnných
  */
 public function startup()
 {
     parent::startup();
 }
Beispiel #26
0
 protected function startup()
 {
     parent::startup();
     $this->template->pageId = $this->getParameter("type");
 }
 protected function startup()
 {
     parent::startup();
 }
Beispiel #28
0
 public function startup()
 {
     parent::startup();
     $this->template->type = $this->getParameter("type");
 }