From b942f8e66b79e700b88119ade5e17ffc56e4b98b Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 12 Apr 2024 12:46:13 +0200 Subject: [PATCH] #13344 fix hour time and date time tokens --- pandora_console/godmode/users/configure_token.php | 7 ++++--- pandora_console/godmode/users/token_list.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/users/configure_token.php b/pandora_console/godmode/users/configure_token.php index 3313a8dede..5817141144 100644 --- a/pandora_console/godmode/users/configure_token.php +++ b/pandora_console/godmode/users/configure_token.php @@ -132,7 +132,7 @@ $table->data[1][3] = html_print_input_text( 50, 255, true -); +).html_print_input_hidden('today_time', date('H:i:s'), true); echo '
'; @@ -205,8 +205,9 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript $('#button-next').on('click', function() { event.preventDefault(); var date = $('#text-date-expiration').val(); - if (date !== '') { - if (date < $('#hidden-today_date').val()) { + var time = date+' '+$('#text-time-expiration').val(); + if (date !== '' || time !== '') { + if (date < $('#hidden-today_date').val() || time < $('#hidden-today_date').val()+' '+$('#hidden-today_time').val()) { confirmDialog({ title: "", message: "", diff --git a/pandora_console/godmode/users/token_list.php b/pandora_console/godmode/users/token_list.php index 42a5d23b02..27d93076b9 100644 --- a/pandora_console/godmode/users/token_list.php +++ b/pandora_console/godmode/users/token_list.php @@ -78,9 +78,9 @@ if ($create_token === true || $update_token === true) { $expirationTime = get_parameter('time-expiration', null); $validity = null; - if (empty($expirationDate) === false && $expirationDate >= date('Y-m-d')) { + if (empty($expirationDate) === false) { $validity = $expirationDate; - if (empty($expirationTime) === false && $expirationTime > date('H:i:s')) { + if (empty($expirationTime) === false) { $validity .= ' '.$expirationTime; } else { $validity .= ' 23:59:59';