(UNIX_TIMESTAMP(NOW()) - 3600) GROUP BY id_usuario, ip_origen, accion"; break; case "postgresql": $sql = "SELECT id_usuario, ip_origen, fecha, accion FROM tsesion WHERE descripcion = '" . io_safe_input('Logged in') . "' AND utimestamp > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - 3600) GROUP BY id_usuario, ip_origen, accion"; break; case "oracle": $sql = "SELECT id_usuario, ip_origen, fecha, accion FROM tsesion WHERE to_char(descripcion) = '" . io_safe_input('Logged in') . "' AND utimestamp > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) - 3600) GROUP BY id_usuario, ip_origen,fecha, accion"; break; } $rows = db_get_all_rows_sql ($sql); if (empty ($rows)) { $rows = array (); echo "
".__('No other users connected')."
"; } else { $table->cellpadding = 4; $table->cellspacing = 4; $table->width = '98%'; $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); } html_print_table ($table); } } extensions_add_godmode_menu_option (__('Users connected'), 'UM','gusuarios',"users/icon.png"); if (isset($config["id_user"])) { if (check_acl ($config["id_user"], 0, "UM")) { extensions_add_operation_menu_option(__('Users connected'), 'usuarios',"users/icon.png"); } } extensions_add_godmode_function('users_extension_main_god'); extensions_add_main_function('users_extension_main'); ?>