optionally report total available space when uploading

This commit is contained in:
zotlabs
2018-06-13 21:06:56 -07:00
parent b5e4a5f51c
commit 8da0f9d356
3 changed files with 9 additions and 1 deletions

View File

@@ -347,6 +347,10 @@ class Browser extends DAV\Browser\Plugin {
// 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'));
if((! $limit) && get_config('system','cloud_report_disksize')) {
$limit = engr_units_to_bytes(disk_free_space('store'));
}
$r = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d",
intval($this->auth->channel_account_id)
);