/**
  * @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);
 }
Beispiel #2
0
 /**
  *
  * @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);
 }
Beispiel #3
0
 /**
  * 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;
 }
Beispiel #4
0
 /**
  * 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');
 }
Beispiel #6
0
 /**
  * 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);
 }
Beispiel #7
0
 /**
  * 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);
 }
Beispiel #8
0
 /**
  * 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());
 }