/** * @return array */ public function processDataOfBirth() { // Get the date of birth that the user submitted $dob = null; if ($this->request->has('dob')) { // field name is dob when using input type date $dob = $this->request->get('dob'); } elseif ($this->request->has('dob_year') && $this->request->has('dob_month') && $this->request->has('dob_day')) { // field name has _year, _month and _day components if input type select $dob = $this->request->get('dob_year') . '-' . $this->request->get('dob_month') . '-' . $this->request->get('dob_day'); } $remember_me = false; if ($this->request->get('remember_me') == "on") { $this->session->set('remembered_day', $this->request->get('dob_day')); $this->session->set('remembered_month', $this->request->get('dob_month')); $this->session->set('remembered_year', $this->request->get('dob_year')); $this->session->set('remember_me', "on"); $remember_me = true; } else { $this->session->remove('remembered_day'); $this->session->remove('remembered_month'); $this->session->remove('remembered_year'); $this->session->remove('remember_me'); } // return in an array for validator return ['dob' => $dob, 'remember' => $remember_me]; }
/** * Captcha check * * @param $value * @return bool */ public function check($value) { if (!$this->session->has('captcha')) { return false; } $key = $this->session->get('captcha.key'); if (!$this->session->get('captcha.sensitive')) { $value = $this->str->lower($value); } $this->session->remove('captcha'); return $this->hasher->check($value, $key); }
/** * Called by workerman application<br> * 检验凭证。 参数是凭证数据。如果检验通过,请返回用户ID;否则返回false * @param $credential * @return bool|integer */ public function validateCredential($credential) { list($sessionId, $token) = $credential; $sessionId = \Crypt::decrypt($sessionId); $token = \Crypt::decrypt($token); $sessStore = new Store($sessionId, \App::make('session')->driver()->getHandler(), $sessionId); $sessStore->start(); if ($sessStore->has($this->tokenKey)) { if ($sessStore->get($this->tokenKey) == $token) { $sessStore->remove($this->tokenKey); $userIdKey = 'login_' . md5('Illuminate\\Auth\\Guard'); $userId = $sessStore->get($userIdKey); return $userId; } } return false; }
/** * Removes an attribute. * * @param string $name * @return mixed The removed value or null when it does not exist * @static */ public static function remove($name) { return \Illuminate\Session\Store::remove($name); }
/** * {@inheritdoc} */ public function remove($key) { $this->store->remove($key); return $this; }