summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/php/facades/UserFacade.php36
1 files changed, 17 insertions, 19 deletions
diff --git a/app/php/facades/UserFacade.php b/app/php/facades/UserFacade.php
index 1fddb28..3e32a8d 100644
--- a/app/php/facades/UserFacade.php
+++ b/app/php/facades/UserFacade.php
@@ -7,25 +7,6 @@ Prado::using('Application.dto.TimezoneDTO');
class UserFacade extends Facade {
- public function setTimezonePreference(DbUser $user, $timezone) {
- if ($user->IsGuest) {
- throw new TInvalidDataException(
- 'Timezone preference change impossible for guest user'
- );
- }
- $user->DbRecord->Timezone = $timezone;
- $user->DbRecord->save();
- }
-
- public function getTimezonePreference(DbUser $user) {
- if (!$user->IsGuest) {
- try {
- return new TimezoneDTO($user->DbRecord->Timezone);
- } catch(Exception $e) {}
- }
- return new TimezoneDTO(date_default_timezone_get());
- }
-
public function findByLogin($login) {
return User::finder()->findByLogin($login);
}
@@ -63,7 +44,24 @@ class UserFacade extends Facade {
return password_verify($password, $dbPassword);
}
+ public function setTimezonePreference(DbUser $user, $timezone) {
+ if ($user->IsGuest) {
+ throw new TInvalidDataException(
+ 'Timezone preference change impossible for guest user'
+ );
+ }
+ $user->DbRecord->Timezone = $timezone;
+ $user->DbRecord->save();
+ }
+ public function getTimezonePreference(DbUser $user) {
+ if (!$user->IsGuest) {
+ try {
+ return new TimezoneDTO($user->DbRecord->Timezone);
+ } catch(Exception $e) {}
+ }
+ return new TimezoneDTO(date_default_timezone_get());
+ }
}