/** * @param $value * @return bool */ public function check($value) { $store = $this->session->get('captcha'); if ($this->sensitive) { $value = $this->str->lower($value); $store = $this->str->lower($store); } return $this->hasher->check($value, $store); }
/** * * @param $value * @return bool */ public function check($value) { $store = $this->session->get('captcha' . (Input::has('captcha_id') ? '_' . Input::get('captcha_id') : '')); if ($this->sensitive) { $value = $this->str->lower($value); $store = $this->str->lower($store); } return $this->hasher->check($value, $store); }
/** * Unlocks a batch by checking the specified * password against the batch password. * * @param BatchUnlockRequest $request * * @return bool */ public function unlock(BatchUnlockRequest $request) { $hasher = new BcryptHasher(); if ($hasher->check($request->input('password'), $this->password)) { // Store the UUID in the users session so they can have // access to it for as long as the session exists $request->session()->put($this->uuid, $this->uuid); return true; } return false; }
/** * 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); }
public function updateSettings(Request $request, Hash $hash) { $user = $request->user(); $rules = ['old_password' => 'required|min:8', 'password' => 'required|confirmed|min:8']; $validator = app('validation')->make($request->all(), $rules); if ($validator->fails()) { $request->session->add(['errors' => $validator->errors()->all()]); return app('twig')->render('user/settings.htm', ['oldInputs' => $request->all()]); } if (!$hash->check($request->input('old_password'), $user->password)) { $request->session->add(['errors' => ['Old password incorrect.']]); return app('twig')->render('user/settings.htm', ['oldInputs' => $request->all()]); } $user->password = $hash->make($request->input('old_password')); $user->save(); $request->session->add(['success' => 'settings updated successfuly.']); return app('twig')->render('user/settings.htm'); }
/** * Check the given plain value against a hash. * * @param string $value * @param string $hashedValue * @param array $options * @return bool * @static */ public static function check($value, $hashedValue, $options = array()) { return \Illuminate\Hashing\BcryptHasher::check($value, $hashedValue, $options); }
/** * Checks the specified pin against the current password folder pin. * * @param string $pin * * @return bool */ public function checkPin($pin) { $hasher = new BcryptHasher(); return $hasher->check($pin, $this->pin); }
/** * Check if password matches * * @param Password $password * @param HashedPassword $hashedPassword * @return boolean */ public function check(Password $password, HashedPassword $hashedPassword) { return $this->hasher->check($password->toString(), $hashedPassword->toString()); }
/** * Validate a user against the given credentials. * * @param \Illuminate\Auth\Authenticatable $user * @param array $credentials * @return bool */ public function validateCredentials(Authenticatable $user, array $credentials) { return $credentials['type'] === 'shibboleth' ? true : $this->hasher->check($credentials['password'], $user->getAuthPassword()); }