]> source.dussan.org Git - nextcloud-server.git/commitdiff
ported getUser
authorFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 16:50:31 +0000 (18:50 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 16:50:31 +0000 (18:50 +0200)
80 files changed:
apps/bookmarks/ajax/delBookmark.php [changed mode: 0644->0755]
apps/bookmarks/ajax/recordClick.php [changed mode: 0644->0755]
apps/bookmarks/bookmarksHelper.php [changed mode: 0644->0755]
apps/bookmarks/lib/bookmarks.php
apps/calendar/ajax/calendar/new.php [changed mode: 0644->0755]
apps/calendar/ajax/calendar/update.php [changed mode: 0644->0755]
apps/calendar/ajax/categories/rescan.php
apps/calendar/ajax/changeview.php [changed mode: 0644->0755]
apps/calendar/ajax/event/edit.form.php [changed mode: 0644->0755]
apps/calendar/ajax/event/new.form.php [changed mode: 0644->0755]
apps/calendar/ajax/import/import.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/getfirstday.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/gettimezonedetection.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/guesstimezone.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/setfirstday.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/settimeformat.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/settimezone.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/timeformat.php [changed mode: 0644->0755]
apps/calendar/ajax/settings/timezonedetection.php [changed mode: 0644->0755]
apps/calendar/ajax/share/activation.php [changed mode: 0644->0755]
apps/calendar/ajax/share/dropdown.php [changed mode: 0644->0755]
apps/calendar/ajax/share/share.php [changed mode: 0644->0755]
apps/calendar/ajax/share/unshare.php [changed mode: 0644->0755]
apps/calendar/index.php [changed mode: 0644->0755]
apps/calendar/lib/app.php [changed mode: 0644->0755]
apps/calendar/lib/object.php [changed mode: 0644->0755]
apps/calendar/lib/search.php [changed mode: 0644->0755]
apps/calendar/settings.php [changed mode: 0644->0755]
apps/calendar/templates/calendar.php [changed mode: 0644->0755]
apps/calendar/templates/part.choosecalendar.php [changed mode: 0644->0755]
apps/calendar/templates/part.choosecalendar.rowfields.php [changed mode: 0644->0755]
apps/calendar/templates/part.import.php [changed mode: 0644->0755]
apps/calendar/templates/share.dropdown.php [changed mode: 0644->0755]
apps/contacts/ajax/categories/delete.php
apps/contacts/ajax/categories/rescan.php
apps/contacts/ajax/contacts.php [changed mode: 0644->0755]
apps/contacts/ajax/createaddressbook.php
apps/contacts/ajax/editname.php
apps/contacts/import.php
apps/contacts/index.php [changed mode: 0644->0755]
apps/contacts/lib/addressbook.php
apps/contacts/lib/app.php
apps/contacts/lib/hooks.php [changed mode: 0644->0755]
apps/contacts/lib/search.php [changed mode: 0644->0755]
apps/contacts/templates/index.php [changed mode: 0644->0755]
apps/contacts/templates/part.chooseaddressbook.php [changed mode: 0644->0755]
apps/contacts/templates/part.chooseaddressbook.rowfields.php [changed mode: 0644->0755]
apps/contacts/templates/part.import.php [changed mode: 0644->0755]
apps/contacts/templates/part.importaddressbook.php [changed mode: 0644->0755]
apps/contacts/templates/settings.php [changed mode: 0644->0755]
apps/files_encryption/lib/crypt.php [changed mode: 0644->0755]
apps/files_sharing/ajax/email.php [changed mode: 0644->0755]
apps/files_sharing/ajax/getitem.php [changed mode: 0644->0755]
apps/files_sharing/ajax/setpermissions.php [changed mode: 0644->0755]
apps/files_sharing/ajax/share.php
apps/files_sharing/ajax/unshare.php [changed mode: 0644->0755]
apps/files_sharing/ajax/userautocomplete.php [changed mode: 0644->0755]
apps/files_sharing/lib_share.php
apps/files_sharing/sharedstorage.php [changed mode: 0644->0755]
apps/files_versions/ajax/getVersions.php [changed mode: 0644->0755]
apps/files_versions/ajax/rollbackVersion.php [changed mode: 0644->0755]
apps/files_versions/versions.php [changed mode: 0644->0755]
apps/gallery/ajax/createAlbum.php [changed mode: 0644->0755]
apps/gallery/ajax/galleryOp.php [changed mode: 0644->0755]
apps/gallery/appinfo/app.php [changed mode: 0644->0755]
apps/gallery/index.php [changed mode: 0644->0755]
apps/gallery/lib/album.php [changed mode: 0644->0755]
apps/gallery/lib/hooks_handlers.php
apps/gallery/lib/photo.php [changed mode: 0644->0755]
apps/gallery/lib/scanner.php [changed mode: 0644->0755]
apps/gallery/templates/index.php [changed mode: 0644->0755]
apps/media/ajax/api.php [changed mode: 0644->0755]
apps/media/ajax/autoupdate.php [changed mode: 0644->0755]
apps/media/lib_collection.php [changed mode: 0644->0755]
apps/remoteStorage/auth.php [changed mode: 0644->0755]
apps/remoteStorage/lib_remoteStorage.php [changed mode: 0644->0755]
apps/remoteStorage/templates/settings.php [changed mode: 0644->0755]
apps/user_migrate/ajax/export.php [changed mode: 0644->0755]
apps/user_openid/settings.php [changed mode: 0644->0755]
apps/user_openid/templates/settings.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 655d9f8..984a859
@@ -32,7 +32,7 @@ OC_JSON::checkAppEnabled('bookmarks');
 
 $params=array(
        htmlspecialchars_decode($_GET["url"]),
-       OC_User::getUser()
+       OCP\USER::getUser()
        );
 
 $query = OC_DB::prepare("
old mode 100644 (file)
new mode 100755 (executable)
index a542f63..6519de2
@@ -37,7 +37,7 @@ $query = OC_DB::prepare("
                AND url LIKE ?
        ");
        
-$params=array(OC_User::getUser(), htmlspecialchars_decode($_GET["url"]));
+$params=array(OCP\USER::getUser(), htmlspecialchars_decode($_GET["url"]));
 $bookmarks = $query->execute($params);
 
 header( "HTTP/1.1 204 No Content" );
old mode 100644 (file)
new mode 100755 (executable)
index f1464be..25c9b4c
@@ -101,7 +101,7 @@ function addBookmark($url, $title, $tags='') {
        $params=array(
        htmlspecialchars_decode($url),
        htmlspecialchars_decode($title),
-       OC_User::getUser()
+       OCP\USER::getUser()
        );
        $query->execute($params);
        
index b1ff1f411f2460795482ff084a9605385e369bbe..3f27af09557bf7b1c589f3a506cc2cbeed859b6e 100755 (executable)
@@ -37,7 +37,7 @@ class OC_Bookmarks_Bookmarks{
                //OCP\Util::writeLog('bookmarks', 'findBookmarks ' .$offset. ' '.$sqlSortColumn.' '. $filter.' '. $filterTagOnly ,OCP\Util::DEBUG);
                $CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
        
-               $params=array(OC_User::getUser());
+               $params=array(OCP\USER::getUser());
        
                if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
                        $_gc_separator = ', \' \'';
old mode 100644 (file)
new mode 100755 (executable)
index ada28a9..b713698
@@ -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);
 
old mode 100644 (file)
new mode 100755 (executable)
index 9bb1307..1e35035
@@ -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'));
index e1b276312a5f07e187e9983412f720906a1c87e7..a8e62f64a5b0061daba96cd801a0d7f8f67d035e 100755 (executable)
@@ -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.'));
 }
old mode 100644 (file)
new mode 100755 (executable)
index 736a562..f53eb28
@@ -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();
 ?>
old mode 100644 (file)
new mode 100755 (executable)
index e2b23d7..675a417
@@ -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));
 }
