Skip to content
Snippets Groups Projects
Unverified Commit 8af6fa61 authored by Helmo's avatar Helmo
Browse files

Add 2FA form element to CP Users form

parent 2f2b15c0
No related branches found
No related tags found
1 merge request!1575Resolve "Two-factor authentication"
......@@ -94,6 +94,11 @@ while ($file = @readdir($handle)) {
}
}
$otp_method_list = array(
'none' => 'none',
'email' => 'email',
);
//* Load themes
$themes_list = array();
$handle = @opendir(ISPC_THEMES_PATH);
......@@ -254,6 +259,25 @@ $form['tabs']['users'] = array (
'rows' => '',
'cols' => ''
),
'otp_type' => array(
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'otp_auth_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[a-z0-9\_]{0,64}$/',
'errmsg'=> 'otp_auth_regex'),
),
'regex' => '',
'errmsg' => '',
'default' => '',
'value' => $otp_method_list,
'separator' => '',
'width' => '30',
'maxlength' => '255',
'rows' => '',
'cols' => ''
),
'language' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
......
......@@ -38,4 +38,5 @@ $wb['startmodule_empty'] = 'Startmodule empty.';
$wb['startmodule_regex'] = 'Invalid chars in Startmodule.';
$wb['app_theme_empty'] = 'App theme empty.';
$wb['app_theme_regex'] = 'Invalid chars in App theme.';
$wb['otp_auth_txt'] = '2-Factor Authentication';
?>
......@@ -28,6 +28,15 @@
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
</div>
</div>
<div class="form-group">
<label for="2fa" class="col-sm-3 control-label">{tmpl_var name='otp_auth_txt'}</label>
<div class="col-sm-9">
<select name="otp_type" id="otp_type" class="form-control">
{tmpl_var name='otp_type'}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='modules_txt'}</label>
<div class="col-sm-9">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment