aboutsummaryrefslogtreecommitdiffstats
path: root/apps/calendar/lib/app.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-01 18:50:31 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-01 18:50:31 +0200
commit70cea18cce0fcdb4d8118ff2d7abccc922417a6a (patch)
tree7f8c476cb75b38fea3ed4ad555f00885f6da2670 /apps/calendar/lib/app.php
parentdc7cdda5ccc7d40bf9865e1af5a7846782ec700b (diff)
downloadnextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.tar.gz
nextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.zip
ported getUser
Diffstat (limited to 'apps/calendar/lib/app.php')
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/app.php28
1 files changed, 14 insertions, 14 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;