コード例 #1
0
ファイル: ClientUser.php プロジェクト: kemosabhay/Lightning
 /**
  * Require the user to log in and return to this page afterwards.
  *
  * @param string $action
  *   The action on the login page.
  */
 public static function requireLogin($action = '')
 {
     if (self::getInstance()->id == 0) {
         $query = array();
         if (!empty($action)) {
             $query['action'] = $action;
         }
         // Set the redirect parameter.
         $query['redirect'] = Request::getLocation();
         // Add the current query string.
         $redirect_query = $_GET;
         unset($redirect_query['request']);
         if (!empty($redirect_query)) {
             $query['redirect'] .= '?' . http_build_query($redirect_query);
         }
         Navigation::redirect('/user' . $action, $query);
     }
 }
コード例 #2
0
ファイル: Session.php プロジェクト: kemosabhay/Lightning
 protected static function loadRequestSessionKey()
 {
     return Request::cookie(Configuration::get('session.cookie'), 'hex');
 }