예제 #1
0
 function beforeroute()
 {
     global $upgrade_access_check;
     parent::beforeroute();
     $auth = AuthManager::instance();
     if ($upgrade_access_check) {
         if (!$auth->isLoggedIn() || !$auth->getUser()->isAdministrator()) {
             $this->accessDenied();
         }
     }
     $this->f3->set('upgrade_access_check', $upgrade_access_check);
     $this->f3->set('@import url(' . $this->f3->get('base_path') . 'upgrade/upgrade.css);');
 }
예제 #2
0
파일: MyModule.php 프로젝트: J0s3f/simpleid
 public function beforeroute()
 {
     parent::beforeroute();
     $auth = AuthManager::instance();
     if (!$auth->isLoggedIn()) {
         if ($this->f3->get('AJAX')) {
             $this->f3->status(401);
             header('Content-Type: application/json');
             print json_encode(array('error' => 'unauthorized', 'error_description' => $this->t('Unauthorized')));
             exit;
         } else {
             $route = ltrim($this->f3->get('PARAMS.0'), '/');
             $this->f3->reroute('@auth_login(1=' . $route . ')');
         }
     }
     if (!$this->f3->get('AJAX')) {
         $this->f3->set('user_header', true);
         $this->f3->set('logout_link', true);
         $this->insertNav();
     }
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct();
     $this->auth = AuthManager::instance();
 }
예제 #4
0
 public function __construct()
 {
     parent::__construct();
     $this->oauth = OAuthManager::instance();
     $this->mgr = ModuleManager::instance();
 }
예제 #5
0
 /**
  * Creates an instance of the store module.
  *
  * The default constructor registers the store module with the
  * store manager by calling {@link StoreManager::addStore()}.
  */
 public function __construct()
 {
     parent::__construct();
     $store_manager = StoreManager::instance();
     $store_manager->addStore($this, $this->getStores());
 }
예제 #6
0
 public function __construct()
 {
     parent::__construct();
     $mgr = ModuleManager::instance();
     $mgr->loadModule('SimpleID\\Protocols\\Connect\\ConnectModule');
 }
예제 #7
0
 function __construct()
 {
     parent::__construct();
     $this->cache = \Cache::instance();
     $this->mgr = ModuleManager::instance();
 }