Removed ip from connected user list

This commit is contained in:
Luis Calvo 2020-12-23 14:33:20 +01:00
parent bc74565662
commit 69c33b45fa
1 changed files with 2 additions and 34 deletions

View File

@ -75,44 +75,13 @@ function users_extension_main_god($god=true)
$table->head = []; $table->head = [];
$table->head[0] = __('User'); $table->head[0] = __('User');
$table->head[1] = __('IP'); $table->head[1] = __('Date');
$table->head[2] = __('Date');
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
// Get data // Get data
foreach ($rows as $row) { foreach ($rows as $row) {
// Get ip_origin of the last login of the user
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
$ip_origin = db_get_value_sql(
sprintf(
"SELECT ip_origen
FROM tsesion
WHERE id_usuario = '%s'
AND descripcion = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
case 'oracle':
$ip_origin = db_get_value_sql(
sprintf(
"SELECT ip_origen
FROM tsesion
WHERE id_usuario = '%s'
AND to_char(descripcion) = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
}
if ($rowPair) { if ($rowPair) {
$table->rowclass[$iterator] = 'rowPair'; $table->rowclass[$iterator] = 'rowPair';
} else { } else {
@ -124,8 +93,7 @@ function users_extension_main_god($god=true)
$data = []; $data = [];
$data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>'; $data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>';
$data[1] = $ip_origin; $data[1] = date($config['date_format'], $row['last_connect']);
$data[2] = date($config['date_format'], $row['last_connect']);
array_push($table->data, $data); array_push($table->data, $data);
} }