diff options
author | redmatrix <mike@macgirvin.com> | 2016-08-31 17:49:22 -0700 |
---|---|---|
committer | redmatrix <mike@macgirvin.com> | 2016-08-31 17:49:22 -0700 |
commit | ea0be8ea1a22abfdedae0d0c47677a9de44e08c0 (patch) | |
tree | 277e9a08e4958fef0801aeb83f73d2fb3cbee952 /Zotlabs/Module/Settings.php | |
parent | e9462ba14529b7172ba5a21e7985d24de91faa37 (diff) | |
download | volse-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/Module/Settings.php')
-rw-r--r-- | Zotlabs/Module/Settings.php | 23 |
1 files changed, 21 insertions, 2 deletions
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'), |