summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-06 12:48:26 +0200
committeremkael <emkael@tlen.pl>2016-05-06 12:48:26 +0200
commitc93e00a6ac42cd4a2a448b8a663a955573efdbd4 (patch)
tree9a0272af04c89f2a6e57a4cb6b53f8114ff1e69f /app
parent1a2cd8ca8c3a5d4561905fc3139654d06b9cefd7 (diff)
* accessing user preference for specific calendar
Diffstat (limited to 'app')
-rw-r--r--app/php/user/DbUser.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php
index 896d73d..7e6096c 100644
--- a/app/php/user/DbUser.php
+++ b/app/php/user/DbUser.php
@@ -63,6 +63,18 @@ class DbUser extends TDbUser {
}
}
+ public function isCalendarPreferred($calendarID) {
+ return in_array(
+ $calendarID,
+ array_map(
+ function($calendar) {
+ return $calendar->UID;
+ },
+ $this->getCalendarPreference()
+ )
+ );
+ }
+
public function setTimezonePreference($timezone) {
if ($this->IsGuest) {
throw new TInvalidDataException('Timezone preference change impossible for guest user');