old mode 100644 (file)
new mode 100755 (executable)
index 155e3dc..a2fa48e
@@ -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();
old mode 100644 (file)
new mode 100755 (executable)
index 5848cac..eda3409
@@ -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();
        }
old mode 100644 (file)
new mode 100755 (executable)
index 63218dc..3fe89c5
@@ -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));
 ?> 
old mode 100644 (file)
new mode 100755 (executable)
index b955590..a5a7167
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index c0b4ef6..9b86c30
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 3b1b548..232a517
@@ -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();
old mode 100644 (file)
new mode 100755 (executable)
index 374825a..428cb42
@@ -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();
old mode 100644 (file)
new mode 100755 (executable)
index b0ca9dc..efc23c0
@@ -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') )));
old mode 100644 (file)
new mode 100755 (executable)
index 728b715..cec0939
@@ -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));
 ?> 
old mode 100644 (file)
new mode 100755 (executable)
index de3bd6d..17bd740
@@ -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{
old mode 100644 (file)
new mode 100755 (executable)
index a4a3ce4..5c2fe8e
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 85530c1..988e18c
@@ -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){
old mode 100644 (file)
new mode 100755 (executable)
index 70f1ec2..9f4dc39
@@ -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));
old mode 100644 (file)
new mode 100755 (executable)
index c68fc23..1a93748
@@ -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{
old mode 100644 (file)
new mode 100755 (executable)
index 6bb7cfd..beb6ac0
@@ -11,10 +11,10 @@ OC_Util::checkLoggedIn();
 OC_Util::checkAppEnabled('calendar');
 
 // Create default calendar ...
-$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
+$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
 if( count($calendars) == 0){
-       OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'Default calendar');
-       $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
+       OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(),'Default calendar');
+       $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
 }
 
 $eventSources = array();
@@ -29,21 +29,21 @@ OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources));
 $categories = OC_Calendar_App::getCategoryOptions();
 
 //Fix currentview for fullcalendar
-if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){
-       OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "agendaWeek");
+if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){
+       OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek");
 }
-if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){
-       OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "month");
+if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview"){
+       OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "month");
 }
-if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){
-       OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "list");
+if(OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview"){
+       OC_Preferences::setValue(OCP\USER::getUser(), "calendar", "currentview", "list");
 }
 
 OC_Util::addScript('3rdparty/fullcalendar', 'fullcalendar');
 OCP\Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
 OC_Util::addScript('3rdparty/timepicker', 'jquery.ui.timepicker');
 OCP\Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker');
-if(OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone") == null || OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection') == 'true'){
+if(OC_Preferences::getValue(OCP\USER::getUser(), "calendar", "timezone") == null || OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true'){
        OC_UTIL::addScript('calendar', 'geo');
 }
 OC_Util::addScript('calendar', 'calendar');
old mode 100644 (file)
new mode 100755 (executable)
index 3ce0d6f..7a52bf0
@@ -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;
old mode 100644 (file)
new mode 100755 (executable)
index ae6fce3..d8e9d5f
@@ -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);
old mode 100644 (file)
new mode 100755 (executable)
index 0e1a903..fc54431
@@ -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']);
old mode 100644 (file)
new mode 100755 (executable)
index b592280..a76c5d1
@@ -7,7 +7,7 @@
  */
 
 $tmpl = new OC_Template( 'calendar', 'settings');
-$timezone=OC_Preferences::getValue(OC_User::getUser(),'calendar','timezone','');
+$timezone=OC_Preferences::getValue(OCP\USER::getUser(),'calendar','timezone','');
 $tmpl->assign('timezone',$timezone);
 $tmpl->assign('timezones',DateTimeZone::listIdentifiers());
 
old mode 100644 (file)
new mode 100755 (executable)
index ba9423a..4a3c653
@@ -1,13 +1,13 @@
                                <script type='text/javascript'>
-                               var defaultView = '<?php echo OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') ?>';
+                               var defaultView = '<?php echo OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>';
                                var eventSources = <?php echo json_encode($_['eventSources']) ?>;
                                var categories = <?php echo json_encode($_['categories']); ?>;
                                var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>;
                                var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>;
                                var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>;
                                var monthNamesShort = <?php echo json_encode($l->tA(array('Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'))) ?>;
-                               var agendatime = '<?php echo ((int) OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
-                               var defaulttime = '<?php echo ((int) OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
+                               var agendatime = '<?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
+                               var defaulttime = '<?php echo ((int) OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
                                var allDayText = '<?php echo addslashes($l->t('All day')) ?>';
                                var newcalendar = '<?php echo addslashes($l->t('New Calendar')) ?>';
                                var missing_field = '<?php echo addslashes($l->t('Missing fields')) ?>';
@@ -20,7 +20,7 @@
                                var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
                                var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
                                var totalurl = '<?php echo OC_Helper::linkToAbsolute('calendar', 'caldav.php'); ?>/calendars';
