aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r--Zotlabs/Storage/Browser.php24
-rw-r--r--Zotlabs/Storage/Directory.php3
2 files changed, 24 insertions, 3 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 713d75108..93c55bd4c 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -274,6 +274,22 @@ class Browser extends DAV\Browser\Plugin {
// SimpleCollection, we won't need to show the panel either.
if (get_class($node) === 'Sabre\\DAV\\SimpleCollection')
return;
+ require_once('include/acl_selectors.php');
+
+ $aclselect = null;
+ $lockstate = '';
+
+ if($this->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;
@@ -306,7 +321,12 @@ class Browser extends DAV\Browser\Plugin {
'$folder_submit' => t('Create'),
'$upload_header' => t('Upload file'),
'$upload_submit' => t('Upload'),
- '$quota' => $quota
+ '$quota' => $quota,
+ '$channick' => $this->auth->owner_nick,
+ '$aclselect' => $aclselect,
+ '$lockstate' => $lockstate,
+ '$return_url' => \App::$cmd,
+ '$dragdroptext' => t('Drop files here to immediately upload')
));
}
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index f9ddb4e24..15e06e28f 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Storage;
use Sabre\DAV;
+use Sabre\HTTP;
/**
* @brief RedDirectory class.
@@ -159,7 +160,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
throw new DAV\Exception\Forbidden('Permission denied.');
}
- list($parent_path, ) = DAV\URLUtil::splitPath($this->red_path);
+ list($parent_path, ) = HTTP\URLUtil::splitPath($this->red_path);
$new_path = $parent_path . '/' . $name;
$r = q("UPDATE attach SET filename = '%s' WHERE hash = '%s' AND uid = %d",