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/ajax | |
parent | dc7cdda5ccc7d40bf9865e1af5a7846782ec700b (diff) | |
download | nextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.tar.gz nextcloud-server-70cea18cce0fcdb4d8118ff2d7abccc922417a6a.zip |
ported getUser
Diffstat (limited to 'apps/calendar/ajax')
19 files changed, 26 insertions, 26 deletions
diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php index ada28a9fc07..b7136981633 100644..100755 --- a/apps/calendar/ajax/calendar/new.php +++ b/apps/calendar/ajax/calendar/new.php @@ -16,7 +16,7 @@ if(trim($_POST['name']) == ''){ OC_JSON::error(array('message'=>'empty')); exit; } -$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); foreach($calendars as $cal){ if($cal['displayname'] == $_POST['name']){ OC_JSON::error(array('message'=>'namenotavailable')); @@ -24,7 +24,7 @@ foreach($calendars as $cal){ } } -$userid = OC_User::getUser(); +$userid = OCP\USER::getUser(); $calendarid = OC_Calendar_Calendar::addCalendar($userid, strip_tags($_POST['name']), 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']); OC_Calendar_Calendar::setCalendarActive($calendarid, 1); diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php index 9bb1307a845..1e35035fa48 100644..100755 --- a/apps/calendar/ajax/calendar/update.php +++ b/apps/calendar/ajax/calendar/update.php @@ -16,7 +16,7 @@ if(trim($_POST['name']) == ''){ OC_JSON::error(array('message'=>'empty')); exit; } -$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); foreach($calendars as $cal){ if($cal['displayname'] == $_POST['name'] && $cal['id'] != $_POST['id']){ OC_JSON::error(array('message'=>'namenotavailable')); diff --git a/apps/calendar/ajax/categories/rescan.php b/apps/calendar/ajax/categories/rescan.php index e1b276312a5..a8e62f64a5b 100755 --- a/apps/calendar/ajax/categories/rescan.php +++ b/apps/calendar/ajax/categories/rescan.php @@ -23,7 +23,7 @@ function debug($msg) { OCP\Util::writeLog('calendar','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG); } -$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); if(count($calendars) == 0) { bailOut(OC_Calendar_App::$l10n->t('No calendars found.')); } diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index 736a5625530..f53eb288b79 100644..100755 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -17,6 +17,6 @@ switch($view){ OC_JSON::error(array('message'=>'unexspected parameter: ' . $view)); exit; } -OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'currentview', $view); +OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'currentview', $view); OC_JSON::success(); ?> diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index e2b23d71f9b..675a417eba8 100644..100755 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -189,7 +189,7 @@ if($data['repeating'] == 1){ $repeat['repeat'] = 'doesnotrepeat'; } if($access == 'owner'){ - $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); + $calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); }else{ $calendar_options = array(OC_Calendar_App::getCalendar($data['calendarid'], false)); } diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index 155e3dc371e..a2fa48edf8a 100644..100755 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -22,16 +22,16 @@ $end = $_POST['end']; $allday = $_POST['allday']; if (!$end){ - $duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', '60'); + $duration = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'duration', '60'); $end = $start + ($duration * 60); } $start = new DateTime('@'.$start); $end = new DateTime('@'.$end); -$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()); $start->setTimezone(new DateTimeZone($timezone)); $end->setTimezone(new DateTimeZone($timezone)); -$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); +$calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); $repeat_options = OC_Calendar_App::getRepeatOptions(); $repeat_end_options = OC_Calendar_App::getEndOptions(); $repeat_month_options = OC_Calendar_App::getMonthOptions(); diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php index 5848cac448d..eda34099aba 100644..100755 --- a/apps/calendar/ajax/import/import.php +++ b/apps/calendar/ajax/import/import.php @@ -19,11 +19,11 @@ if(is_writable('import_tmp/')){ } $file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); if($_POST['method'] == 'new'){ - $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']); + $id = OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(), $_POST['calname']); OC_Calendar_Calendar::setCalendarActive($id, 1); }else{ $calendar = OC_Calendar_App::getCalendar($_POST['id']); - if($calendar['userid'] != OC_USER::getUser()){ + if($calendar['userid'] != OCP\USER::getUser()){ OC_JSON::error(); exit(); } diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php index 63218dcd028..3fe89c5bc56 100644..100755 --- a/apps/calendar/ajax/settings/getfirstday.php +++ b/apps/calendar/ajax/settings/getfirstday.php @@ -7,6 +7,6 @@ */ OC_JSON::checkLoggedIn(); -$firstday = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstday', 'mo'); +$firstday = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo'); OC_JSON::encodedPrint(array('firstday' => $firstday)); ?> diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php index b9555900a0e..a5a71670ca9 100644..100755 --- a/apps/calendar/ajax/settings/gettimezonedetection.php +++ b/apps/calendar/ajax/settings/gettimezonedetection.php @@ -8,4 +8,4 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -OC_JSON::success(array('detection' => OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection')));
\ No newline at end of file +OC_JSON::success(array('detection' => OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection')));
\ No newline at end of file diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index c0b4ef65263..9b86c305e44 100644..100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -17,11 +17,11 @@ $lng = $_GET['long']; $timezone = OC_Geo::timezone($lat, $lng); -if($timezone == OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone')){ +if($timezone == OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone')){ OC_JSON::success(); exit; } -OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezone', $timezone); +OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone); $message = array('message'=> $l->t('New Timezone:') . $timezone); OC_JSON::success($message); ?>
\ No newline at end of file diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php index 3b1b5481db4..232a51733ba 100644..100755 --- a/apps/calendar/ajax/settings/setfirstday.php +++ b/apps/calendar/ajax/settings/setfirstday.php @@ -8,7 +8,7 @@ OC_JSON::checkLoggedIn(); if(isset($_POST["firstday"])){ - OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstday', $_POST["firstday"]); + OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]); OC_JSON::success(); }else{ OC_JSON::error(); diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php index 374825a5d40..428cb4220a1 100644..100755 --- a/apps/calendar/ajax/settings/settimeformat.php +++ b/apps/calendar/ajax/settings/settimeformat.php @@ -8,7 +8,7 @@ OC_JSON::checkLoggedIn(); if(isset($_POST["timeformat"])){ - OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); + OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); OC_JSON::success(); }else{ OC_JSON::error(); diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index b0ca9dcd944..efc23c0f979 100644..100755 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -18,7 +18,7 @@ OC_JSON::checkAppEnabled('calendar'); // Get data if( isset( $_POST['timezone'] ) ){ $timezone=$_POST['timezone']; - OC_Preferences::setValue( OC_User::getUser(), 'calendar', 'timezone', $timezone ); + OC_Preferences::setValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone ); OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') ))); }else{ OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') ))); diff --git a/apps/calendar/ajax/settings/timeformat.php b/apps/calendar/ajax/settings/timeformat.php index 728b7155efe..cec09394815 100644..100755 --- a/apps/calendar/ajax/settings/timeformat.php +++ b/apps/calendar/ajax/settings/timeformat.php @@ -7,6 +7,6 @@ */ OC_JSON::checkLoggedIn(); -$timeformat = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24"); +$timeformat = OC_Preferences::getValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24"); OC_JSON::encodedPrint(array("timeformat" => $timeformat)); ?> diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php index de3bd6de4fd..17bd740beea 100644..100755 --- a/apps/calendar/ajax/settings/timezonedetection.php +++ b/apps/calendar/ajax/settings/timezonedetection.php @@ -10,9 +10,9 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); if(array_key_exists('timezonedetection', $_POST)){ if($_POST['timezonedetection'] == 'on'){ - OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'true'); + OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true'); }else{ - OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'false'); + OC_Preferences::setValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false'); } OC_JSON::success(); }else{ diff --git a/apps/calendar/ajax/share/activation.php b/apps/calendar/ajax/share/activation.php index a4a3ce48192..5c2fe8efd13 100644..100755 --- a/apps/calendar/ajax/share/activation.php +++ b/apps/calendar/ajax/share/activation.php @@ -8,5 +8,5 @@ require_once('../../../../lib/base.php'); $id = strip_tags($_GET['id']); $activation = strip_tags($_GET['activation']); -OC_Calendar_Share::set_active(OC_User::getUser(), $id, $activation); +OC_Calendar_Share::set_active(OCP\USER::getUser(), $id, $activation); OC_JSON::success();
\ No newline at end of file diff --git a/apps/calendar/ajax/share/dropdown.php b/apps/calendar/ajax/share/dropdown.php index 85530c163ed..988e18c0b03 100644..100755 --- a/apps/calendar/ajax/share/dropdown.php +++ b/apps/calendar/ajax/share/dropdown.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -$user = OC_USER::getUser(); +$user = OCP\USER::getUser(); $calid = $_GET['calid']; $calendar = OC_Calendar_Calendar::find($calid); if($calendar['userid'] != $user){ diff --git a/apps/calendar/ajax/share/share.php b/apps/calendar/ajax/share/share.php index 70f1ec26ae6..9f4dc39e524 100644..100755 --- a/apps/calendar/ajax/share/share.php +++ b/apps/calendar/ajax/share/share.php @@ -43,10 +43,10 @@ if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ OC_JSON::error(array('message'=>'group not found')); exit; } -if($sharetype == 'user' && OC_User::getUser() == $sharewith){ +if($sharetype == 'user' && OCP\USER::getUser() == $sharewith){ OC_JSON::error(array('meesage'=>'you can not share with yourself')); } -$success = OC_Calendar_Share::share(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); +$success = OC_Calendar_Share::share(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); if($success){ if($sharetype == 'public'){ OC_JSON::success(array('message'=>$success)); diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php index c68fc23a6cb..1a93748982c 100644..100755 --- a/apps/calendar/ajax/share/unshare.php +++ b/apps/calendar/ajax/share/unshare.php @@ -34,7 +34,7 @@ if($sharetype == 'user' && !OC_User::userExists($sharewith)){ OC_JSON::error(array('message'=>'group not found')); exit; } -$success = OC_Calendar_Share::unshare(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); +$success = OC_Calendar_Share::unshare(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); if($success){ OC_JSON::success(); }else{ |