aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-25 01:37:44 -0700
committerfriendica <info@friendica.com>2012-06-25 01:37:44 -0700
commit35a098e0dc7940974132d8d65bbc4418d92fb204 (patch)
tree3f49c1497c38c54b50dacbafc04933aa16cfb28a /include
parentad6c82bdea11e4c35284e18608f78ad4c355405d (diff)
downloadvolse-hubzilla-35a098e0dc7940974132d8d65bbc4418d92fb204.tar.gz
volse-hubzilla-35a098e0dc7940974132d8d65bbc4418d92fb204.tar.bz2
volse-hubzilla-35a098e0dc7940974132d8d65bbc4418d92fb204.zip
service limits for photo uploads
Diffstat (limited to 'include')
-rw-r--r--include/plugin.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 89715485e..e8fec4cbe 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -355,6 +355,31 @@ function service_class_allows($uid,$property,$usage = false) {
}
}
+
+function service_class_fetch($uid,$property) {
+
+ if($uid == local_user()) {
+ $service_class = $a->user['service_class'];
+ }
+ else {
+ $r = q("select service_class from user where uid = %d limit 1",
+ intval($uid)
+ );
+ if($r !== false and 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() {
$l = get_config('service_class','upgrade_link');
$t = sprintf('<a href="%s">' . t('Click here to upgrade.') . '</div>', $l);