aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage/Browser.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Storage/Browser.php')
-rw-r--r--Zotlabs/Storage/Browser.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 508c39d22..c2d70b854 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -12,7 +12,7 @@ use Sabre\DAV;
*
* @extends \\Sabre\\DAV\\Browser\\Plugin
*
- * @link http://github.com/redmatrix/hubzilla
+ * @link http://framagit.org/hubzilla/core/
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
*/
class Browser extends DAV\Browser\Plugin {
@@ -241,7 +241,7 @@ class Browser extends DAV\Browser\Plugin {
// put the array for this file together
$ft['attachId'] = $this->findAttachIdByHash($attachHash);
- $ft['fileStorageUrl'] = substr($fullPath, 0, strpos($fullPath, "cloud/")) . "filestorage/" . $this->auth->getCurrentUser();
+ $ft['fileStorageUrl'] = substr($fullPath, 0, strpos($fullPath, "cloud/")) . "filestorage/" . $this->auth->owner_nick;
$ft['icon'] = $icon;
$ft['photo_icon'] = $photo_icon;
$ft['attachIcon'] = (($size) ? $attachIcon : '');
@@ -276,6 +276,8 @@ class Browser extends DAV\Browser\Plugin {
'$create' => t('Create'),
'$upload' => t('Add Files'),
'$is_owner' => $is_owner,
+ '$is_admin' => is_site_admin(),
+ '$admin_delete' => t('Admin Delete'),
'$parentpath' => $parentpath,
'$cpath' => bin2hex(\App::$query_string),
'$tiles' => intval($_SESSION['cloud_tiles']),
@@ -331,6 +333,7 @@ class Browser extends DAV\Browser\Plugin {
$aclselect = null;
$lockstate = '';
+ $limit = 0;
if($this->auth->owner_id) {
$channel = channelx_by_n($this->auth->owner_id);
@@ -341,10 +344,15 @@ class Browser extends DAV\Browser\Plugin {
$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($this->auth->owner_id, 'attach_upload_limit'));
+ }
+
+ if((! $limit) && get_config('system','cloud_report_disksize')) {
+ $limit = engr_units_to_bytes(disk_free_space('store'));
}
- // 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'));
$r = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d",
intval($this->auth->channel_account_id)
);