validateCredentials() 공개 메소드

Fetches a user row by email (or name) and compare the password. If the password was not stored as a blowfish hash, the password will be saved again. Return the user's id, admin status and attributes.
public validateCredentials ( string $Email = '', $ID, string $Password ) : object | false
$Email string
$Password string
리턴 object | false Returns the user matching the credentials or **false** if the user doesn't validate.
예제 #1
0
 /**
  * Validate that a password authenticates against a user.
  *
  * @param mixed $value Not used.
  * @param mixed $field Not used.
  * @param array $data The data to validate.
  * @return bool Returns true if the value validates or false otherwise.
  */
 function validateOldPassword($value, $field, $data)
 {
     $OldPassword = val('OldPassword', $data, '');
     $Session = Gdn::Session();
     $UserModel = new UserModel();
     $UserID = $Session->UserID;
     return (bool) $UserModel->validateCredentials('', $UserID, $OldPassword);
 }