From 4faae2d037efc21291c1031c9fd7b4c67bb25741 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 10 Mar 2016 13:43:14 +0100 Subject: * calendar preference retrieval --- app/php/user/DbUser.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/php') diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php index c8273f7..c8459fa 100644 --- a/app/php/user/DbUser.php +++ b/app/php/user/DbUser.php @@ -2,6 +2,7 @@ Prado::using('System.Security.TDbUserManager'); Prado::using('Application.model.User'); +Prado::using('Application.model.Calendar'); class DbUser extends TDbUser { @@ -53,6 +54,14 @@ class DbUser extends TDbUser { throw new Exception('Unimplemented CustomDbUser method'); } + public function getCalendarPreference() { + if ($this->IsGuest) { + return Calendar::finder()->findAllByIsVisible(1); + } else { + return $this->DbRecord->Calendars; + } + } + } ?> -- cgit v1.2.3