示例#1
0
 public function startup()
 {
     parent::startup();
     if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) {
         $this->error();
     }
 }
示例#2
0
 public function startup()
 {
     parent::startup();
     if (!$this->isAdmin()) {
         $this->redirect(':Front:Homepage:');
     }
 }
示例#3
0
 public function startup()
 {
     parent::startup();
     if (!$this->user->isAllowed('Article', 'moderate')) {
         throw new Nette\Application\ForbiddenRequestException();
     }
 }
示例#4
0
{
    /** 
   * @inject
   * @var DbTable\Druh */
    public $druh;
    /**
   * @inject 
   * @var DbTable\Udaje_typ */
示例#5
0
 * @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'));
         }
     }
 }
示例#8
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();
 }
示例#9
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");
 }
示例#10
0
 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);
 }
示例#11
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);
     }
 }
示例#12
0
 public function startup()
 {
     parent::startup();
     $this->userTable = $this->database->table(Model\UserManager::TABLE_NAME);
 }
示例#13
0
 protected function startup()
 {
     parent::startup();
     $this->template->page = $this->database->table("pages")->get($this->getParameter("id"));
 }
示例#14
0
 protected function startup()
 {
     parent::startup();
     $this->template->signed = FALSE;
 }
示例#15
0
 protected function startup()
 {
     parent::startup();
     //Premenne pre formulare
     $this->jaz = $this->lang->findAll();
 }
示例#16
0
  public $clanok_komponenty;
  /**
 * @inject
 * @var ForUploads\Images */
  public $for_uploads;
  // -- Formulare
  /** @var Forms\Produkt\ProduktEditFormFactory @inject*/
示例#17
0
 /** @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();
 }
示例#19
0
 /**
  * Inicializace třídních proměnných
  */
 public function startup()
 {
     parent::startup();
 }
示例#20
0
 protected function startup()
 {
     parent::startup();
     $this->template->pageId = $this->getParameter("type");
 }
示例#21
0
 protected function startup()
 {
     parent::startup();
 }
示例#22
0
 public function startup()
 {
     parent::startup();
     $this->template->type = $this->getParameter("type");
 }