aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage/Directory.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-28 21:02:27 -0700
committerredmatrix <git@macgirvin.com>2016-04-28 21:02:27 -0700
commitbb96f44861c66e9eb334e18e4b4b659685433008 (patch)
tree1f1d7b789829502c61a8a3defbecf37bc4a5dba9 /Zotlabs/Storage/Directory.php
parent30a6ae3daa42da8d1d9560fcc4c706b3e41c4d80 (diff)
downloadvolse-hubzilla-bb96f44861c66e9eb334e18e4b4b659685433008.tar.gz
volse-hubzilla-bb96f44861c66e9eb334e18e4b4b659685433008.tar.bz2
volse-hubzilla-bb96f44861c66e9eb334e18e4b4b659685433008.zip
allow engineering units (e.g. 400M, 1G) as service class limits
Diffstat (limited to 'Zotlabs/Storage/Directory.php')
-rw-r--r--Zotlabs/Storage/Directory.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index edbef5a95..3c0cff6ef 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -315,13 +315,13 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
}
// check against service class quota
- $limit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit');
+ $limit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'));
if ($limit !== false) {
$x = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d ",
intval($c[0]['channel_account_id'])
);
if (($x) && ($x[0]['total'] + $size > $limit)) {
- logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit);
+ logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . userReadableSize($limit));
attach_delete($c[0]['channel_id'], $hash);
return;
}
@@ -549,7 +549,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
intval($this->auth->owner_id)
);
- $ulimit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit');
+ $ulimit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'));
$limit = (($ulimit) ? $ulimit : $limit);
$x = q("select sum(filesize) as total from attach where aid = %d",