Exemplo n.º 1
0
 /**
  * Validate a user against the given credentials.
  *
  * @param  Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     $plain = $credentials['password'];
     // Is user password is valid?
     if (!$this->hasher->check($user->salt . $plain, $user->getAuthPassword())) {
         throw new UserPasswordIncorrectException('User password is incorrect');
     }
     // Valid user, but are they verified?
     if (!$user->verified) {
         throw new UserUnverifiedException('User is not verified');
     }
     // Is the user disabled?
     if ($user->disabled) {
         throw new UserDisabledException('User is disabled');
     }
     // Is the user deleted?
     if ($user->deleted_at !== NULL) {
         throw new UserDeletedException('User is deleted');
     }
     return true;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     $plain = $credentials['password'];
     // Is user password is valid?
     if (!$this->hasher->check($user->salt . $plain, $user->getAuthPassword())) {
         throw new UserPasswordIncorrectException($this->getName() . ' password is incorrect');
     }
     // Valid user, but are they verified?
     if (!$user->verified) {
         throw new UserUnverifiedException($this->getName() . ' is unverified');
     }
     // Is the user disabled?
     if ($user->disabled) {
         throw new UserDisabledException($this->getName() . ' is disabled');
     }
     // Is the user deleted?
     if ($user->deleted_at !== NULL) {
         throw new UserDeletedException($this->getName() . ' is deleted');
     }
     $user->last_ip = \Sanitize::clean(\Request::getClientIp());
     $user->last_login = date(SQL_DATETIME);
     $user->save();
     return true;
 }
Exemplo n.º 3
0
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(\Illuminate\Contracts\Auth\Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(\Illuminate\Auth\UserInterface $user, array $credentials)
 {
     return $this->hasher->check($credentials['password'], $user->getAuthPassword());
 }