aboutsummaryrefslogtreecommitdiffstats
path: root/include/account.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-15 17:17:00 -0700
committerfriendica <info@friendica.com>2014-09-15 17:17:00 -0700
commitbbc9e4427e76761b0607ce2c1a1f5cc7f499b52f (patch)
tree46358c59fea737736aa7898439fd8ef3c576be14 /include/account.php
parentc841714ba5d0df349e0f9d972fafa18a72fc4f1e (diff)
downloadvolse-hubzilla-bbc9e4427e76761b0607ce2c1a1f5cc7f499b52f.tar.gz
volse-hubzilla-bbc9e4427e76761b0607ce2c1a1f5cc7f499b52f.tar.bz2
volse-hubzilla-bbc9e4427e76761b0607ce2c1a1f5cc7f499b52f.zip
honour service class restrictions for total_identities, total_channels ("friends") and total_feeds both when importing channels and subsequently when syncing clones. Limits are based on the local system - additional entries are silently dropped.
Diffstat (limited to 'include/account.php')
-rw-r--r--include/account.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/account.php b/include/account.php
index a3d6ef025..df484e608 100644
--- a/include/account.php
+++ b/include/account.php
@@ -616,6 +616,29 @@ function service_class_fetch($uid,$property) {
return((array_key_exists($property,$arr)) ? $arr[$property] : false);
}
+// like service_class_fetch but queries by account rather than channel
+
+function account_service_class_fetch($aid,$property) {
+
+ $r = q("select account_service_class as service_class from account where account_id = %d limit 1",
+ intval($aid)
+ );
+ if($r !== false && count($r)) {
+ $service_class = $r[0]['service_class'];
+ }
+
+ if(! x($service_class))
+ return false; // everything is allowed
+
+ $arr = get_config('service_class',$service_class);
+
+ if(! is_array($arr) || (! count($arr)))
+ return false;
+
+ return((array_key_exists($property,$arr)) ? $arr[$property] : false);
+}
+
+
function upgrade_link($bbcode = false) {
$l = get_config('service_class','upgrade_link');
if(! $l)