provide techlevels in the pro server role. Should have no visible effect on other roles.

This commit is contained in:
redmatrix
2016-08-31 17:49:22 -07:00
parent e9462ba145
commit ea0be8ea1a
12 changed files with 81 additions and 20 deletions

View File

@@ -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);
}