File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed
Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 281281 } else {
282282
283283 //* Do 2FA authentication
284- if ($ user ['otp_enabled ' ] != 'n ' ) {
284+ if (! empty ( $ user ['otp_type ' ]) && $ user [ ' otp_type ' ] != 'none ' ) {
285285
286286 //* Save session in pending state and destroy original session
287287 $ _SESSION ['s_pending ' ] = $ _SESSION ['s ' ];
Original file line number Diff line number Diff line change 119119 }
120120}
121121
122+ $ otp_method_list = array (
123+ 'none ' => 'none ' ,
124+ 'email ' => 'email ' ,
125+ );
122126//* Load themes
123127$ themes_list = array ();
124128$ handle = @opendir (ISPC_THEMES_PATH );
163167 'rows ' => '' ,
164168 'cols ' => ''
165169 ),
170+ 'otp_type ' => array (
171+ 'datatype ' => 'VARCHAR ' ,
172+ 'formtype ' => 'SELECT ' ,
173+ 'validators ' => array ( 0 => array ( 'type ' => 'NOTEMPTY ' ,
174+ 'errmsg ' => 'oth_auth_empty ' ),
175+ 1 => array ( 'type ' => 'REGEX ' ,
176+ 'regex ' => '/^[a-z0-9\_]{0,64}$/ ' ,
177+ 'errmsg ' => 'otp_auth_regex ' ),
178+ ),
179+ 'regex ' => '' ,
180+ 'errmsg ' => '' ,
181+ 'default ' => '' ,
182+ 'value ' => $ otp_method_list ,
183+ 'separator ' => '' ,
184+ 'width ' => '30 ' ,
185+ 'maxlength ' => '255 ' ,
186+ 'rows ' => '' ,
187+ 'cols ' => ''
188+ ),
166189 'language ' => array (
167190 'datatype ' => 'VARCHAR ' ,
168191 'formtype ' => 'SELECT ' ,
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ $wb['startmodule_empty'] = 'Startmodule empty.';
1616$wb['startmodule_regex'] = 'Invalid chars in Startmodule.';
1717$wb['app_theme_empty'] = 'App theme empty.';
1818$wb['app_theme_regex'] = 'Invalid chars in App theme.';
19+ $wb['otp_auth_txt'] = '2-Factor Authentication';
1920?>
Original file line number Diff line number Diff line change 2626 < div id ="confirmpasswordOK " style ="display:none; " class ="confirmpasswordok "> {tmpl_var name='password_match_txt'}</ div >
2727 </ div >
2828</ div >
29+ < div class ="form-group ">
30+ < label for ="2fa " class ="col-sm-3 control-label "> {tmpl_var name='otp_auth_txt'}</ label >
31+ < div class ="col-sm-9 ">
32+ < select name ="otp_type " id ="otp_type " class ="form-control ">
33+ {tmpl_var name='otp_type'}
34+ </ select >
35+ </ div >
36+ </ div >
2937< div class ="form-group ">
3038 < label for ="language " class ="col-sm-3 control-label "> {tmpl_var name='language_txt'}</ label >
3139 < div class ="col-sm-9 "> < select name ="language " id ="language " class ="form-control flags ">
You can’t perform that action at this time.
0 commit comments