Пример #1
0
 /**
  * Requires an authorized session.
  *
  * If the client does not hold an authorized session, this function
  * will redirect the client to the `login` page.
  *
  * This function will call Page::requireInstallationComplete prior to other
  * actions.
  */
 public static final function requireLogin()
 {
     self::requireInstallationComplete();
     if (!Authorization::loggedIn()) {
         self::redirectTo('login');
         exit;
     }
 }
Пример #2
0
 public function init($params)
 {
     if (Authorization::loggedIn()) {
         self::redirectTo('home');
         exit;
     }
     $postData = \tniessen\tinyIt\HttpParams::_POST();
     if ($postData && !$postData->isEmpty()) {
         $this->tryProcessPostData($postData);
     }
 }
Пример #3
0
 public function init($params)
 {
     if (Authorization::loggedIn()) {
         self::redirectTo('home');
         exit;
     }
     $dbc = Application::dbConnection();
     if (!$dbc->options()->getOption('allow_registration')) {
         self::redirectTo('login');
         exit;
     }
     $postData = \tniessen\tinyIt\HttpParams::_POST();
     if ($postData && !$postData->isEmpty()) {
         $this->currentParams = $postData;
         $this->tryProcessPostData($postData);
     }
 }