diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-05-01 18:50:31 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-05-01 18:50:31 +0200 |
commit | 70cea18cce0fcdb4d8118ff2d7abccc922417a6a (patch) | |
tree | 7f8c476cb75b38fea3ed4ad555f00885f6da2670 /apps/calendar/lib | |
parent | dc7cdda5ccc7d40bf9865e1af5a7846782ec700b (diff) | |
download | nextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.tar.gz nextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.zip |
ported getUser
Diffstat (limited to 'apps/calendar/lib')
-rwxr-xr-x[-rw-r--r--] | apps/calendar/lib/app.php | 28 | ||||
-rwxr-xr-x[-rw-r--r--] | apps/calendar/lib/object.php | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | apps/calendar/lib/search.php | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 3ce0d6fa1d4..7a52bf08dc7 100644..100755 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -9,7 +9,7 @@ * This class manages our app actions */ OC_Calendar_App::$l10n = new OC_L10N('calendar'); -OC_Calendar_App::$tz = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); +OC_Calendar_App::$tz = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); class OC_Calendar_App{ const CALENDAR = 'calendar'; const EVENT = 'event'; @@ -38,12 +38,12 @@ class OC_Calendar_App{ public static function getCalendar($id, $security = true, $shared = false){ $calendar = OC_Calendar_Calendar::find($id); if($shared === true){ - if(OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR)){ + if(OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR)){ return $calendar; } } if($security === true){ - if($calendar['userid'] != OC_User::getUser()){ + if($calendar['userid'] != OCP\USER::getUser()){ return false; } } @@ -63,13 +63,13 @@ class OC_Calendar_App{ public static function getEventObject($id, $security = true, $shared = false){ $event = OC_Calendar_Object::find($id); if($shared === true){ - if(OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::EVENT)){ + if(OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT)){ return $event; } } if($security === true){ $calendar = self::getCalendar($event['calendarid'], false); - if($calendar['userid'] != OC_User::getUser()){ + if($calendar['userid'] != OCP\USER::getUser()){ return false; } } @@ -164,7 +164,7 @@ class OC_Calendar_App{ */ public static function scanCategories($events = null) { if (is_null($events)) { - $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); + $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); if(count($calendars) > 0) { $events = array(); foreach($calendars as $calendar) { @@ -278,12 +278,12 @@ class OC_Calendar_App{ public static function getaccess($id, $type){ if($type == self::CALENDAR){ $calendar = self::getCalendar($id, false, false); - if($calendar['userid'] == OC_User::getUser()){ + if($calendar['userid'] == OCP\USER::getUser()){ return 'owner'; } - $isshared = OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR); + $isshared = OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR); if($isshared){ - $writeaccess = OC_Calendar_Share::is_editing_allowed(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR); + $writeaccess = OC_Calendar_Share::is_editing_allowed(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR); if($writeaccess){ return 'rw'; }else{ @@ -293,12 +293,12 @@ class OC_Calendar_App{ return false; } }elseif($type == self::EVENT){ - if(OC_Calendar_Object::getowner($id) == OC_User::getUser()){ + if(OC_Calendar_Object::getowner($id) == OCP\USER::getUser()){ return 'owner'; } - $isshared = OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::EVENT); + $isshared = OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT); if($isshared){ - $writeaccess = OC_Calendar_Share::is_editing_allowed(OC_User::getUser(), $id, OC_Calendar_Share::EVENT); + $writeaccess = OC_Calendar_Share::is_editing_allowed(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT); if($writeaccess){ return 'rw'; }else{ @@ -320,12 +320,12 @@ class OC_Calendar_App{ public static function getrequestedEvents($calendarid, $start, $end){ $events = array(); if($calendarid == 'shared_rw' || $_GET['calendar_id'] == 'shared_r'){ - $calendars = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); + $calendars = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); foreach($calendars as $calendar){ $calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end); $events = array_merge($events, $calendarevents); } - $singleevents = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); + $singleevents = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); foreach($singleevents as $singleevent){ $event = OC_Calendar_Object::find($singleevent['eventid']); $events[] = $event; diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index ae6fce3c842..d8e9d5fb946 100644..100755 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -761,7 +761,7 @@ class OC_Calendar_Object{ $vevent->setDateTime('DTSTART', $start, Sabre_VObject_Property_DateTime::DATE); $vevent->setDateTime('DTEND', $end, Sabre_VObject_Property_DateTime::DATE); }else{ - $timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); + $timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $timezone = new DateTimeZone($timezone); $start = new DateTime($from.' '.$fromtime, $timezone); $end = new DateTime($to.' '.$totime, $timezone); diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index 0e1a9032666..fc544314359 100644..100755 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -1,7 +1,7 @@ <?php class OC_Search_Provider_Calendar extends OC_Search_Provider{ function search($query){ - $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1); + $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1); if(count($calendars)==0 || !OC_App::isEnabled('calendar')){ //return false; } @@ -12,7 +12,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ }else{ $searchquery[] = $query; } - $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); + $user_timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $l = new OC_l10n('calendar'); foreach($calendars as $calendar){ $objects = OC_Calendar_Object::all($calendar['id']); |