Example #1
0
 /**
  * Check password pair.
  *
  * @param string $userId
  * @param string $password
  * @return boolean
  */
 public function checkPassword($userId, $password)
 {
     $user = new Object_User($userId);
     if (Auth_Wrapper_User::verifyAuth($user->email, $password) !== false) {
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * Change password by providing the current password.
  *
  * @param string $old
  * @param string $new
  * @return mixed
  */
 public function changePassword($old, $new)
 {
     if (Auth_Wrapper_User::verifyAuth($this->email, $old) === false) {
         return 'Invalid current password provided';
     }
     $this->password = Auth_Wrapper_User::getPasswordHash($new);
     $this->save();
     return true;
 }