summaryrefslogtreecommitdiff
path: root/app/php/user
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-03-16 01:11:03 +0100
committeremkael <emkael@tlen.pl>2016-03-16 01:11:03 +0100
commit81890fab8952f6ee9dcb1f3c0a577472cf7c4fd6 (patch)
tree4b3ed536f83f0877e1be6b89cd687d9c0d44c727 /app/php/user
parentaa633881b411c81009d4e1d394d30c950da9c70f (diff)
* respecting timezone preference for events
Diffstat (limited to 'app/php/user')
-rw-r--r--app/php/user/DbUser.php10
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);
}