From: Tom Needham Date: Mon, 31 Dec 2012 16:31:22 +0000 (+0000) Subject: Remove the WIP external sharing api X-Git-Tag: v5.0.0alpha1~260^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d23e983908d02fe72f305aeaabbdca05d167e8f;p=nextcloud-server.git Remove the WIP external sharing api --- diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 1402a146454..0104d0d017f 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -3,7 +3,6 @@ OC::$CLASSPATH['OC_Share_Backend_File'] = "apps/files_sharing/lib/share/file.php"; OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'apps/files_sharing/lib/share/folder.php'; OC::$CLASSPATH['OC_Filestorage_Shared'] = "apps/files_sharing/lib/sharedstorage.php"; -OC::$CLASSPATH['OC_Sharing_API'] = "apps/files_sharing/lib/api.php"; OCP\Util::connectHook('OC_Filesystem', 'setup', 'OC_Filestorage_Shared', 'setup'); OCP\Share::registerBackend('file', 'OC_Share_Backend_File'); OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file'); diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php deleted file mode 100644 index 180dde635ad..00000000000 --- a/apps/files_sharing/appinfo/routes.php +++ /dev/null @@ -1,23 +0,0 @@ -. -* -*/ -OCP\API::register('post', '/cloud/files/share/{type}/{path}', array('OC_Sharing_API', 'shareFile'), 'files_sharing', OC_API::USER_AUTH, array(), array('type' => 'user|group|link|email|contact|remote', 'path' => '.*')); -?> \ No newline at end of file diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php deleted file mode 100644 index 151e6d6cfd4..00000000000 --- a/apps/files_sharing/lib/api.php +++ /dev/null @@ -1,47 +0,0 @@ - OCP\Share::SHARE_TYPE_USER, - 'group' => OCP\Share::SHARE_TYPE_GROUP, - 'link' => OCP\Share::SHARE_TYPE_LINK, - 'email' => OCP\Share::SHARE_TYPE_EMAIL, - 'contact' => OCP\Share::SHARE_TYPE_CONTACT, - 'remote' => OCP\Share::SHARE_TYPE_USER, - ); - $type = $typemap[$parameters['type']]; - $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; - $permissionstring = isset($_POST['permissions']) ? $_POST['permissions'] : ''; - $permissionmap = array( - 'C' => OCP\Share::PERMISSION_CREATE, - 'R' => OCP\Share::PERMISSION_READ, - 'U' => OCP\Share::PERMISSION_UPDATE, - 'D' => OCP\Share::PERMISSION_DELETE, - 'S' => OCP\Share::PERMISSION_SHARE, - ); - $permissions = 0; - foreach($permissionmap as $letter => $permission) { - if(strpos($permissionstring, $letter) !== false) { - $permissions += $permission; - } - } - - try { - OCP\Share::shareItem('file', $fileid, $type, $shareWith, $permissions); - } catch (Exception $e){ - error_log($e->getMessage()); - } - switch($type){ - case OCP\Share::SHARE_TYPE_LINK: - $link = OC_Helper::linkToPublic('files') . '&file=/' . OC_User::getUser() . '/files' . $path; - return array('link' => array('url' => $link)); - break; - } - - } - -} \ No newline at end of file diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php deleted file mode 100644 index 65d4b87089c..00000000000 --- a/apps/files_sharing/tests/api.php +++ /dev/null @@ -1,13 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -class Test_Share_API extends UnitTestCase { - - function test - -} \ No newline at end of file