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; }
public static function getByKey($sessionKey) { return LoginSession::where('session_key', $sessionKey)->first(); }
public function postValidate() { list($sessionKey) = ColdValidator::instance()->inputs(array('session_key')); return array('status' => LoginSession::where('session_key', $sessionKey)->count() > 0); }