From 271f85be3b36a4d4aac55a51cb7ff2580a95ce3e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 24 Jul 2016 20:27:59 -0700 Subject: add acl selection to files upload via /cloud (still missing from directory creation) --- Zotlabs/Module/File_upload.php | 38 ++++++++++++++++++++++++++++++++++++++ Zotlabs/Storage/Browser.php | 21 ++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 Zotlabs/Module/File_upload.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php new file mode 100644 index 000000000..45f820b7c --- /dev/null +++ b/Zotlabs/Module/File_upload.php @@ -0,0 +1,38 @@ +auth-owner_id) { + $channel = channelx_by_n($this->auth->owner_id); + if($channel) { + $acl = new \Zotlabs\Access\AccessList($channel); + $channel_acl = $acl->get(); + $lockstate = (($acl->is_private()) ? 'lock' : 'unlock'); + + $aclselect = ((local_channel() == $this->auth->owner_id) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_storage')) : ''); + + } + } // Storage and quota for the account (all channels of the owner of this directory)! $limit = engr_units_to_bytes(service_class_fetch($owner, 'attach_upload_limit')); @@ -293,7 +309,6 @@ class Browser extends DAV\Browser\Plugin { userReadableSize($limit), round($used / $limit, 1) * 100); } - // prepare quota for template $quota = array(); $quota['used'] = $used; @@ -307,6 +322,10 @@ class Browser extends DAV\Browser\Plugin { '$upload_header' => t('Upload file'), '$upload_submit' => t('Upload'), '$quota' => $quota, + '$channick' => $this->auth->owner_nick, + '$aclselect' => $aclselect, + '$lockstate' => $lockstate, + '$return_url' => \App::$cmd, '$dragdroptext' => t('Drop files here to immediately upload') )); } -- cgit v1.2.3