aboutsummaryrefslogtreecommitdiffstats
path: root/include/account.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 /include/account.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 'include/account.php')
-rw-r--r--include/account.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/account.php b/include/account.php
index c64197b49..5998609d4 100644
--- a/include/account.php
+++ b/include/account.php
@@ -591,6 +591,7 @@ function service_class_allows($uid, $property, $usage = false) {
if($limit === false)
return true; // No service class set => everything is allowed
+ $limit = engr_units_to_bytes($limit);
if($usage === false) {
// We use negative values for not allowed properties in a subscriber plan
return ((x($limit)) ? (bool) $limit : true);
@@ -627,6 +628,8 @@ function account_service_class_allows($aid, $property, $usage = false) {
if($limit === false)
return true; // No service class is set => everything is allowed
+ $limit = engr_units_to_bytes($limit);
+
if($usage === false) {
// We use negative values for not allowed properties in a subscriber plan
return ((x($limit)) ? (bool) $limit : true);