mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-24 10:30:05 +02:00
feature 2FA_all_users
This commit is contained in:
parent
f8666adf0f
commit
e5fe9d5c29
@ -227,8 +227,7 @@ if (is_ajax()) {
|
|||||||
$row = [];
|
$row = [];
|
||||||
$row['name'] = __('Force 2FA for all users is enabled');
|
$row['name'] = __('Force 2FA for all users is enabled');
|
||||||
$row['control'] .= html_print_checkbox_switch(
|
$row['control'] .= html_print_checkbox_switch(
|
||||||
'
|
'2FA_all_users',
|
||||||
',
|
|
||||||
1,
|
1,
|
||||||
$config['2FA_all_users'],
|
$config['2FA_all_users'],
|
||||||
true
|
true
|
||||||
@ -333,13 +332,9 @@ echo '</form>';
|
|||||||
$('input[type=checkbox][name=double_auth_enabled]').change(function () {
|
$('input[type=checkbox][name=double_auth_enabled]').change(function () {
|
||||||
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
||||||
$('#table1-2FA_all_users').show();
|
$('#table1-2FA_all_users').show();
|
||||||
$('#table3-2FA_all_users').show();
|
|
||||||
$('#table5-2FA_all_users').show();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#table1-2FA_all_users').hide();
|
$('#table1-2FA_all_users').hide();
|
||||||
$('#table3-2FA_all_users').hide();
|
|
||||||
$('#table5-2FA_all_users').hide();
|
|
||||||
}
|
}
|
||||||
}).change();
|
}).change();
|
||||||
});
|
});
|
||||||
|
@ -395,7 +395,12 @@ $double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user',
|
|||||||
|
|
||||||
if ($config['double_auth_enabled']) {
|
if ($config['double_auth_enabled']) {
|
||||||
$double_authentication = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Double authentication').'</p>';
|
$double_authentication = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Double authentication').'</p>';
|
||||||
$double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true);
|
if ($config['double_auth_enabled']) {
|
||||||
|
$double_authentication .= html_print_checkbox_switch('double_auth', 1, 1, true);
|
||||||
|
} else {
|
||||||
|
$double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Dialog.
|
// Dialog.
|
||||||
$double_authentication .= '<div id="dialog-double_auth" style="display:none"><div id="dialog-double_auth-container"></div></div>';
|
$double_authentication .= '<div id="dialog-double_auth" style="display:none"><div id="dialog-double_auth-container"></div></div>';
|
||||||
}
|
}
|
||||||
@ -878,18 +883,20 @@ $(document).ready (function () {
|
|||||||
$("#text-block_size").removeAttr('disabled');
|
$("#text-block_size").removeAttr('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var fa_enable = <?php echo $config['2FA_all_users']; ?>
|
||||||
|
|
||||||
$("input#checkbox-double_auth").change(function (e) {
|
$("input#checkbox-double_auth").change(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if(fa_enable != 1){
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
show_double_auth_activation();
|
show_double_auth_activation();
|
||||||
}
|
} else {
|
||||||
else {
|
show_double_auth_deactivation();
|
||||||
show_double_auth_deactivation();
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
show_data_section();
|
show_data_section();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user