From 316adfab5e4dc71c5e0e36be1221d1477e4c8f86 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 21 Oct 2020 09:13:37 -0600 Subject: [PATCH] Fix some bugs in hidden uploads - Creating the share couldn't handle sqlfs://user@path style paths - UI namespace issues --- api/src/Vfs/HiddenUploadSharing.php | 4 ++-- filemanager/src/Sharing/HiddenUpload.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/src/Vfs/HiddenUploadSharing.php b/api/src/Vfs/HiddenUploadSharing.php index 7d1ff77c05..aab3bac3a1 100644 --- a/api/src/Vfs/HiddenUploadSharing.php +++ b/api/src/Vfs/HiddenUploadSharing.php @@ -131,11 +131,11 @@ class HiddenUploadSharing extends Sharing { $upload_dir = Vfs::concat($path, self::HIDDEN_UPLOAD_DIR); - if (($stat = Vfs::stat($upload_dir)) && !Vfs::check_access($upload_dir, Vfs::WRITABLE, $stat)) + if (($stat = stat($upload_dir)) && !Vfs::check_access($upload_dir, Vfs::WRITABLE, $stat)) { throw new Api\Exception\NoPermission("Upload directory exists, but you have no write permission"); } - if (!($stat = Vfs::stat($upload_dir))) + if (!($stat = stat($upload_dir))) { // Directory is not there, create it if (!mkdir($upload_dir)) diff --git a/filemanager/src/Sharing/HiddenUpload.php b/filemanager/src/Sharing/HiddenUpload.php index 76d0a133d9..8694020e10 100644 --- a/filemanager/src/Sharing/HiddenUpload.php +++ b/filemanager/src/Sharing/HiddenUpload.php @@ -3,7 +3,8 @@ namespace EGroupware\Filemanager\Sharing; - +use EGroupware\Api\Etemplate; +use EGroupware\Api\Json; use EGroupware\Api\Vfs; use EGroupware\Api\Vfs\Sharing; use EGroupware\Api\Vfs\UploadSharingUi; @@ -33,7 +34,7 @@ class HiddenUpload extends AnonymousList */ function listview(array $content=null,$msg=null) { - $this->etemplate = $this->etemplate ? $this->etemplate : new Api\Etemplate(static::LIST_TEMPLATE); + $this->etemplate = $this->etemplate ? $this->etemplate : new Etemplate(static::LIST_TEMPLATE); if (isset($GLOBALS['egw']->sharing) && $GLOBALS['egw']->sharing->has_hidden_upload()) { @@ -120,7 +121,7 @@ class HiddenUpload extends AnonymousList } // tell client-side that this directory is writeable - allows upload + button - $response = Api\Json\Response::get(); + $response = Json\Response::get(); $response->call('app.filemanager.set_readonly', $query['path'], false); // Hide the hidden upload directory, mark everything else as readonly