From 4f0b1386924b52da59d0a4eedaae689173fe21da Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 6 Aug 2016 12:46:10 +0200 Subject: bring back acl for cloud file uploads --- Zotlabs/Storage/Browser.php | 3 ++- include/attach.php | 2 +- view/js/mod_cloud.js | 4 ++-- view/tpl/cloud_actionspanel.tpl | 41 ++++++++++++++++++++++++++--------------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index 78b267bf8..7bae8f0ee 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -279,7 +279,7 @@ class Browser extends DAV\Browser\Plugin { $aclselect = null; $lockstate = ''; - if($this->auth-owner_id) { + if($this->auth->owner_id) { $channel = channelx_by_n($this->auth->owner_id); if($channel) { $acl = new \Zotlabs\Access\AccessList($channel); @@ -330,6 +330,7 @@ class Browser extends DAV\Browser\Plugin { '$deny_gid' => acl2json($channel_acl['deny_gid']), '$lockstate' => $lockstate, '$return_url' => \App::$cmd, + '$path' => str_replace('cloud/' . $this->auth->owner_nick . '/', '', $path), '$dragdroptext' => t('Drop files here to immediately upload') )); } diff --git a/include/attach.php b/include/attach.php index f3fb12293..511f1b586 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1977,4 +1977,4 @@ function get_filename_by_cloudname($cloudname, $channel, $storepath) { } } return null; -} \ No newline at end of file +} diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 5b3c78bed..8b8a3ba3f 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -202,7 +202,7 @@ function UploadFile(file, idx) { }); // POST to the entire cloud path - xhr.open('post', window.location.pathname, true); + xhr.open('post', 'file_upload', true); var formfields = $("#ajax-upload-files").serializeArray(); @@ -210,7 +210,7 @@ function UploadFile(file, idx) { $.each(formfields, function(i, field) { data.append(field.name, field.value); }); - data.append('file', file); + data.append('userfile', file); xhr.send(data); } diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl index 0884cd0b4..d27b3f42d 100644 --- a/view/tpl/cloud_actionspanel.tpl +++ b/view/tpl/cloud_actionspanel.tpl @@ -1,20 +1,31 @@
- -
- - - -
-
+ +
+ + + +
+
- {{if $quota.limit || $quota.used}}{{/if}} -
- - - - -
-
+ {{if $quota.limit || $quota.used}}{{/if}} +
+ + + + + +
+
+ {{if $lockstate}} + + {{/if}} + +
+
+
+
{{$aclselect}} -- cgit v1.2.3