From fa2be0750c50de45a2fd101eb23fa858c0e0771b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Jul 2015 17:38:13 +0200 Subject: Make files app use Webdav for most operations --- apps/files_sharing/js/sharedfilelist.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 68bfd63ec89..a799d4a94c2 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -231,6 +231,7 @@ files = _.chain(files) // convert share data to file data .map(function(share) { + // TODO: use OC.Files.FileInfo var file = { id: share.file_source, icon: OC.MimeType.getIconUrl(share.mimetype), @@ -242,9 +243,6 @@ } else { file.type = 'file'; - if (share.isPreviewAvailable) { - file.isPreviewAvailable = true; - } } file.share = { id: share.id, -- cgit v1.2.3 From f20232d4bd3e78c4ea980aa03849c3f9bcf5b893 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Jul 2015 17:41:20 +0200 Subject: Make public link share page work with Webdav and add operations The public page now uses the public.php/webdav endpoint. Also enabled more file operations like rename, move, delete and create folder from the public page, which are now all possible thanks to the public.php/webdav endpoint. --- apps/files/ajax/upload.php | 7 +- apps/files/js/files.js | 2 +- apps/files/templates/list.php | 11 ---- apps/files_sharing/ajax/list.php | 96 ---------------------------- apps/files_sharing/js/public.js | 16 ++++- apps/files_sharing/tests/js/publicAppSpec.js | 20 +++++- 6 files changed, 35 insertions(+), 117 deletions(-) delete mode 100644 apps/files_sharing/ajax/list.php (limited to 'apps/files_sharing/js') diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index a784642728f..18e9cfe6117 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -41,7 +41,6 @@ OCP\JSON::setContentTypeHeader('text/plain'); // If not, check the login. // If no token is sent along, rely on login only -$allowedPermissions = \OCP\Constants::PERMISSION_ALL; $errorCode = null; $l = \OC::$server->getL10N('files'); @@ -60,8 +59,6 @@ if (empty($_POST['dirToken'])) { \OC_User::setIncognitoMode(true); - // return only read permissions for public upload - $allowedPermissions = \OCP\Constants::PERMISSION_READ; $publicDirectory = !empty($_POST['subdir']) ? (string)$_POST['subdir'] : '/'; $linkItem = OCP\Share::getShareByToken((string)$_POST['dirToken']); @@ -207,7 +204,7 @@ if (\OC\Files\Filesystem::isValidPath($dir) === true) { $data['originalname'] = $files['name'][$i]; $data['uploadMaxFilesize'] = $maxUploadFileSize; $data['maxHumanFilesize'] = $maxHumanFileSize; - $data['permissions'] = $meta['permissions'] & $allowedPermissions; + $data['permissions'] = $meta['permissions']; $data['directory'] = $returnedDir; $result[] = $data; } @@ -234,7 +231,7 @@ if (\OC\Files\Filesystem::isValidPath($dir) === true) { $data['originalname'] = $files['name'][$i]; $data['uploadMaxFilesize'] = $maxUploadFileSize; $data['maxHumanFilesize'] = $maxHumanFileSize; - $data['permissions'] = $meta['permissions'] & $allowedPermissions; + $data['permissions'] = $meta['permissions']; $data['directory'] = $returnedDir; $result[] = $data; } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 6bdd14ac65d..e33b8354437 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -207,7 +207,7 @@ */ lazyLoadPreview : function(path, mime, ready, width, height, etag) { console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance'); - return OCA.Files.App.fileList.lazyLoadPreview({ + return FileList.lazyLoadPreview({ path: path, mime: mime, callback: ready, diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 7ebf80ee8b2..04550f945b6 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -1,16 +1,5 @@