aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
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 /Zotlabs
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 'Zotlabs')
-rw-r--r--Zotlabs/Lib/ThreadItem.php3
-rw-r--r--Zotlabs/Module/Settings.php23
-rwxr-xr-xZotlabs/Render/SmartyTemplate.php1
3 files changed, 24 insertions, 3 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index eee3b2a4f..f50b9680e 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -246,10 +246,11 @@ class ThreadItem {
}
$server_role = get_config('system','server_role');
+
$has_bookmarks = false;
if(is_array($item['term'])) {
foreach($item['term'] as $t) {
- if(($server_role != 'basic') && ($t['ttype'] == TERM_BOOKMARK))
+ if((get_account_techlevel() > 0) && ($t['ttype'] == TERM_BOOKMARK))
$has_bookmarks = true;
}
}
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index bd16b930e..81c24e02b 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -306,6 +306,8 @@ class Settings extends \Zotlabs\Web\Controller {
$errs = array();
$email = ((x($_POST,'email')) ? trim(notags($_POST['email'])) : '');
+ $techlevel = ((array_key_exists('techlevel',$_POST)) ? intval($_POST['techlevel']) : 0);
+
$account = \App::get_account();
if($email != $account['account_email']) {
if(! valid_email($email))
@@ -324,6 +326,13 @@ class Settings extends \Zotlabs\Web\Controller {
$errs[] = t('System failure storing new email. Please try again.');
}
}
+ if($techlevel != $account['account_level']) {
+ $r = q("update account set account_level = %d where account_id = %d",
+ intval($techlevel),
+ intval($account['account_id'])
+ );
+ info( t('Technical skill level updated') . EOL);
+ }
if($errs) {
foreach($errs as $err)
@@ -783,8 +792,17 @@ class Settings extends \Zotlabs\Web\Controller {
call_hooks('account_settings', $account_settings);
$email = \App::$account['account_email'];
-
-
+
+ $techlevels = [
+ '0' => t('Beginner/Basic'),
+ '1' => t('Novice - not skilled but willing to learn'),
+ '2' => t('Intermediate - somewhat comfortable'),
+ '3' => t('Advanced - very comfortable'),
+ '4' => t('Expert - I can write computer code'),
+ '5' => t('Wizard - I probably know more than you do')
+ ];
+
+
$tpl = get_markup_template("settings_account.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_account"),
@@ -792,6 +810,7 @@ class Settings extends \Zotlabs\Web\Controller {
'$origpass' => array('origpass', t('Current Password'), ' ',''),
'$password1'=> array('npassword', t('Enter New Password'), '', ''),
'$password2'=> array('confirm', t('Confirm New Password'), '', t('Leave password fields blank unless changing')),
+ '$techlevel' => [ 'techlevel', t('Your technical skill level'), \App::$account['account_level'], t('Used to provide a member experience matched to your comfort level'), $techlevels ],
'$submit' => t('Submit'),
'$email' => array('email', t('Email Address:'), $email, ''),
'$removeme' => t('Remove Account'),
diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php
index 7abe0731c..ffe58e286 100755
--- a/Zotlabs/Render/SmartyTemplate.php
+++ b/Zotlabs/Render/SmartyTemplate.php
@@ -35,6 +35,7 @@ class SmartyTemplate implements TemplateEngine {
$r['$z_baseurl'] = z_root();
$r['$z_server_role'] = \Zotlabs\Lib\System::get_server_role();
+ $r['$z_techlevel'] = get_account_techlevel();
if(gettype($s) === 'string') {
$template = $s;