From 81890fab8952f6ee9dcb1f3c0a577472cf7c4fd6 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 16 Mar 2016 01:11:03 +0100 Subject: * respecting timezone preference for events --- app/php/user/DbUser.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/php/user') 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); } -- cgit v1.2.3