示例#1
0
 public function __construct()
 {
     if ($this->dontNeedAuth == true) {
         return;
     }
     list($sessionKey) = ColdValidator::instance()->inputs(array('session_key'));
     $session = LoginSession::getByKey($sessionKey);
     if (empty($session)) {
         throw new \Exception(self::$errorMsg[self::INVALID_SESS_KEY], self::INVALID_SESS_KEY);
     }
     $this->currentSession = $session;
 }
示例#2
0
 public static function getByKey($sessionKey)
 {
     return LoginSession::where('session_key', $sessionKey)->first();
 }
示例#3
0
 public function postValidate()
 {
     list($sessionKey) = ColdValidator::instance()->inputs(array('session_key'));
     return array('status' => LoginSession::where('session_key', $sessionKey)->count() > 0);
 }