From 7a74ae4d206bb4c63cef139b381e6c64421bf045 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 15 Dec 2020 17:40:15 +0100 Subject: [PATCH] changes in connected users view --- .../extensions/users_connected.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php index e26b0dab1e..22b030f602 100644 --- a/pandora_console/extensions/users_connected.php +++ b/pandora_console/extensions/users_connected.php @@ -76,20 +76,21 @@ function users_extension_main_god($god=true) $table->head[0] = __('User'); $table->head[1] = __('IP'); - $table->head[2] = __('Date'); + $table->head[2] = __('Last login'); + $table->head[3] = __('Last contact'); $rowPair = true; $iterator = 0; // Get data foreach ($rows as $row) { - // Get ip_origin of the last login of the user + // Get data of user's last login. switch ($config['dbtype']) { case 'mysql': case 'postgresql': - $ip_origin = db_get_value_sql( + $last_login_data = db_get_row_sql( sprintf( - "SELECT ip_origen + "SELECT ip_origen, utimestamp FROM tsesion WHERE id_usuario = '%s' AND descripcion = '".io_safe_input('Logged in')."' @@ -100,9 +101,9 @@ function users_extension_main_god($god=true) break; case 'oracle': - $ip_origin = db_get_value_sql( + $last_login_data = db_get_row_sql( sprintf( - "SELECT ip_origen + "SELECT ip_origen, utimestamp FROM tsesion WHERE id_usuario = '%s' AND to_char(descripcion) = '".io_safe_input('Logged in')."' @@ -124,8 +125,9 @@ function users_extension_main_god($god=true) $data = []; $data[0] = ''.$row['id_user'].''; - $data[1] = $ip_origin; - $data[2] = date($config['date_format'], $row['last_connect']); + $data[1] = $last_login_data['ip_origin']; + $data[2] = date($config['date_format'], $last_login_data['utimestamp']); + $data[3] = date($config['date_format'], $row['last_connect']); array_push($table->data, $data); } @@ -134,7 +136,6 @@ function users_extension_main_god($god=true) } -extensions_add_godmode_menu_option(__('Users connected'), 'UM', 'gusuarios', 'users/icon.png', 'v1r1'); extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM'); extensions_add_godmode_function('users_extension_main_god');