user editor: allow toggling otp

This commit is contained in:
Andrew Dolgov 2021-03-02 13:27:41 +03:00
parent 982bd838bf
commit d4ad483add
2 changed files with 9 additions and 8 deletions

View File

@ -116,6 +116,7 @@ class Pref_Users extends Handler_Administrative {
$user->login = mb_strtolower($login); $user->login = mb_strtolower($login);
$user->access_level = (int) clean($_REQUEST["access_level"]); $user->access_level = (int) clean($_REQUEST["access_level"]);
$user->email = clean($_REQUEST["email"]); $user->email = clean($_REQUEST["email"]);
$user->otp_enabled = checkbox_to_sql_bool($_REQUEST["otp_enabled"]);
$user->save(); $user->save();
} }

View File

@ -59,8 +59,6 @@ const Users = {
<div dojoType="dijit.layout.TabContainer" style="height : 400px"> <div dojoType="dijit.layout.TabContainer" style="height : 400px">
<div dojoType="dijit.layout.ContentPane" title="${__('Edit user')}"> <div dojoType="dijit.layout.ContentPane" title="${__('Edit user')}">
<header>${__("User")}</header>
<section> <section>
<fieldset> <fieldset>
<label>${__("Login:")}</label> <label>${__("Login:")}</label>
@ -71,11 +69,9 @@ const Users = {
${admin_disabled ? App.FormFields.hidden_tag("login", user.login) : ''} ${admin_disabled ? App.FormFields.hidden_tag("login", user.login) : ''}
</fieldset> </fieldset>
</section>
<header>${__("Authentication")}</header> <hr/>
<section>
<fieldset> <fieldset>
<label>${__('Access level: ')}</label> <label>${__('Access level: ')}</label>
${App.FormFields.select_hash("access_level", ${App.FormFields.select_hash("access_level",
@ -89,11 +85,15 @@ const Users = {
<input dojoType='dijit.form.TextBox' type='password' size='20' <input dojoType='dijit.form.TextBox' type='password' size='20'
placeholder='${__("Change password")}' name='password'> placeholder='${__("Change password")}' name='password'>
</fieldset> </fieldset>
</section> <fieldset>
<label></label>
<label class="checkbox">
${App.FormFields.checkbox_tag("otp_enabled", user.otp_enabled)}
${__('OTP enabled')}
</fieldset>
<header>${__("Options")}</header> <hr/>
<section>
<fieldset> <fieldset>
<label>${__("E-mail:")}</label> <label>${__("E-mail:")}</label>
<input dojoType='dijit.form.TextBox' size='30' name='email' <input dojoType='dijit.form.TextBox' size='30' name='email'