Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-01 20:50:31 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-05-01 20:50:31 +0400
commit70cea18cce0fcdb4d8118ff2d7abccc922417a6a (patch)
tree7f8c476cb75b38fea3ed4ad555f00885f6da2670
parentdc7cdda5ccc7d40bf9865e1af5a7846782ec700b (diff)
ported getUser
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/ajax/delBookmark.php2
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/ajax/recordClick.php2
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/bookmarksHelper.php2
-rwxr-xr-xapps/bookmarks/lib/bookmarks.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/new.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/calendar/update.php2
-rwxr-xr-xapps/calendar/ajax/categories/rescan.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/changeview.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/edit.form.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/event/new.form.php6
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/import/import.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/getfirstday.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/gettimezonedetection.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/guesstimezone.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/setfirstday.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/settimeformat.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/settimezone.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/timeformat.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/timezonedetection.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/share/activation.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/share/dropdown.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/share/share.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/share/unshare.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/index.php20
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/app.php28
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/object.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/lib/search.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/templates/calendar.php8
-rwxr-xr-x[-rw-r--r--]apps/calendar/templates/part.choosecalendar.php4
-rwxr-xr-x[-rw-r--r--]apps/calendar/templates/part.choosecalendar.rowfields.php6
-rwxr-xr-x[-rw-r--r--]apps/calendar/templates/part.import.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/templates/share.dropdown.php4
-rwxr-xr-xapps/contacts/ajax/categories/delete.php2
-rwxr-xr-xapps/contacts/ajax/categories/rescan.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/ajax/contacts.php2
-rwxr-xr-xapps/contacts/ajax/createaddressbook.php2
-rwxr-xr-xapps/contacts/ajax/editname.php2
-rwxr-xr-xapps/contacts/import.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/index.php4
-rwxr-xr-xapps/contacts/lib/addressbook.php4
-rwxr-xr-xapps/contacts/lib/app.php6
-rwxr-xr-x[-rw-r--r--]apps/contacts/lib/hooks.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/lib/search.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/index.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/part.chooseaddressbook.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/part.chooseaddressbook.rowfields.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/part.import.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/part.importaddressbook.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/templates/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/files_encryption/lib/crypt.php2
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/ajax/email.php2
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/ajax/getitem.php2
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/ajax/setpermissions.php2
-rwxr-xr-xapps/files_sharing/ajax/share.php2
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/ajax/unshare.php2
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/ajax/userautocomplete.php2
-rwxr-xr-xapps/files_sharing/lib_share.php36
-rwxr-xr-x[-rw-r--r--]apps/files_sharing/sharedstorage.php2
-rwxr-xr-x[-rw-r--r--]apps/files_versions/ajax/getVersions.php2
-rwxr-xr-x[-rw-r--r--]apps/files_versions/ajax/rollbackVersion.php2
-rwxr-xr-x[-rw-r--r--]apps/files_versions/versions.php16
-rwxr-xr-x[-rw-r--r--]apps/gallery/ajax/createAlbum.php2
-rwxr-xr-x[-rw-r--r--]apps/gallery/ajax/galleryOp.php22
-rwxr-xr-x[-rw-r--r--]apps/gallery/appinfo/app.php2
-rwxr-xr-x[-rw-r--r--]apps/gallery/index.php8
-rwxr-xr-x[-rw-r--r--]apps/gallery/lib/album.php6
-rwxr-xr-xapps/gallery/lib/hooks_handlers.php28
-rwxr-xr-x[-rw-r--r--]apps/gallery/lib/photo.php4
-rwxr-xr-x[-rw-r--r--]apps/gallery/lib/scanner.php8
-rwxr-xr-x[-rw-r--r--]apps/gallery/templates/index.php2
-rwxr-xr-x[-rw-r--r--]apps/media/ajax/api.php6
-rwxr-xr-x[-rw-r--r--]apps/media/ajax/autoupdate.php2
-rwxr-xr-x[-rw-r--r--]apps/media/lib_collection.php2
-rwxr-xr-x[-rw-r--r--]apps/remoteStorage/auth.php2
-rwxr-xr-x[-rw-r--r--]apps/remoteStorage/lib_remoteStorage.php8
-rwxr-xr-x[-rw-r--r--]apps/remoteStorage/templates/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/user_migrate/ajax/export.php4
-rwxr-xr-x[-rw-r--r--]apps/user_openid/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/user_openid/templates/settings.php2
80 files changed, 183 insertions, 183 deletions
diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php
index 655d9f825d9..984a8593169 100644..100755
--- a/apps/bookmarks/ajax/delBookmark.php
+++ b/apps/bookmarks/ajax/delBookmark.php
@@ -32,7 +32,7 @@ OC_JSON::checkAppEnabled('bookmarks');
$params=array(
htmlspecialchars_decode($_GET["url"]),
- OC_User::getUser()
+ OCP\USER::getUser()
);
$query = OC_DB::prepare("
diff --git a/apps/bookmarks/ajax/recordClick.php b/apps/bookmarks/ajax/recordClick.php
index a542f636d8c..6519de241b6 100644..100755
--- a/apps/bookmarks/ajax/recordClick.php
+++ b/apps/bookmarks/ajax/recordClick.php
@@ -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" );
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index f1464be79de..25c9b4cc7f2 100644..100755
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -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);
diff --git a/apps/bookmarks/lib/bookmarks.php b/apps/bookmarks/lib/bookmarks.php
index b1ff1f411f2..3f27af09557 100755
--- a/apps/bookmarks/lib/bookmarks.php
+++ b/apps/bookmarks/lib/bookmarks.php
@@ -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 = ', \' \'';
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{
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index 6bb7cfd6865..beb6ac0c372 100644..100755
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -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');
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index 3ce0d6fa1d4..7a52bf08dc7 100644..100755
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -9,7 +9,7 @@
* This class manages our app actions
*/
OC_Calendar_App::$l10n = new OC_L10N('calendar');
-OC_Calendar_App::$tz = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+OC_Calendar_App::$tz = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
class OC_Calendar_App{
const CALENDAR = 'calendar';
const EVENT = 'event';
@@ -38,12 +38,12 @@ class OC_Calendar_App{
public static function getCalendar($id, $security = true, $shared = false){
$calendar = OC_Calendar_Calendar::find($id);
if($shared === true){
- if(OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR)){
+ if(OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR)){
return $calendar;
}
}
if($security === true){
- if($calendar['userid'] != OC_User::getUser()){
+ if($calendar['userid'] != OCP\USER::getUser()){
return false;
}
}
@@ -63,13 +63,13 @@ class OC_Calendar_App{
public static function getEventObject($id, $security = true, $shared = false){
$event = OC_Calendar_Object::find($id);
if($shared === true){
- if(OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::EVENT)){
+ if(OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT)){
return $event;
}
}
if($security === true){
$calendar = self::getCalendar($event['calendarid'], false);
- if($calendar['userid'] != OC_User::getUser()){
+ if($calendar['userid'] != OCP\USER::getUser()){
return false;
}
}
@@ -164,7 +164,7 @@ class OC_Calendar_App{
*/
public static function scanCategories($events = null) {
if (is_null($events)) {
- $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
+ $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
if(count($calendars) > 0) {
$events = array();
foreach($calendars as $calendar) {
@@ -278,12 +278,12 @@ class OC_Calendar_App{
public static function getaccess($id, $type){
if($type == self::CALENDAR){
$calendar = self::getCalendar($id, false, false);
- if($calendar['userid'] == OC_User::getUser()){
+ if($calendar['userid'] == OCP\USER::getUser()){
return 'owner';
}
- $isshared = OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR);
+ $isshared = OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR);
if($isshared){
- $writeaccess = OC_Calendar_Share::is_editing_allowed(OC_User::getUser(), $id, OC_Calendar_Share::CALENDAR);
+ $writeaccess = OC_Calendar_Share::is_editing_allowed(OCP\USER::getUser(), $id, OC_Calendar_Share::CALENDAR);
if($writeaccess){
return 'rw';
}else{
@@ -293,12 +293,12 @@ class OC_Calendar_App{
return false;
}
}elseif($type == self::EVENT){
- if(OC_Calendar_Object::getowner($id) == OC_User::getUser()){
+ if(OC_Calendar_Object::getowner($id) == OCP\USER::getUser()){
return 'owner';
}
- $isshared = OC_Calendar_Share::check_access(OC_User::getUser(), $id, OC_Calendar_Share::EVENT);
+ $isshared = OC_Calendar_Share::check_access(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT);
if($isshared){
- $writeaccess = OC_Calendar_Share::is_editing_allowed(OC_User::getUser(), $id, OC_Calendar_Share::EVENT);
+ $writeaccess = OC_Calendar_Share::is_editing_allowed(OCP\USER::getUser(), $id, OC_Calendar_Share::EVENT);
if($writeaccess){
return 'rw';
}else{
@@ -320,12 +320,12 @@ class OC_Calendar_App{
public static function getrequestedEvents($calendarid, $start, $end){
$events = array();
if($calendarid == 'shared_rw' || $_GET['calendar_id'] == 'shared_r'){
- $calendars = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
+ $calendars = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
foreach($calendars as $calendar){
$calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end);
$events = array_merge($events, $calendarevents);
}
- $singleevents = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
+ $singleevents = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
foreach($singleevents as $singleevent){
$event = OC_Calendar_Object::find($singleevent['eventid']);
$events[] = $event;
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index ae6fce3c842..d8e9d5fb946 100644..100755
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -761,7 +761,7 @@ class OC_Calendar_Object{
$vevent->setDateTime('DTSTART', $start, Sabre_VObject_Property_DateTime::DATE);
$vevent->setDateTime('DTEND', $end, Sabre_VObject_Property_DateTime::DATE);
}else{
- $timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+ $timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
$timezone = new DateTimeZone($timezone);
$start = new DateTime($from.' '.$fromtime, $timezone);
$end = new DateTime($to.' '.$totime, $timezone);
diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php
index 0e1a9032666..fc544314359 100644..100755
--- a/apps/calendar/lib/search.php
+++ b/apps/calendar/lib/search.php
@@ -1,7 +1,7 @@
<?php
class OC_Search_Provider_Calendar extends OC_Search_Provider{
function search($query){
- $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
+ $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
if(count($calendars)==0 || !OC_App::isEnabled('calendar')){
//return false;
}
@@ -12,7 +12,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{
}else{
$searchquery[] = $query;
}
- $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+ $user_timezone = OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
$l = new OC_l10n('calendar');
foreach($calendars as $calendar){
$objects = OC_Calendar_Object::all($calendar['id']);
diff --git a/apps/calendar/settings.php b/apps/calendar/settings.php
index b5922802716..a76c5d1e34a 100644..100755
--- a/apps/calendar/settings.php
+++ b/apps/calendar/settings.php
@@ -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());
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index ba9423a66f1..4a3c653d6f1 100644..100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -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', $_)){
diff --git a/apps/calendar/templates/part.choosecalendar.php b/apps/calendar/templates/part.choosecalendar.php
index 4f6680bb497..af3b82a48fc 100644..100755
--- a/apps/calendar/templates/part.choosecalendar.php
+++ b/apps/calendar/templates/part.choosecalendar.php
@@ -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);
diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php
index cf85f0dc53e..8848d228054 100644..100755
--- a/apps/calendar/templates/part.choosecalendar.rowfields.php
+++ b/apps/calendar/templates/part.choosecalendar.rowfields.php
@@ -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
diff --git a/apps/calendar/templates/part.import.php b/apps/calendar/templates/part.import.php
index 90691a33e50..80375c3ef78 100644..100755
--- a/apps/calendar/templates/part.import.php
+++ b/apps/calendar/templates/part.import.php
@@ -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'));
?>
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php
index 71556a6a21c..cd44988af90 100644..100755
--- a/apps/calendar/templates/share.dropdown.php
+++ b/apps/calendar/templates/share.dropdown.php
@@ -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());
?>
diff --git a/apps/contacts/ajax/categories/delete.php b/apps/contacts/ajax/categories/delete.php
index f4e7ba76aa9..d1099da044a 100755
--- a/apps/contacts/ajax/categories/delete.php
+++ b/apps/contacts/ajax/categories/delete.php
@@ -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.'));
}
diff --git a/apps/contacts/ajax/categories/rescan.php b/apps/contacts/ajax/categories/rescan.php
index 97fd1b22fea..37a19fbce4a 100755
--- a/apps/contacts/ajax/categories/rescan.php
+++ b/apps/contacts/ajax/categories/rescan.php
@@ -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.'));
}
diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php
index 3e75e4c80e3..f0e7dde088c 100644..100755
--- a/apps/contacts/ajax/contacts.php
+++ b/apps/contacts/ajax/contacts.php
@@ -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);
diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php
index 6c9976f6fa3..3a331131a15 100755
--- a/apps/contacts/ajax/createaddressbook.php
+++ b/apps/contacts/ajax/createaddressbook.php
@@ -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.'))));
diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php
index 0baa9403524..9ff85dd8586 100755
--- a/apps/contacts/ajax/editname.php
+++ b/apps/contacts/ajax/editname.php
@@ -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();
diff --git a/apps/contacts/import.php b/apps/contacts/import.php
index 8fb1c055e0f..95f17a8896f 100755
--- a/apps/contacts/import.php
+++ b/apps/contacts/import.php
@@ -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'];
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index 0abec096e7f..70daf4abe99 100644..100755
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -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' );
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index bf1cb9323db..6aed9590447 100755
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -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;
}
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index 26ea6d06092..4e840026ce3 100755
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -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) {
diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php
index b858c4a5a48..9939075a460 100644..100755
--- a/apps/contacts/lib/hooks.php
+++ b/apps/contacts/lib/hooks.php
@@ -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'],
diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php
index 31d8542091e..a53556d8bd8 100644..100755
--- a/apps/contacts/lib/search.php
+++ b/apps/contacts/lib/search.php
@@ -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;
// }
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index d7aabbe76a5..b78818c5032 100644..100755
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -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>
diff --git a/apps/contacts/templates/part.chooseaddressbook.php b/apps/contacts/templates/part.chooseaddressbook.php
index adfc8c15161..3b92d1a0c78 100644..100755
--- a/apps/contacts/templates/part.chooseaddressbook.php
+++ b/apps/contacts/templates/part.chooseaddressbook.php
@@ -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');
diff --git a/apps/contacts/templates/part.chooseaddressbook.rowfields.php b/apps/contacts/templates/part.chooseaddressbook.rowfields.php
index 20b67a4161e..50bd192e4d6 100644..100755
--- a/apps/contacts/templates/part.chooseaddressbook.rowfields.php
+++ b/apps/contacts/templates/part.chooseaddressbook.rowfields.php
@@ -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>";
diff --git a/apps/contacts/templates/part.import.php b/apps/contacts/templates/part.import.php
index 570eda9b07d..a2f8aefa6f4 100644..100755
--- a/apps/contacts/templates/part.import.php
+++ b/apps/contacts/templates/part.import.php
@@ -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'));
?>
diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php
index 2db23368866..45e7366f71c 100644..100755
--- a/apps/contacts/templates/part.importaddressbook.php
+++ b/apps/contacts/templates/part.importaddressbook.php
@@ -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>
diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php
index 8a24a91e952..0445f8ae49a 100644..100755
--- a/apps/contacts/templates/settings.php
+++ b/apps/contacts/templates/settings.php
@@ -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>
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 3968a2836a2..37eaedc3fc9 100644..100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -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
diff --git a/apps/files_sharing/ajax/email.php b/apps/files_sharing/ajax/email.php
index 145026bbcd1..c0835f4946e 100644..100755
--- a/apps/files_sharing/ajax/email.php
+++ b/apps/files_sharing/ajax/email.php
@@ -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'];
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php
index 6f8d5247580..b15a81e6086 100644..100755
--- a/apps/files_sharing/ajax/getitem.php
+++ b/apps/files_sharing/ajax/getitem.php
@@ -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();
diff --git a/apps/files_sharing/ajax/setpermissions.php b/apps/files_sharing/ajax/setpermissions.php
index 60302d034f7..fc907bd7517 100644..100755
--- a/apps/files_sharing/ajax/setpermissions.php
+++ b/apps/files_sharing/ajax/setpermissions.php
@@ -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);
diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php
index c704f653c11..fe1c9e07984 100755
--- a/apps/files_sharing/ajax/share.php
+++ b/apps/files_sharing/ajax/share.php
@@ -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'];
diff --git a/apps/files_sharing/ajax/unshare.php b/apps/files_sharing/ajax/unshare.php
index 7e99b5fe374..061d31e2a98 100644..100755
--- a/apps/files_sharing/ajax/unshare.php
+++ b/apps/files_sharing/ajax/unshare.php
@@ -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);
diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php
index cc22a0cd1a7..83fdc3bdf4d 100644..100755
--- a/apps/files_sharing/ajax/userautocomplete.php
+++ b/apps/files_sharing/ajax/userautocomplete.php
@@ -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'>";
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index c5127c59cbd..0ccfea180c6 100755
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -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));
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 845659588ef..f64d52551ff 100644..100755
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -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
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 32aac10b718..9f5b5908797 100644..100755
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -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 );
diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php
index 660411973a2..a7b18c4e091 100644..100755
--- a/apps/files_versions/ajax/rollbackVersion.php
+++ b/apps/files_versions/ajax/rollbackVersion.php
@@ -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'];
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php
index 36efb764033..5f8767fd768 100644..100755
--- a/apps/files_versions/versions.php
+++ b/apps/files_versions/versions.php
@@ -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*');
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php
index ca02c3ae209..eaf5c296de9 100644..100755
--- a/apps/gallery/ajax/createAlbum.php
+++ b/apps/gallery/ajax/createAlbum.php
@@ -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']));
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index 98cf71ec14f..aaf4a7d8658 100644..100755
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -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);
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index b8e7c14fcaf..3eec805957f 100644..100755
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -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');
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index 8c45cfb19fc..cc6faa1406b 100644..100755
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -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())
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php
index efc545f0205..8775cd52e11 100644..100755
--- a/apps/gallery/lib/album.php
+++ b/apps/gallery/lib/album.php
@@ -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'];
}
}
diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php
index 9257bbce628..525afc4127e 100755
--- a/apps/gallery/lib/hooks_handlers.php
+++ b/apps/gallery/lib/hooks_handlers.php
@@ -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);
diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php
index 5098e1a2ed2..455ac5036d9 100644..100755
--- a/apps/gallery/lib/photo.php
+++ b/apps/gallery/lib/photo.php
@@ -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', '');
}
}
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index 0317f943e5d..9cf8c113d1f 100644..100755
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -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;
diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php
index cf3d9188e65..078333ab21e 100644..100755
--- a/apps/gallery/templates/index.php
+++ b/apps/gallery/templates/index.php
@@ -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>
diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php
index 9c7b3efce75..3238ebcc679 100644..100755
--- a/apps/media/ajax/api.php
+++ b/apps/media/ajax/api.php
@@ -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();
diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php
index ea7c5006e70..24a7e2463f0 100644..100755
--- a/apps/media/ajax/autoupdate.php
+++ b/apps/media/ajax/autoupdate.php
@@ -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));
?>
diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php
index 411acd97506..128fcde28d1 100644..100755
--- a/apps/media/lib_collection.php
+++ b/apps/media/lib_collection.php
@@ -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){
diff --git a/apps/remoteStorage/auth.php b/apps/remoteStorage/auth.php
index 69d7cfc3b93..682c1e97f6b 100644..100755
--- a/apps/remoteStorage/auth.php
+++ b/apps/remoteStorage/auth.php
@@ -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!
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index 6e6a19c739f..89dfc3247e9 100644..100755
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -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
diff --git a/apps/remoteStorage/templates/settings.php b/apps/remoteStorage/templates/settings.php
index b940282b2cc..147378dda39 100644..100755
--- a/apps/remoteStorage/templates/settings.php
+++ b/apps/remoteStorage/templates/settings.php
@@ -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>
diff --git a/apps/user_migrate/ajax/export.php b/apps/user_migrate/ajax/export.php
index 99503cad142..874c0428285 100644..100755
--- a/apps/user_migrate/ajax/export.php
+++ b/apps/user_migrate/ajax/export.php
@@ -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();
diff --git a/apps/user_openid/settings.php b/apps/user_openid/settings.php
index d85eaebb5ee..01ab4d16fc9 100644..100755
--- a/apps/user_openid/settings.php
+++ b/apps/user_openid/settings.php
@@ -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');
diff --git a/apps/user_openid/templates/settings.php b/apps/user_openid/templates/settings.php
index 24dfaa17891..dd30d82aa93 100644..100755
--- a/apps/user_openid/templates/settings.php
+++ b/apps/user_openid/templates/settings.php
@@ -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>