-                               var firstDay = '<?php echo (OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
+                               var firstDay = '<?php echo (OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
                                $(document).ready(function() {
                                <?php
                                if(array_key_exists('showevent', $_)){
old mode 100644 (file)
new mode 100755 (executable)
index 4f6680b..af3b82a
@@ -2,7 +2,7 @@
 <p><b><?php echo $l->t('Your calendars'); ?>:</b></p>
 <table width="100%" style="border: 0;">
 <?php
-$option_calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
+$option_calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
 for($i = 0; $i < count($option_calendars); $i++){
        echo "<tr>";
        $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
@@ -31,7 +31,7 @@ for($i = 0; $i < count($option_calendars); $i++){
 <p><b><?php echo $l->t('Shared calendars'); ?>: </b></p>
 <table width="100%" style="border: 0;">
 <?php
-$share = OC_Calendar_Share::allSharedwithuser(OC_User::getUser(), OC_Calendar_Share::CALENDAR);
+$share = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR);
 $count = count($share);
 for($i = 0; $i < $count; $i++){
        $share[$i]['calendar'] = OC_Calendar_App::getCalendar($share[$i]['calendarid'], false, false);
old mode 100644 (file)
new mode 100755 (executable)
index cf85f0d..8848d22
@@ -1,8 +1,8 @@
 <?php
 echo '<td width="20px"><input id="active_' . $_['calendar']['id'] . '" type="checkbox" onClick="Calendar.UI.Calendar.activation(this,' . $_['calendar']['id'] . ')"' . ($_['calendar']['active'] ? ' checked="checked"' : '') . '></td>';
-echo '<td  id="' . OC_User::getUser() . '_' . $_['calendar']['id'] . '"><label for="active_' . $_['calendar']['id'] . '">' . $_['calendar']['displayname'] . '</label></td>';
-echo '<td width="20px"><a href="#" onclick="Calendar.UI.Share.dropdown(\'' . OC_User::getUser() . '\', \'' . $_['calendar']['id'] . '\');" title="' . $l->t("Share Calendar") . '" class="action"><img  class="svg action" src="' . ((!$_['shared']) ? '../../core/img/actions/share.svg' : '../../core/img/actions/shared.svg') . '"></a></td>';
-echo '<td width="20px"><a href="#" onclick="Calendar.UI.showCalDAVUrl(\'' . OC_User::getUser() . '\', \'' . $_['calendar']['uri'] . '\');" title="' . $l->t("CalDav Link") . '" class="action"><img  class="svg action" src="../../core/img/actions/public.svg"></a></td>';
+echo '<td  id="' . OCP\USER::getUser() . '_' . $_['calendar']['id'] . '"><label for="active_' . $_['calendar']['id'] . '">' . $_['calendar']['displayname'] . '</label></td>';
+echo '<td width="20px"><a href="#" onclick="Calendar.UI.Share.dropdown(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['id'] . '\');" title="' . $l->t("Share Calendar") . '" class="action"><img  class="svg action" src="' . ((!$_['shared']) ? '../../core/img/actions/share.svg' : '../../core/img/actions/shared.svg') . '"></a></td>';
+echo '<td width="20px"><a href="#" onclick="Calendar.UI.showCalDAVUrl(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['uri'] . '\');" title="' . $l->t("CalDav Link") . '" class="action"><img  class="svg action" src="../../core/img/actions/public.svg"></a></td>';
 echo '<td width="20px"><a href="export.php?calid=' . $_['calendar']['id'] . '" title="' . $l->t('Download') . '" class="action"><img class="svg action" src="../../core/img/actions/download.svg"></a></td>';
 echo '<td width="20px"><a  href="#" title="' . $l->t('Edit') . '" class="action" onclick="Calendar.UI.Calendar.edit(this, ' . $_['calendar']['id'] . ');"><img class="svg action" src="../../core/img/actions/rename.svg"></a></td>';
 echo '<td width="20px"><a href="#" onclick="Calendar.UI.Calendar.deleteCalendar(\'' . $_['calendar']['id'] . '\');" title="' . $l->t('Delete') . '" class="action"><img  class="svg action" src="../../core/img/actions/delete.svg"></a></td>';
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 90691a3..80375c3
@@ -6,7 +6,7 @@
 <p style="text-align:center;"><b><?php echo $l->t('Please choose the calendar'); ?></b></p>
 <select style="width:100%;" id="calendar" name="calendar">
 <?php
-$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
+$calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
 $calendar_options[] = array('id'=>'newcal', 'displayname'=>$l->t('create a new calendar'));
 echo html_select_options($calendar_options, $calendar_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
 ?>
old mode 100644 (file)
new mode 100755 (executable)
index 71556a6..cd44988
@@ -21,12 +21,12 @@ foreach($sharedelements as $sharedelement){
 <select id="share_user" title="<?php echo $l->t('select users');?>" data-placeholder="<?php echo $l->t('select users'); ?>">
 <option value=""></option>
 <?php
-$allocusers = OC_User::getUsers();
+$allocusers = OCP\USER::getUsers();
 $allusers = array();
 foreach($allocusers as $ocuser){
        $allusers[$ocuser] = $ocuser;
 }
-unset($allusers[OC_User::getUser()]);
+unset($allusers[OCP\USER::getUser()]);
 $allusers = array_flip($allusers);
 echo html_select_options($allusers, array());
 ?>
index f4e7ba76aa9767de53f880b016148b1a042db6cd..d1099da044af493045dd4760f18c51bd3c5ffad3 100755 (executable)
@@ -31,7 +31,7 @@ if(is_null($categories)) {
 
 debug(print_r($categories, true));
 
-$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
+$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
 if(count($addressbooks) == 0) {
        bailOut(OC_Contacts_App::$l10n->t('No address books found.'));
 }
index 97fd1b22feaebd1ab0a638d4a685d004f887f002..37a19fbce4a66f9ff3bbbcb19ab133d85a798888 100755 (executable)
@@ -23,7 +23,7 @@ function debug($msg) {
        OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG);
 }
 
-$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
+$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
 if(count($addressbooks) == 0) {
        bailOut(OC_Contacts_App::$l10n->t('No address books found.'));
 }
old mode 100644 (file)
new mode 100755 (executable)
index 3e75e4c..f0e7dde
@@ -10,7 +10,7 @@
 OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('contacts');
 
-$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser());
+$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
 $contacts = OC_Contacts_VCard::all($ids);
 $tmpl = new OC_TEMPLATE("contacts", "part.contacts");
 $tmpl->assign('contacts', $contacts);
index 6c9976f6fa3149ca90a57f5b082e5b486ab5762c..3a331131a150ba07baafd01014594cc7f868b617 100755 (executable)
@@ -12,7 +12,7 @@
 OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('contacts');
 
-$userid = OC_User::getUser();
+$userid = OCP\USER::getUser();
 $name = trim(strip_tags($_POST['name']));
 if(!$name) {
        OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.'))));
index 0baa9403524111e29519ab98503fc10e9e1c43eb..9ff85dd8586aa5078e2434be1264ce70909cefd5 100755 (executable)
@@ -33,7 +33,7 @@ if($id) {
        $tmpl->assign('name',$name);
        $tmpl->assign('id',$id);
 } else {
-       $addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser());
+       $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
        $tmpl->assign('addressbooks', $addressbooks);
 }
 $tmpl->printpage();
index 8fb1c055e0f3e66546fdd7b4f9b935887ad3a10f..95f17a8896f10ff7badb785dd2dbb6d9dd5db223 100755 (executable)
@@ -30,7 +30,7 @@ if(!$file) {
 }
 error_log('File: '.$file);
 if(isset($_POST['method']) && $_POST['method'] == 'new'){
-       $id = OC_Contacts_Addressbook::add(OC_User::getUser(), $_POST['addressbookname']);
+       $id = OC_Contacts_Addressbook::add(OCP\USER::getUser(), $_POST['addressbookname']);
        OC_Contacts_Addressbook::setActive($id, 1);
 }else{
        $id = $_POST['id'];
old mode 100644 (file)
new mode 100755 (executable)
index 0abec09..70daf4a
@@ -13,10 +13,10 @@ OC_Util::checkLoggedIn();
 OC_Util::checkAppEnabled('contacts');
 
 // Get active address books. This creates a default one if none exists.
-$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser());
+$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
 $contacts = OC_Contacts_VCard::all($ids);
 
-$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser());
+$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
 
 // Load the files we need
 OC_App::setActiveNavigationEntry( 'contacts_index' );
index bf1cb9323dbb0e0635e4e0b6857b3f768d4cd63e..6aed959044704d7c770f66c4f6dbde721e665396 100755 (executable)
@@ -166,7 +166,7 @@ class OC_Contacts_Addressbook{
         */
        public static function activeIds($uid = null){
                if(is_null($uid)){
-                       $uid = OC_User::getUser();
+                       $uid = OCP\USER::getUser();
                }
                $prefbooks = OC_Preferences::getValue($uid,'contacts','openaddressbooks',null);
                if(!$prefbooks){
@@ -235,7 +235,7 @@ class OC_Contacts_Addressbook{
                $openaddressbooks = self::cleanArray($openaddressbooks, false);
                sort($openaddressbooks, SORT_NUMERIC);
                // FIXME: I alway end up with a ';' prepending when imploding the array..?
-               OC_Preferences::setValue(OC_User::getUser(),'contacts','openaddressbooks',implode(';', $openaddressbooks));
+               OC_Preferences::setValue(OCP\USER::getUser(),'contacts','openaddressbooks',implode(';', $openaddressbooks));
 
                return true;
        }
index 26ea6d06092599e79caf3503c89aa2e1d6410ce9..4e840026ce3734066a07dcdc77e2b597a127c065 100755 (executable)
@@ -17,13 +17,13 @@ class OC_Contacts_App {
 
        public static function getAddressbook($id) {
                $addressbook = OC_Contacts_Addressbook::find( $id );
-               if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) {
+               if( $addressbook === false || $addressbook['userid'] != OCP\USER::getUser()) {
                        if ($addressbook === false) {
                                OCP\Util::writeLog('contacts', 'Addressbook not found: '. $id, OCP\Util::ERROR);
                                OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.'))));
                        }
                        else {
-                               OCP\Util::writeLog('contacts', 'Addressbook('.$id.') is not from '.OC_User::getUser(), OCP\Util::ERROR);
+                               OCP\Util::writeLog('contacts', 'Addressbook('.$id.') is not from '.OCP\USER::getUser(), OCP\Util::ERROR);
                                OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.'))));
                        }
                        exit();
@@ -145,7 +145,7 @@ class OC_Contacts_App {
         */
        public static function scanCategories($vccontacts = null) {
                if (is_null($vccontacts)) {
-                       $vcaddressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
+                       $vcaddressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
                        if(count($vcaddressbooks) > 0) {
                                $vcaddressbookids = array();
                                foreach($vcaddressbooks as $vcaddressbook) {
old mode 100644 (file)
new mode 100755 (executable)
index b858c4a..9939075
@@ -41,7 +41,7 @@ class OC_Contacts_Hooks{
 
        static public function getCalenderSources($parameters) {
                $base_url = OC_Helper::linkTo('calendar', 'ajax/events.php').'?calendar_id=';
-               foreach(OC_Contacts_Addressbook::all(OC_User::getUser()) as $addressbook) {
+               foreach(OC_Contacts_Addressbook::all(OCP\USER::getUser()) as $addressbook) {
                        $parameters['sources'][] =
                                array(
                                        'url' => $base_url.'birthday_'. $addressbook['id'],
old mode 100644 (file)
new mode 100755 (executable)
index 31d8542..a53556d
@@ -1,7 +1,7 @@
 <?php
 class OC_Search_Provider_Contacts extends OC_Search_Provider{
        function search($query){
-               $addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser(), 1);
+               $addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1);
 //             if(count($calendars)==0 || !OC_App::isEnabled('contacts')){
 //                     //return false;
 //             }
old mode 100644 (file)
new mode 100755 (executable)
index d7aabbe..b78818c
@@ -1,7 +1,7 @@
 <script type='text/javascript'>
        var totalurl = '<?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks';
        var categories = <?php echo json_encode($_['categories']); ?>;
-       var lang = '<?php echo OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang', 'en'); ?>';
+       var lang = '<?php echo OC_Preferences::getValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>';
 </script>
 <!-- div id="controls">
        <form>
old mode 100644 (file)
new mode 100755 (executable)
index adfc8c1..3b92d1a
@@ -1,7 +1,7 @@
 <div id="chooseaddressbook_dialog" title="<?php echo $l->t("Configure Address Books"); ?>">
 <table width="100%" style="border: 0;">
 <?php
-$option_addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
+$option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
 for($i = 0; $i < count($option_addressbooks); $i++){
        echo "<tr>";
        $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
old mode 100644 (file)
new mode 100755 (executable)
index 20b67a4..50bd192
@@ -2,4 +2,4 @@
        // FIXME: Make this readable.
        echo "<td width=\"20px\"><input id=\"active_" . $_['addressbook']["id"] . "\" type=\"checkbox\" onClick=\"Contacts.UI.Addressbooks.activation(this, " . $_['addressbook']["id"] . ")\"" . (OC_Contacts_Addressbook::isActive($_['addressbook']["id"]) ? ' checked="checked"' : '') . "></td>";
        echo "<td><label for=\"active_" . $_['addressbook']["id"] . "\">" . htmlspecialchars($_['addressbook']["displayname"]) . "</label></td>";
-       echo "<td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.showCardDAVUrl('" . OC_User::getUser() . "', '" . rawurlencode($_['addressbook']["uri"]) . "');\" title=\"" . $l->t("CardDav Link") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?bookid=" . $_['addressbook']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a  href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Contacts.UI.Addressbooks.editAddressbook(this, " . $_['addressbook']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.Addressbooks.deleteAddressbook(this, '" . $_['addressbook']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>";
+       echo "<td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.showCardDAVUrl('" . OCP\USER::getUser() . "', '" . rawurlencode($_['addressbook']["uri"]) . "');\" title=\"" . $l->t("CardDav Link") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?bookid=" . $_['addressbook']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a  href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Contacts.UI.Addressbooks.editAddressbook(this, " . $_['addressbook']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.Addressbooks.deleteAddressbook(this, '" . $_['addressbook']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img  class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>";
old mode 100644 (file)
new mode 100755 (executable)
index 570eda9..a2f8aef
@@ -6,7 +6,7 @@
 <p style="text-align:center;"><b><?php echo $l->t('Please choose the addressbook'); ?></b>
 <select style="width:100%;" id="contacts" name="contacts">
 <?php
-$contacts_options = OC_Contacts_Addressbook::all(OC_User::getUser());
+$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
 $contacts_options[] = array('id'=>'newaddressbook', 'displayname'=>$l->t('create a new addressbook'));
 echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
 ?>
old mode 100644 (file)
new mode 100755 (executable)
index 2db2336..45e7366
@@ -13,7 +13,7 @@
        <td>
                <select id="book" name="book" class="float">
                <?php
-               $contacts_options = OC_Contacts_Addressbook::all(OC_User::getUser());
+               $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
                echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
                ?>
                </select>
old mode 100644 (file)
new mode 100755 (executable)
index 8a24a91..0445f8a
@@ -6,7 +6,7 @@
                <dt><?php echo $l->t('Primary address (Kontact et al)'); ?></dt>
                <dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/</code></dd>
                <dt><?php echo $l->t('iOS/OS X'); ?></dt>
-               <dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/principals/<?php echo OC_User::getUser(); ?></code>/</dd>
+               <dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
                </dl>
                Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a>
        </fieldset>
old mode 100644 (file)
new mode 100755 (executable)
index 3968a28..37eaedc
@@ -92,7 +92,7 @@ class OC_Crypt {
 
        public static function changekeypasscode($oldPassword, $newPassword) {
                if(OCP\User::isLoggedIn()){
-                       $username=OC_USER::getUser();
+                       $username=OCP\USER::getUser();
                        $view=new OC_FilesystemView('/'.$username);
 
                        // read old key
old mode 100644 (file)
new mode 100755 (executable)
index 145026b..c0835f4
@@ -1,7 +1,7 @@
 <?php
 OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('files_sharing');
-$user = OC_User::getUser();
+$user = OCP\USER::getUser();
 // TODO translations
 $subject = $user + ' ' + 'shared a file with you';
 $link = $_POST['link'] + '&f=' + $_POST['f'];
old mode 100644 (file)
new mode 100755 (executable)
index 6f8d524..b15a81e
@@ -5,7 +5,7 @@
 OC_JSON::checkAppEnabled('files_sharing');
 require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
 
-$userDirectory = "/".OC_User::getUser()."/files";
+$userDirectory = "/".OCP\USER::getUser()."/files";
 $source = $userDirectory.$_GET['source'];
 $path = $source;
 $users = array();
old mode 100644 (file)
new mode 100755 (executable)
index 60302d0..fc907bd
@@ -5,7 +5,7 @@
 OC_JSON::checkAppEnabled('files_sharing');
 require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
 
-$source = "/".OC_User::getUser()."/files".$_GET['source'];
+$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
 $uid_shared_with = $_GET['uid_shared_with'];
 $permissions = $_GET['permissions'];
 OC_Share::setPermissions($source, $uid_shared_with, $permissions);
index c704f653c11130290e3f4f6346d74c0948a565be..fe1c9e07984b5086dc920b6711ba10b6bf9fdd45 100755 (executable)
@@ -5,7 +5,7 @@
 OC_JSON::checkAppEnabled('files_sharing');
 require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
 
-$userDirectory = "/".OC_User::getUser()."/files";
+$userDirectory = "/".OCP\USER::getUser()."/files";
 $sources = explode(";", $_POST['sources']);
 $uid_shared_with = $_POST['uid_shared_with'];
 $permissions = $_POST['permissions'];
old mode 100644 (file)
new mode 100755 (executable)
index 7e99b5f..061d31e
@@ -5,7 +5,7 @@
 OC_JSON::checkAppEnabled('files_sharing');
 require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
 
-$source = "/".OC_User::getUser()."/files".$_GET['source'];
+$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
 $uid_shared_with = $_GET['uid_shared_with'];
 OC_Share::unshare($source, $uid_shared_with);
 
old mode 100644 (file)
new mode 100755 (executable)
index cc22a0c..83fdc3b
@@ -8,7 +8,7 @@ OC_JSON::checkAppEnabled('files_sharing');
 
 $users = array();
 $groups = array();
-$self = OC_User::getUser();
+$self = OCP\USER::getUser();
 $userGroups = OC_Group::getUserGroups($self);
 $users[] = "<optgroup label='Users'>";
 $groups[] = "<optgroup label='Groups'>";
index c5127c59cbdab727a8592a1613491a6dfd496e97..0ccfea180c66d276173085ac4e01fcc511134a85 100755 (executable)
@@ -39,7 +39,7 @@ class OC_Share {
         * @param $permissions The permissions, use the constants WRITE and DELETE
         */
        public function __construct($source, $uid_shared_with, $permissions) {
-               $uid_owner = OC_User::getUser();
+               $uid_owner = OCP\USER::getUser();
                $query = OC_DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)");
                if ($uid_shared_with == self::PUBLICLINK) {
                        $token = sha1("$uid_shared_with-$source");
@@ -99,7 +99,7 @@ class OC_Share {
                                }
                                $query->execute(array($uid_owner, $uid, $source, $target, $permissions));
                                // Add file to filesystem cache
-                               $userDirectory = "/".OC_User::getUser()."/files";
+                               $userDirectory = "/".OCP\USER::getUser()."/files";
                                $data = OC_Filecache::get(substr($source, strlen($userDirectory)));
                                $parentQuery = OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?');
                                $parentResult = $parentQuery->execute(array($sharedFolder))->fetchRow();
@@ -145,7 +145,7 @@ class OC_Share {
                                $in .= ", '".$uid."@".$group."'";
                        }
                } else {
-                       $uid = OC_User::getUser();
+                       $uid = OCP\USER::getUser();
                        $in .= "'".$uid."'";
                        $groups = OC_Group::getUserGroups($uid);
                        foreach ($groups as $group) {
@@ -170,7 +170,7 @@ class OC_Share {
                $source = $folders['source'].substr($oldTarget, strlen($folders['target']));
                $item = self::getItem($folders['target']);
                $query = OC_DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)");
-               $query->execute(array($item[0]['uid_owner'], OC_User::getUser(), $source, $newTarget, $item[0]['permissions']));
+               $query->execute(array($item[0]['uid_owner'], OCP\USER::getUser(), $source, $newTarget, $item[0]['permissions']));
        }
 
        /**
@@ -181,7 +181,7 @@ class OC_Share {
        public static function getItem($target) {
                $target = self::cleanPath($target);
                $query = OC_DB::prepare("SELECT uid_owner, source, permissions FROM *PREFIX*sharing WHERE target = ? AND uid_shared_with = ? LIMIT 1");
-               return $query->execute(array($target, OC_User::getUser()))->fetchAll();
+               return $query->execute(array($target, OCP\USER::getUser()))->fetchAll();
        }
 
         /**
@@ -192,11 +192,11 @@ class OC_Share {
        public static function getMySharedItem($source) {
                $source = self::cleanPath($source);
                $query = OC_DB::prepare("SELECT uid_shared_with, permissions FROM *PREFIX*sharing WHERE source = ? AND uid_owner = ?");
-               $result = $query->execute(array($source, OC_User::getUser()))->fetchAll();
+               $result = $query->execute(array($source, OCP\USER::getUser()))->fetchAll();
                if (count($result) > 0) {
                        return $result;
                } else if ($originalSource = self::getSource($source)) {
-                       return $query->execute(array($originalSource, OC_User::getUser()))->fetchAll();
+                       return $query->execute(array($originalSource, OCP\USER::getUser()))->fetchAll();
                } else {
                        return false;
                }
@@ -208,7 +208,7 @@ class OC_Share {
         */
        public static function getMySharedItems() {
                $query = OC_DB::prepare("SELECT uid_shared_with, source, permissions FROM *PREFIX*sharing WHERE uid_owner = ?");
-               return $query->execute(array(OC_User::getUser()))->fetchAll();
+               return $query->execute(array(OCP\USER::getUser()))->fetchAll();
        }
 
        /**
@@ -282,7 +282,7 @@ class OC_Share {
        public static function getTarget($source) {
                $source = self::cleanPath($source);
                $query = OC_DB::prepare("SELECT target FROM *PREFIX*sharing WHERE source = ? AND uid_owner = ? LIMIT 1");
-               $result = $query->execute(array($source, OC_User::getUser()))->fetchAll();
+               $result = $query->execute(array($source, OCP\USER::getUser()))->fetchAll();
                if (count($result) > 0) {
                        return $result[0]['target'];
                } else {
@@ -331,7 +331,7 @@ class OC_Share {
         */
        public static function getTokenFromSource($source) {
                $query = OC_DB::prepare("SELECT target FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with = ? AND uid_owner = ? LIMIT 1");
-               $result = $query->execute(array($source, self::PUBLICLINK, OC_User::getUser()))->fetchAll();
+               $result = $query->execute(array($source, self::PUBLICLINK, OCP\USER::getUser()))->fetchAll();
                if (count($result) > 0) {
                        return $result[0]['target'];
                } else {
@@ -366,7 +366,7 @@ class OC_Share {
        public static function setPermissions($source, $uid_shared_with, $permissions) {
                $source = self::cleanPath($source);
                $query = OC_DB::prepare("UPDATE *PREFIX*sharing SET permissions = ? WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ? AND uid_shared_with ".self::getUsersAndGroups($uid_shared_with));
-               $query->execute(array($permissions, strlen($source), $source, OC_User::getUser()));
+               $query->execute(array($permissions, strlen($source), $source, OCP\USER::getUser()));
        }
 
        /**
@@ -380,7 +380,7 @@ class OC_Share {
        public static function unshare($source, $uid_shared_with) {
                $source = self::cleanPath($source);
                $query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ? AND uid_shared_with ".self::getUsersAndGroups($uid_shared_with));
-               $query->execute(array(strlen($source), $source, OC_User::getUser()));
+               $query->execute(array(strlen($source), $source, OCP\USER::getUser()));
        }
 
        /**
@@ -407,12 +407,12 @@ class OC_Share {
        * @param $arguments Array of arguments passed from OC_Hook
        */
        public static function deleteItem($arguments) {
-               $source = "/".OC_User::getUser()."/files".self::cleanPath($arguments['path']);
+               $source = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['path']);
                if ($target = self::getTarget($source)) {
                        // Forward hook to notify of changes to target file
                        OC_Hook::emit("OC_Filesystem", "post_delete", array('path' => $target));
                        $query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ?");
-                       $query->execute(array(strlen($source), $source, OC_User::getUser()));
+                       $query->execute(array(strlen($source), $source, OCP\USER::getUser()));
                }
                
        }
@@ -422,14 +422,14 @@ class OC_Share {
        * @param $arguments Array of arguments passed from OC_Hook
        */
        public static function renameItem($arguments) {
-               $oldSource = "/".OC_User::getUser()."/files".self::cleanPath($arguments['oldpath']);
-               $newSource = "/".OC_User::getUser()."/files".self::cleanPath($arguments['newpath']);
+               $oldSource = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['oldpath']);
+               $newSource = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['newpath']);
                $query = OC_DB::prepare("UPDATE *PREFIX*sharing SET source = REPLACE(source, ?, ?) WHERE uid_owner = ?");
-               $query->execute(array($oldSource, $newSource, OC_User::getUser()));
+               $query->execute(array($oldSource, $newSource, OCP\USER::getUser()));
        }
 
        public static function updateItem($arguments) {
-               $source = "/".OC_User::getUser()."/files".self::cleanPath($arguments['path']);
+               $source = "/".OCP\USER::getUser()."/files".self::cleanPath($arguments['path']);
                if ($target = self::getTarget($source)) {
                        // Forward hook to notify of changes to target file
                        OC_Hook::emit("OC_Filesystem", "post_write", array('path' => $target));
old mode 100644 (file)
new mode 100755 (executable)
index 8456595..f64d525
@@ -25,7 +25,7 @@ require_once( 'lib_share.php' );
 if (OC_Filesystem::$loaded and !OC_Filesystem::is_dir('/Shared')) {
        OC_Filesystem::mkdir('/Shared');
 }
-OC_Filesystem::mount('OC_Filestorage_Shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/');
+OC_Filesystem::mount('OC_Filestorage_Shared',array('datadir'=>'/'.OCP\USER::getUser().'/files/Shared'),'/'.OCP\USER::getUser().'/files/Shared/');
 
 /**
  * Convert target path to source path and pass the function call to the correct storage provider
old mode 100644 (file)
new mode 100755 (executable)
index 32aac10..9f5b590
@@ -4,7 +4,7 @@ require_once('../../../lib/base.php');
 OC_JSON::checkAppEnabled('files_versions');
 require_once('../versions.php');
 
-$userDirectory = "/".OC_User::getUser()."/files";
+$userDirectory = "/".OCP\USER::getUser()."/files";
 $source = $_GET['source'];
 $source = strip_tags( $source );
 
old mode 100644 (file)
new mode 100755 (executable)
index 6604119..a7b18c4
@@ -4,7 +4,7 @@ require_once('../../../lib/base.php');
 OC_JSON::checkAppEnabled('files_versions');
 require_once('../versions.php');
 
-$userDirectory = "/".OC_User::getUser()."/files";
+$userDirectory = "/".OCP\USER::getUser()."/files";
 
 $source = $_GET['source'];
 
old mode 100644 (file)
new mode 100755 (executable)
index 36efb76..5f8767f
@@ -44,7 +44,7 @@ class Storage {
        public static function init() {
                if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
                        // create versions folder
-                       $foldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $foldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
                        if(!is_dir($foldername)){
                                mkdir($foldername);
                        }
@@ -69,8 +69,8 @@ class Storage {
         */
        public static function store($filename) {
                if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
-                       $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/files';
+                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
                        Storage::init();
 
                        // check if filename is a directory
@@ -124,9 +124,9 @@ class Storage {
        
                if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
                
-                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
                        
-                       $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/files';
+                       $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
                        
                        // rollback
                        if ( @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename) ) {
@@ -148,7 +148,7 @@ class Storage {
         */
        public static function isversioned($filename) {
                if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
 
                        // check for old versions
                        $matches=glob($versionsfoldername.$filename.'.v*');
@@ -169,7 +169,7 @@ class Storage {
          */
         public static function getversions($filename,$count=0) {
                 if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
                        $versions=array();         
  
                      // fetch for old versions
@@ -201,7 +201,7 @@ class Storage {
         public static function expire($filename) {
                 if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
 
-                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+                       $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
 
                        // check for old versions
                        $matches=glob($versionsfoldername.$filename.'.v*');
old mode 100644 (file)
new mode 100755 (executable)
index ca02c3a..eaf5c29
@@ -25,7 +25,7 @@
 OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('gallery');
 
-OC_Gallery_Album::create(OC_User::getUser(), $_GET['album_name']);
+OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']);
 
 OC_JSON::success(array('name' => $_GET['album_name']));
 
old mode 100644 (file)
new mode 100755 (executable)
index 98cf71e..aaf4a7d
@@ -28,15 +28,15 @@ OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('gallery');
 
 function handleRename($oldname, $newname) {
-  OC_Gallery_Album::rename($oldname, $newname, OC_User::getUser());
+  OC_Gallery_Album::rename($oldname, $newname, OCP\USER::getUser());
   OC_Gallery_Album::changeThumbnailPath($oldname, $newname);
 }
 
 function handleRemove($name) {
-  $album_id = OC_Gallery_Album::find(OC_User::getUser(), $name);
+  $album_id = OC_Gallery_Album::find(OCP\USER::getUser(), $name);
   $album_id = $album_id->fetchRow();
   $album_id = $album_id['album_id'];
-  OC_Gallery_Album::remove(OC_User::getUser(), $name);
+  OC_Gallery_Album::remove(OCP\USER::getUser(), $name);
   OC_Gallery_Photo::removeByAlbumId($album_id);
 }
 
@@ -74,25 +74,25 @@ function handleStoreSettings($root, $order) {
     return;
   }
 
-  $current_root = OC_Preferences::getValue(OC_User::getUser(),'gallery', 'root', '/');
+  $current_root = OC_Preferences::getValue(OCP\USER::getUser(),'gallery', 'root', '/');
   $root = trim($root);
   $root = rtrim($root, '/').'/';
   $rescan = $current_root==$root?'no':'yes';
-  OC_Preferences::setValue(OC_User::getUser(), 'gallery', 'root', $root);
-  OC_Preferences::setValue(OC_User::getUser(), 'gallery', 'order', $order);
+  OC_Preferences::setValue(OCP\USER::getUser(), 'gallery', 'root', $root);
+  OC_Preferences::setValue(OCP\USER::getUser(), 'gallery', 'order', $order);
   OC_JSON::success(array('rescan' => $rescan));
 }
 
 function handleGetGallery($path) {
   $a = array();
-  $root = OC_Preferences::getValue(OC_User::getUser(),'gallery', 'root', '/');
+  $root = OC_Preferences::getValue(OCP\USER::getUser(),'gallery', 'root', '/');
   $path = utf8_decode(rtrim($root.$path,'/'));
   if($path == '') $path = '/';
   $pathLen = strlen($path);
-  $result = OC_Gallery_Album::find(OC_User::getUser(), null, $path);
+  $result = OC_Gallery_Album::find(OCP\USER::getUser(), null, $path);
   $album_details = $result->fetchRow();
 
-  $result = OC_Gallery_Album::find(OC_User::getUser(), null, null, $path);
+  $result = OC_Gallery_Album::find(OCP\USER::getUser(), null, null, $path);
 
   while ($r = $result->fetchRow()) {
     $album_name = $r['album_name'];
@@ -126,8 +126,8 @@ function handleGetGallery($path) {
 
 function handleShare($path, $share, $recursive) {
   $recursive = $recursive == 'true' ? 1 : 0;
-  $owner = OC_User::getUser();
-  $root = OC_Preferences::getValue(OC_User::getUser(),'gallery', 'root', '/');
+  $owner = OCP\USER::getUser();
+  $root = OC_Preferences::getValue(OCP\USER::getUser(),'gallery', 'root', '/');
   $path = utf8_decode(rtrim($root.$path,'/'));
   if($path == '') $path = '/';
   $r = OC_Gallery_Album::find($owner, null, $path);
old mode 100644 (file)
new mode 100755 (executable)
index b8e7c14..3eec805
@@ -44,7 +44,7 @@ OC_App::addNavigationEntry( array(
 class OC_GallerySearchProvider extends OC_Search_Provider{
        function search($query){
                $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name LIKE ?');
-               $result = $stmt->execute(array(OC_User::getUser(),'%'.$query.'%'));
+               $result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%'));
                $results=array();
                while($row=$result->fetchRow()){
                        $results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo('gallery', 'index.php').'?view='.$row['album_name'],'Galleries');
old mode 100644 (file)
new mode 100755 (executable)
index 8c45cfb..cc6faa1
@@ -27,12 +27,12 @@ OC_Util::checkLoggedIn();
 OC_Util::checkAppEnabled('gallery');
 OC_App::setActiveNavigationEntry( 'gallery_index' );
 
-if (!file_exists(OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery')) {
-  mkdir(OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery');
+if (!file_exists(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) {
+  mkdir(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery');
 }
 
 if (!isset($_GET['view'])) {
-  $result = OC_Gallery_Album::find(OC_User::getUser());
+  $result = OC_Gallery_Album::find(OCP\USER::getUser());
 
   $r = array();
   while ($row = $result->fetchRow())
@@ -42,7 +42,7 @@ if (!isset($_GET['view'])) {
   $tmpl->assign('r', $r);
   $tmpl->printPage();
 } else {
-  $result = OC_Gallery_Photo::findForAlbum(OC_User::getUser(), $_GET['view']);
+  $result = OC_Gallery_Photo::findForAlbum(OCP\USER::getUser(), $_GET['view']);
 
   $photos = array();
   while ($p = $result->fetchRow())
old mode 100644 (file)
new mode 100755 (executable)
index efc545f..8775cd5
@@ -30,10 +30,10 @@ class OC_Gallery_Album {
        }
 
        public static function cleanup() {
-               $albums = self::find(OC_User::getUser());
+               $albums = self::find(OCP\USER::getUser());
                while ($r = $albums->fetchRow()) {
                        OC_Gallery_Photo::removeByAlbumId($r['album_id']);
-                       self::remove(OC_User::getUser(), $r['album_name']);
+                       self::remove(OCP\USER::getUser(), $r['album_name']);
                }
        }
 
@@ -108,7 +108,7 @@ class OC_Gallery_Album {
     $path .= '%';
     $sql = 'SELECT COUNT(*) as size FROM *PREFIX*gallery_photos photos, *PREFIX*gallery_albums albums WHERE photos.album_id = albums.album_id AND uid_owner = ? AND file_path LIKE ?';
     $stmt = OC_DB::prepare($sql);
-    $result = $stmt->execute(array(OC_User::getUser(), $path))->fetchRow();
+    $result = $stmt->execute(array(OCP\USER::getUser(), $path))->fetchRow();
     return $result['size'];
   }
 }
index 9257bbce6288fc06704ef7bcca84e409782752f1..525afc4127e89fc7f7f60d36e52088147a30d4be 100755 (executable)
@@ -53,13 +53,13 @@ class OC_Gallery_Hooks_Handlers {
       $new_album_name = 'main';
 
     OCP\Util::writeLog(self::$APP_TAG, 'Creating new album '.$new_album_name, OCP\Util::DEBUG);
-    OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path);
+    OC_Gallery_Album::create(OCP\USER::getUser(), $new_album_name, $path);
 
-    return OC_Gallery_Album::find(OC_User::getUser(), null, $path);
+    return OC_Gallery_Album::find(OCP\USER::getUser(), null, $path);
   }
 
   public static function pathInRoot($path) {
-    $root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/');
+    $root = OC_Preferences::getValue(OCP\USER::getUser(), 'gallery', 'root', '/');
     return substr($path, 0, strlen($path)>strlen($root)?strlen($root):strlen($path)) == $root;
   }
 
@@ -69,10 +69,10 @@ class OC_Gallery_Hooks_Handlers {
 
     if (!self::isPhoto($fullpath)) return;
 
-    $a = OC_Gallery_Album::find(OC_User::getUser(), null, dirname($fullpath));
+    $a = OC_Gallery_Album::find(OCP\USER::getUser(), null, dirname($fullpath));
     if (!($r = $a->fetchRow())) {
-      OC_Gallery_Album::create(OC_User::getUser(), basename(dirname($fullpath)), dirname($fullpath));
-      $a = OC_Gallery_Album::find(OC_User::getUser(), null, dirname($fullpath));
+      OC_Gallery_Album::create(OCP\USER::getUser(), basename(dirname($fullpath)), dirname($fullpath));
+      $a = OC_Gallery_Album::find(OCP\USER::getUser(), null, dirname($fullpath));
       $r = $a->fetchRow();
     }
     $albumId = $r['album_id'];
@@ -86,14 +86,14 @@ class OC_Gallery_Hooks_Handlers {
     $fullpath = rtrim(dirname($fullpath),'/').'/'.basename($fullpath);
 
     if (OC_Filesystem::is_dir($fullpath)) {
-      OC_Gallery_Album::remove(OC_User::getUser(), null, $fullpath);
+      OC_Gallery_Album::remove(OCP\USER::getUser(), null, $fullpath);
     } elseif (self::isPhoto($fullpath)) {
-      $a = OC_Gallery_Album::find(OC_User::getUser(), null, rtrim(dirname($fullpath),'/'));
+      $a = OC_Gallery_Album::find(OCP\USER::getUser(), null, rtrim(dirname($fullpath),'/'));
       if (($r = $a->fetchRow())) {
         OC_Gallery_Photo::removeByPath($fullpath, $r['album_id']);
-        $p = OC_Gallery_Photo::findForAlbum(OC_User::getUser(), $r['album_name']);
+        $p = OC_Gallery_Photo::findForAlbum(OCP\USER::getUser(), $r['album_name']);
         if (!($p->fetchRow())) {
-          OC_Gallery_Album::remove(OC_User::getUser(), null, dirname($fullpath));
+          OC_Gallery_Album::remove(OCP\USER::getUser(), null, dirname($fullpath));
         }
       }
     }
@@ -103,7 +103,7 @@ class OC_Gallery_Hooks_Handlers {
     $oldpath = $params[OC_Filesystem::signal_param_oldpath];
     $newpath = $params[OC_Filesystem::signal_param_newpath];
     if (OC_Filesystem::is_dir($newpath.'/') && self::directoryContainsPhotos($newpath)) {
-      OC_Gallery_Album::changePath($oldpath, $newpath, OC_User::getUser());
+      OC_Gallery_Album::changePath($oldpath, $newpath, OCP\USER::getUser());
     } elseif (self::isPhoto($newpath)) {
       $olddir = dirname($oldpath);
       $newdir = dirname($newpath);
@@ -116,7 +116,7 @@ class OC_Gallery_Hooks_Handlers {
       $oldAlbumId;
       if ($olddir == $newdir) {
         // album changing is not needed
-        $albums = OC_Gallery_Album::find(OC_User::getUser(), null, $olddir);
+        $albums = OC_Gallery_Album::find(OCP\USER::getUser(), null, $olddir);
         $album = $albums->fetchRow();
         if (!$album) {
           $albums = self::createAlbum($newdir);
@@ -124,8 +124,8 @@ class OC_Gallery_Hooks_Handlers {
         }
         $newAlbumId = $oldAlbumId = $album['album_id'];
       } else {
-        $newalbum = OC_Gallery_Album::find(OC_User::getUser(), null, $newdir);
-        $oldalbum = OC_Gallery_Album::find(OC_User::getUser(), null, $olddir);
+        $newalbum = OC_Gallery_Album::find(OCP\USER::getUser(), null, $newdir);
+        $oldalbum = OC_Gallery_Album::find(OCP\USER::getUser(), null, $olddir);
 
         if (!($newalbum = $newalbum->fetchRow())) {
           $newalbum = self::createAlbum($newdir);
old mode 100644 (file)
new mode 100755 (executable)
index 5098e1a..455ac50
@@ -67,7 +67,7 @@ class OC_Gallery_Photo {
        }
 
        public static function getThumbnail($image_name, $owner = null) {
-               if (!$owner) $owner = OC_User::getUser();
+               if (!$owner) $owner = OCP\USER::getUser();
                $save_dir = OC_Config::getValue("datadirectory").'/'. $owner .'/gallery/';
                $save_dir .= dirname($image_name). '/';
                $image_path = $image_name;
@@ -98,6 +98,6 @@ class OC_Gallery_Photo {
        }
 
        public static function getGalleryRoot() {
-               return OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '');
+               return OC_Preferences::getValue(OCP\USER::getUser(), 'gallery', 'root', '');
        }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 0317f94..9cf8c11
@@ -24,7 +24,7 @@
 class OC_Gallery_Scanner {
 
        public static function getGalleryRoot() {
-               return OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/');
+               return OC_Preferences::getValue(OCP\USER::getUser(), 'gallery', 'root', '/');
        }
        public static function getScanningRoot() {
                return OC_Filesystem::getRoot().self::getGalleryRoot();
@@ -43,7 +43,7 @@ class OC_Gallery_Scanner {
        public static function scan($eventSource) {
                $paths = self::findPaths();
                $eventSource->send('count', count($paths)+1);
-               $owner = OC_User::getUser();
+               $owner = OCP\USER::getUser();
                foreach ($paths as $path) {
                        $name = self::createName($path);
                        $images = self::findFiles($path);
@@ -81,7 +81,7 @@ class OC_Gallery_Scanner {
                                $image->destroy();
                        }
                }
-               imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/' . $albumName.'.png');
+               imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery/' . $albumName.'.png');
                imagedestroy($thumbnail);
        }
 
@@ -96,7 +96,7 @@ class OC_Gallery_Scanner {
                                        $p = $paths[$i-1];
                                        foreach ($a as $e) {
                                                $p .= ($p == '/'?'':'/').$e;
-                                               OC_Gallery_Album::create(OC_User::getUser(), $e, $p);
+                                               OC_Gallery_Album::create(OCP\USER::getUser(), $e, $p);
             $arr = OC_FileCache::searchByMime('image','', OC_Filesystem::getRoot().$p);
             $step = floor(count($arr)/10);
             if ($step == 0) $step = 1;
old mode 100644 (file)
new mode 100755 (executable)
index cf3d918..078333a
@@ -9,7 +9,7 @@ OC_Util::addScript('files_imageviewer', 'jquery.fancybox-1.3.4.pack');
 OCP\Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' );
 $l = OC_L10N::get('gallery');
 ?>
-<script type="text/javascript">var gallery_scanning_root='<? echo OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '/'); ?>'; var gallery_default_order = '<? echo OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'order', 'ASC'); ?>';</script>
+<script type="text/javascript">var gallery_scanning_root='<? echo OC_Preferences::getValue(OCP\USER::getUser(), 'gallery', 'root', '/'); ?>'; var gallery_default_order = '<? echo OC_Preferences::getValue(OCP\USER::getUser(), 'gallery', 'order', 'ASC'); ?>';</script>
 <div id="controls">
        <div id="scan">
                <div id="scanprogressbar"></div>
old mode 100644 (file)
new mode 100755 (executable)
index 9c7b3ef..3238ebc
@@ -48,16 +48,16 @@ if(!isset($arguments['album'])){
 if(!isset($arguments['search'])){
        $arguments['search']='';
 }
-OC_MEDIA_COLLECTION::$uid=OC_User::getUser();
+OC_MEDIA_COLLECTION::$uid=OCP\USER::getUser();
 if($arguments['action']){
        switch($arguments['action']){
                case 'delete':
                        $path=$arguments['path'];
                        OC_MEDIA_COLLECTION::deleteSongByPath($path);
-                       $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
+                       $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OCP\USER::getUser(),'media','paths',''));
                        if(array_search($path,$paths)!==false){
                                unset($paths[array_search($path,$paths)]);
-                               OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
+                               OC_Preferences::setValue(OCP\USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
                        }
                case 'get_collection':
                        $data=array();
old mode 100644 (file)
new mode 100755 (executable)
index ea7c500..24a7e24
@@ -32,7 +32,7 @@ OC_JSON::checkAppEnabled('media');
 
 $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
 
-OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate);
+OC_Preferences::setValue(OCP\USER::getUser(),'media','autoupdate',(integer)$autoUpdate);
 
 OC_JSON::success(array('data' => $autoUpdate));
 ?>
old mode 100644 (file)
new mode 100755 (executable)
index 411acd9..128fcde
@@ -261,7 +261,7 @@ class OC_MEDIA_COLLECTION{
                if($name=='' or $path==''){
                        return 0;
                }
-               $uid=OC_User::getUser();
+               $uid=OCP\USER::getUser();
                //check if the song is already in the database
                $songId=self::getSongId($name,$artist,$album);
                if($songId!=0){
old mode 100644 (file)
new mode 100755 (executable)
index 69d7cfc..682c1e9
@@ -56,7 +56,7 @@ if(count($pathParts) == 2 && $pathParts[0] == '') {
                        $categories=$v;
                }
        }
-       $currUser = OC_User::getUser();
+       $currUser = OCP\USER::getUser();
        if($currUser == $ownCloudUser) {
                if(isset($_POST['allow'])) {
                        //TODO: check if this can be faked by editing the cookie in firebug!
old mode 100644 (file)
new mode 100755 (executable)
index 6e6a19c..89dfc32
@@ -14,7 +14,7 @@ class OC_remoteStorage {
        }
 
        public static function getAllTokens() {
-               $user=OC_User::getUser();
+               $user=OCP\USER::getUser();
                $query=OC_DB::prepare("SELECT token,appUrl,category FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
                $result=$query->execute(array($user));
                $ret = array();
@@ -28,19 +28,19 @@ class OC_remoteStorage {
        }
 
        public static function deleteToken($token) {
-               $user=OC_User::getUser();
+               $user=OCP\USER::getUser();
                $query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND user=?");
                $result=$query->execute(array($token,$user));
                return 'unknown';//how can we see if any rows were affected?
        }
        private static function addToken($token, $appUrl, $categories){
-               $user=OC_User::getUser();
+               $user=OCP\USER::getUser();
                $query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`category`) VALUES(?,?,?,?)");
                $result=$query->execute(array($token,$appUrl,$user,$categories));
        }
        public static function createCategories($appUrl, $categories) {
                $token=uniqid();
-               OC_Util::setupFS(OC_User::getUser());
+               OC_Util::setupFS(OCP\USER::getUser());
                self::addToken($token, $appUrl, $categories);
                foreach(explode(',', $categories) as $category) {
                        //TODO: input checking on $category
old mode 100644 (file)
new mode 100755 (executable)
index b940282..147378d
@@ -2,7 +2,7 @@
                <?php
                        echo '<img src="../apps/remoteStorage/remoteStorage.png" style="width:16px"> '
                                .'<strong>'.$l->t('remoteStorage').'</strong> user address: '
-                               .OC_User::getUser().'@'.$_SERVER['SERVER_NAME']
+                               .OCP\USER::getUser().'@'.$_SERVER['SERVER_NAME']
                                .' (<a href="http://unhosted.org/">more info</a>)';
                ?>
                <p><em>Apps that currently have access to your ownCloud:</em></p>
old mode 100644 (file)
new mode 100755 (executable)
index 99503ca..874c042
@@ -28,8 +28,8 @@ OC_JSON::checkLoggedIn();
 OC_Util::checkAppEnabled('user_migrate');
 // Which operation
 if( $_GET['operation']=='create' ){
-       $uid = !empty( $_POST['uid'] ) ? $_POST['uid'] :  OC_User::getUser();
-       if( $uid != OC_User::getUser() ){
+       $uid = !empty( $_POST['uid'] ) ? $_POST['uid'] :  OCP\USER::getUser();
+       if( $uid != OCP\USER::getUser() ){
            // Needs to be admin to export someone elses account
                OC_JSON::error();       
                die();
old mode 100644 (file)
new mode 100755 (executable)
index d85eaeb..01ab4d1
@@ -1,7 +1,7 @@
 <?php
 
 $tmpl = new OC_Template( 'user_openid', 'settings');
-$identity=OC_Preferences::getValue(OC_User::getUser(),'user_openid','identity','');
+$identity=OC_Preferences::getValue(OCP\USER::getUser(),'user_openid','identity','');
 $tmpl->assign('identity',$identity);
 
 OC_Util::addScript('user_openid','settings');
old mode 100644 (file)
new mode 100755 (executable)
index 24dfaa1..dd30d82
@@ -1,7 +1,7 @@
 <form id="openidform">
        <fieldset class="personalblock">
                <strong>OpenID</strong>
-               <?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http').'://'.OC_Helper::serverHost().OC::$WEBROOT.'/?'; echo OC_User::getUser(); ?><br /><em><?php echo $l->t('you can authenticate to other sites with this address');?></em><br />
+               <?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http').'://'.OC_Helper::serverHost().OC::$WEBROOT.'/?'; echo OCP\USER::getUser(); ?><br /><em><?php echo $l->t('you can authenticate to other sites with this address');?></em><br />
                <label for="identity"><?php echo $l->t('Authorized OpenID provider');?></label>
                <input type="text" name="identity" id="identity" value="<?php echo $_['identity']; ?>" placeholder="<?php echo $l->t('Your address at Wordpress, Identi.ca, &hellip;');?>" /><span class="msg"></span>
        </fieldset>