#10529 Fix token session timeout
This commit is contained in:
parent
90d4bbf1be
commit
4b5dcff3cc
|
@ -535,16 +535,47 @@ html_print_action_buttons(
|
||||||
__('Update'),
|
__('Update'),
|
||||||
'update_button',
|
'update_button',
|
||||||
false,
|
false,
|
||||||
[ 'icon' => 'update' ],
|
[
|
||||||
|
'icon' => 'update',
|
||||||
|
'onclick' => 'onFormSubmit()',
|
||||||
|
],
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
echo ui_print_warning_message(
|
||||||
|
[
|
||||||
|
'message' => __('Session timeout must be a number'),
|
||||||
|
'force_class' => 'invisible js_warning_msg',
|
||||||
|
],
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function onFormSubmit() {
|
||||||
|
const isNumber = n => $.isNumeric(n);
|
||||||
|
|
||||||
|
let session_timeout = $('#text-session_timeout').val()
|
||||||
|
if(isNumber(session_timeout)) {
|
||||||
|
if (session_timeout < 0) {
|
||||||
|
|
||||||
|
session_timeout = -1;
|
||||||
|
}
|
||||||
|
if (session_timeout > 604800) {
|
||||||
|
session_timeout = 604800;
|
||||||
|
}
|
||||||
|
$('#text-session_timeout').val(session_timeout);
|
||||||
|
} else {
|
||||||
|
$('.js_warning_msg').removeClass('invisible');
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function showAndHide() {
|
function showAndHide() {
|
||||||
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').removeClass('invisible');
|
$('#table1-2FA_all_users').removeClass('invisible');
|
||||||
|
|
Loading…
Reference in New Issue