diff options
Diffstat (limited to 'app/php/user')
-rw-r--r-- | app/php/user/DbUser.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php index 730a1c0..f9c8660 100644 --- a/app/php/user/DbUser.php +++ b/app/php/user/DbUser.php @@ -72,6 +72,19 @@ class DbUser extends TDbUser { return new TimezoneDTO(date_default_timezone_get()); } + public function changePassword($pass) { + if (!$this->IsGuest) { + $this->DbRecord->Password = self::generatePassword($pass); + $this->DbRecord->save(); + } + } + + public function getPassword() { + if (!$this->IsGuest) { + return $this->DbRecord->Password; + } + } + public static function generatePassword($password) { return password_hash($password, PASSWORD_DEFAULT); } |