aboutsummaryrefslogtreecommitdiffstats
path: root/include/account.php
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-08-31 17:49:22 -0700
committerredmatrix <mike@macgirvin.com>2016-08-31 17:49:22 -0700
commitea0be8ea1a22abfdedae0d0c47677a9de44e08c0 (patch)
tree277e9a08e4958fef0801aeb83f73d2fb3cbee952 /include/account.php
parente9462ba14529b7172ba5a21e7985d24de91faa37 (diff)
downloadvolse-hubzilla-ea0be8ea1a22abfdedae0d0c47677a9de44e08c0.tar.gz
volse-hubzilla-ea0be8ea1a22abfdedae0d0c47677a9de44e08c0.tar.bz2
volse-hubzilla-ea0be8ea1a22abfdedae0d0c47677a9de44e08c0.zip
provide techlevels in the pro server role. Should have no visible effect on other roles.
Diffstat (limited to 'include/account.php')
-rw-r--r--include/account.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/account.php b/include/account.php
index 5c44f13ca..c11f1668b 100644
--- a/include/account.php
+++ b/include/account.php
@@ -14,6 +14,13 @@ require_once('include/crypto.php');
require_once('include/channel.php');
+function get_account_by_id($account_id) {
+ $r = q("select * from account where account_id = %d",
+ intval($account_id)
+ );
+ return (($r) ? $r[0] : false);
+}
+
function check_account_email($email) {
$result = array('error' => false, 'message' => '');
@@ -751,3 +758,23 @@ function upgrade_bool_message($bbcode = false) {
$x = upgrade_link($bbcode);
return t('This action is not available under your subscription plan.') . (($x) ? ' ' . $x : '') ;
}
+
+
+function get_account_techlevel($account_id = 0) {
+
+ $role = \Zotlabs\Lib\System::get_server_role();
+ if($role == 'basic')
+ return 0;
+ if($role == 'standard')
+ return 5;
+
+ if(! $account_id) {
+ $x = \App::get_account();
+ }
+ else {
+ $x = get_account_by_id($account_id);
+ }
+
+ return (($x) ? intval($x['account_level']) : 0);
+
+} \ No newline at end of file