From 70cea18cce0fcdb4d8118ff2d7abccc922417a6a Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Tue, 1 May 2012 18:50:31 +0200 Subject: ported getUser --- apps/gallery/ajax/createAlbum.php | 2 +- apps/gallery/ajax/galleryOp.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) mode change 100644 => 100755 apps/gallery/ajax/createAlbum.php mode change 100644 => 100755 apps/gallery/ajax/galleryOp.php (limited to 'apps/gallery/ajax') diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php old mode 100644 new mode 100755 index ca02c3ae209..eaf5c296de9 --- 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 old mode 100644 new mode 100755 index 98cf71ec14f..aaf4a7d8658 --- 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); -- cgit v1.2.3