Merge branch 'ent-10529-token-session_timeout-se-desborda-con-valor-9999999999' into 'develop'
Ent 10529 token session timeout se desborda con valor 9999999999 See merge request artica/pandorafms!6425
This commit is contained in:
commit
793b6502ab
|
@ -535,16 +535,47 @@ html_print_action_buttons(
|
|||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
[
|
||||
'icon' => 'update',
|
||||
'onclick' => 'onFormSubmit()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
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">
|
||||
|
||||
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() {
|
||||
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
||||
$('#table1-2FA_all_users').removeClass('invisible');
|
||||
|
|
Loading…
Reference in New Issue