diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5751488bc2..185f940129 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2012-06-20 Miguel de Dios + + * extensions/net_tools.php: cleaned source code style. + + * extensions/module_groups.php, + operation/agentes/status_monitor.php: fixed the lost "module group" + "unasigned". + + Fixes: #3532075 + + MERGED FROM 4.0.2 + 2012-06-20 Sergio Martin * include/functions_modules.php diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 9ac927472f..8bb72d438b 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -25,8 +25,8 @@ if (is_ajax ()) { $get_info_alert_module_group = (bool)get_parameter('get_info_alert_module_group'); $module_group = (int)get_parameter('module_group'); $id_agent_group = (int)get_parameter('id_agent_group'); - - $data = false; + + $data = false; if ($get_info_alert_module_group) { $agents = agents_get_group_agents($id_agent_group); if (!empty($agents)) { @@ -67,15 +67,15 @@ if (is_ajax ()) { } } } - if(!$data){ + if (!$data) { echo 'These module/s have no alerts or alert/s are not fired'; } } - else{ + else { echo 'No available data'; } } - else{ + else { echo 'No available data'; } } @@ -93,11 +93,11 @@ if (is_ajax ()) { */ function mainModuleGroups() { global $config; //the useful global var of Pandora Console, it has many data can you use - + require_once ('include/functions_reporting.php'); require_once($config['homedir'] . "/include/functions_agents.php"); require_once($config['homedir'] . "/include/functions_users.php"); - + //The big query switch ($config["dbtype"]) { case "mysql": @@ -121,8 +121,8 @@ function mainModuleGroups() { FROM tagente_modulo WHERE id_module_group = %d AND disabled = 0 AND delete_pending = 0) GROUP BY estado"; - break; - case "oracle": + break; + case "oracle": $sql = "SELECT COUNT(id_agente) AS count, estado FROM tagente_estado WHERE utimestamp != 0 AND id_agente IN diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index 14d636fc36..523ac4cdc2 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -46,11 +46,11 @@ function main_net_tools () { echo ""; echo ""; echo ""; - - + + $operation = get_parameter ("operation",0); $community = get_parameter ("community","public"); - + switch($operation) { case 1: ob_start(); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 8c66d188ad..8b5146c9a0 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -48,7 +48,7 @@ $ag_modulename = (string) get_parameter ('ag_modulename'); $ag_group = (int) get_parameter ('ag_group', 0); $offset = (int) get_parameter ('offset'); $status = (int) get_parameter ('status', 4); -$modulegroup = (int) get_parameter ('modulegroup'); +$modulegroup = (int) get_parameter ('modulegroup', -1); $sql_extra = ''; $refr = get_parameter('refr', 0); // Sort functionality @@ -81,8 +81,10 @@ echo ''; echo ''.__('Module group').''; echo ''; -html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name", - 'modulegroup', $modulegroup, '',__('All'), 0, false, false, true, false, 'width: 100px;'); +$rows = db_get_all_rows_sql("SELECT * FROM tmodule_group ORDER BY name"); +$rows = io_safe_output($rows); +$rows[0] = __('Not assigned'); +html_print_select($rows, 'modulegroup', $modulegroup, '', __('All'), -1); echo ''.__('Module name').''; echo ''; @@ -92,7 +94,6 @@ $user_groups = implode (",", array_keys (users_get_groups ())); switch ($config["dbtype"]) { case "mysql": case "postgresql": - $profiles = db_get_all_rows_sql('SELECT id_grupo FROM tusuario_perfil AS t1 INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil @@ -164,8 +165,8 @@ switch ($config["dbtype"]) { FROM tagente WHERE'; - $sql .= $extra_sql.'('; - + $sql .= $extra_sql.'('; + if ($flag_is_admin || $flag_all_group) { $sql .= ' 1 = 1 '; } @@ -254,7 +255,7 @@ switch ($sortField) { $order = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC'); break; } - break; + break; case 'interval': switch ($sort) { case 'up': @@ -302,7 +303,7 @@ switch ($sortField) { $order = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC'); break; } - break; + break; default: $selectAgentNameUp = $selected; $selectAgentNameDown = ''; @@ -339,7 +340,7 @@ elseif($user_groups != '') { } // Module group -if ($modulegroup > 0) { +if ($modulegroup > -1) { $sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup); }