diff options
author | zotlabs <mike@macgirvin.com> | 2018-06-13 21:06:56 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-06-13 21:06:56 -0700 |
commit | 8da0f9d3569e7c19e5581c4d402931a07dcab317 (patch) | |
tree | df8b90874817c61ff2683aa814c58161deeb54b5 | |
parent | b5e4a5f51c478d646248c5a9eb22907cda32dd3e (diff) | |
download | volse-hubzilla-8da0f9d3569e7c19e5581c4d402931a07dcab317.tar.gz volse-hubzilla-8da0f9d3569e7c19e5581c4d402931a07dcab317.tar.bz2 volse-hubzilla-8da0f9d3569e7c19e5581c4d402931a07dcab317.zip |
optionally report total available space when uploading
-rw-r--r-- | Zotlabs/Module/Admin/Security.php | 5 | ||||
-rw-r--r-- | Zotlabs/Storage/Browser.php | 4 | ||||
-rwxr-xr-x | view/tpl/admin_security.tpl | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/Zotlabs/Module/Admin/Security.php b/Zotlabs/Module/Admin/Security.php index 249fda469..80c1d85b7 100644 --- a/Zotlabs/Module/Admin/Security.php +++ b/Zotlabs/Module/Admin/Security.php @@ -20,7 +20,9 @@ class Security { $cloud_noroot = ((x($_POST,'cloud_noroot')) ? 1 : 0); set_config('system','cloud_disable_siteroot',1 - $cloud_noroot); - + $cloud_disksize = ((x($_POST,'cloud_disksize')) ? 1 : 0); + set_config('system','cloud_report_disksize',$cloud_disksize); + $ws = $this->trim_array_elems(explode("\n",$_POST['whitelisted_sites'])); set_config('system','whitelisted_sites',$ws); @@ -92,6 +94,7 @@ class Security { '$form_security_token' => get_form_security_token('admin_security'), '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently authenticated.")), '$cloud_noroot' => [ 'cloud_noroot', t('Provide a cloud root directory'), 1 - intval(get_config('system','cloud_disable_siteroot')), t('The cloud root directory lists all channel names which provide public files') ], + '$cloud_disksize' => [ 'cloud_disksize', t('Show total disk space available to cloud uploads'), intval(get_config('system','cloud_report_disksize')), '' ], '$transport_security' => array('transport_security', t('Set "Transport Security" HTTP header'),intval(get_config('system','transport_security_header')),''), '$content_security' => array('content_security', t('Set "Content Security Policy" HTTP header'),intval(get_config('system','content_security_policy')),''), '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")), diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index 153016da6..67d934783 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -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) ); diff --git a/view/tpl/admin_security.tpl b/view/tpl/admin_security.tpl index 121758e63..493707a7a 100755 --- a/view/tpl/admin_security.tpl +++ b/view/tpl/admin_security.tpl @@ -8,6 +8,7 @@ {{include file="field_checkbox.tpl" field=$block_public}} {{include file="field_checkbox.tpl" field=$cloud_noroot}} + {{include file="field_checkbox.tpl" field=$cloud_disksize}} {{include file="field_checkbox.tpl" field=$transport_security}} {{include file="field_checkbox.tpl" field=$content_security}} {{include file="field_checkbox.tpl" field=$embed_sslonly}} |