diff options
Diffstat (limited to 'app/php/user')
-rw-r--r-- | app/php/user/DbUser.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php index bb6f78e..c3b441b 100644 --- a/app/php/user/DbUser.php +++ b/app/php/user/DbUser.php @@ -3,6 +3,7 @@ Prado::using('System.Security.TDbUserManager'); Prado::using('Application.model.User'); Prado::using('Application.model.Calendar'); +Prado::using('Application.dto.TimezoneDTO'); class DbUser extends TDbUser { @@ -62,6 +63,15 @@ class DbUser extends TDbUser { } } + public function getTimezonePreference() { + if (!$this->IsGuest) { + try { + return new TimezoneDTO($this->DbRecord->Timezone); + } catch(Exception $e) {} + } + return new TimezoneDTO(date_default_timezone_get()); + } + public static function generatePassword($password) { return password_hash($password, PASSWORD_DEFAULT); } |