mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 19:09:08 +02:00
F2 feature
This commit is contained in:
parent
1a2f14a35b
commit
f8666adf0f
@ -221,6 +221,20 @@ if (is_ajax()) {
|
|||||||
);
|
);
|
||||||
$table->data['double_auth_enabled'] = $row;
|
$table->data['double_auth_enabled'] = $row;
|
||||||
|
|
||||||
|
// Enable 2FA for all users.
|
||||||
|
// Set default value.
|
||||||
|
set_unless_defined($config['2FA_all_users'], false);
|
||||||
|
$row = [];
|
||||||
|
$row['name'] = __('Force 2FA for all users is enabled');
|
||||||
|
$row['control'] .= html_print_checkbox_switch(
|
||||||
|
'
|
||||||
|
',
|
||||||
|
1,
|
||||||
|
$config['2FA_all_users'],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$table->data['2FA_all_users'] = $row;
|
||||||
|
|
||||||
// Session timeout.
|
// Session timeout.
|
||||||
// Default session timeout.
|
// Default session timeout.
|
||||||
set_when_empty($config['session_timeout'], 90);
|
set_when_empty($config['session_timeout'], 90);
|
||||||
@ -313,6 +327,23 @@ echo '</form>';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
//For change autocreate remote users
|
||||||
|
$('input[type=checkbox][name=double_auth_enabled]').change(function () {
|
||||||
|
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
||||||
|
$('#table1-2FA_all_users').show();
|
||||||
|
$('#table3-2FA_all_users').show();
|
||||||
|
$('#table5-2FA_all_users').show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#table1-2FA_all_users').hide();
|
||||||
|
$('#table3-2FA_all_users').hide();
|
||||||
|
$('#table5-2FA_all_users').hide();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
});
|
||||||
|
|
||||||
$('#auth').on('change', function(){
|
$('#auth').on('change', function(){
|
||||||
type_auth = $('#auth').val();
|
type_auth = $('#auth').val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -717,6 +717,10 @@ function config_update_config()
|
|||||||
$error_update[] = __('Double authentication');
|
$error_update[] = __('Double authentication');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config_update_value('2FA_all_users', get_parameter('2FA_all_users'))) {
|
||||||
|
$error_update[] = __('2FA all users');
|
||||||
|
}
|
||||||
|
|
||||||
if (!config_update_value('session_timeout', get_parameter('session_timeout'))) {
|
if (!config_update_value('session_timeout', get_parameter('session_timeout'))) {
|
||||||
$error_update[] = __('Session timeout');
|
$error_update[] = __('Session timeout');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user