diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b036b455ca..907da01172 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-12-27 Raúl Mateos + + * extensions/users/menu.png: New file + + * extensions/users_connected.php: Added icon and changed menu section. + Added new godmode function that allows the user to be edited. + 2009-12-24 Raúl Mateos * images/pandora_logo.jpg: New file, used in dashboard (dashboard should diff --git a/pandora_console/extensions/users/icon.png b/pandora_console/extensions/users/icon.png new file mode 100755 index 0000000000..452e757d75 Binary files /dev/null and b/pandora_console/extensions/users/icon.png differ diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php index 74da350bda..608e8d6641 100644 --- a/pandora_console/extensions/users_connected.php +++ b/pandora_console/extensions/users_connected.php @@ -56,9 +56,54 @@ function users_extension_main () { print_table ($table); } +function users_extension_main_god () { + echo "

".__('Extensions'). " » ".__("Users connected"). "

"; -add_operation_menu_option(__('Users connected'), 'estado_server',""); + $sql = "SELECT id_usuario, ip_origen, fecha, accion FROM tsesion WHERE descripcion = 'Logged in' AND utimestamp > (UNIX_TIMESTAMP(NOW()) - 3600) GROUP BY id_usuario, ip_origen, accion"; + $rows = get_db_all_rows_sql ($sql); + if (empty ($rows)) { + $rows = array (); + } + + $table->cellpadding = 4; + $table->cellspacing = 4; + $table->width = 600; + $table->class = "databox"; + $table->size = array (); + $table->data = array (); + $table->head = array (); + + $table->head[0] = __('User'); + $table->head[1] = __('IP'); + $table->head[2] = __('Date'); + + $rowPair = true; + $iterator = 0; + + // Get data + foreach ($rows as $row) { + if ($rowPair) + $table->rowclass[$iterator] = 'rowPair'; + else + $table->rowclass[$iterator] = 'rowOdd'; + $rowPair = !$rowPair; + $iterator++; + + $data = array (); + $data[0] = ''.$row["id_usuario"].''; + $data[1] = $row["ip_origen"]; + $data[2] = $row["fecha"]; + array_push ($table->data, $data); + } + + print_table ($table); + +} +add_godmode_menu_option (__('Users connected'), 'UM','gusuarios',"users/icon.png"); +add_operation_menu_option(__('Users connected'), 'usuarios',"users/icon.png"); + +add_extension_godmode_function ('users_extension_main_god'); add_extension_main_function ('users_extension_main'); ?>