diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 51acb845d8..83766f8b75 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2009-01-29 Esteban Sanchez + + * include/auth/mysql.php: Style correction on switch statements. + + * include/functions_ui.php: Added a flag to + print_alert_template_example() to allow values replacement. + + * include/functions_reporting.php: Fixed a notice message for + unitialized values. + + * operation/events/events.php: get_users() result can not be passed + directly to print_select(). + + * pandoradb_migrate_20_to_21.sql: Style correction. Please, put each + alter table in a row so it can be easier to read. + 2009-01-28 Sancho Lerena * estado_grupo.php: Async modules and keepalive module don't show as down @@ -16,6 +32,7 @@ include/languages/pt_BR.mo, include/languages/es.mo: Updated translations. +>>>>>>> .r1409 2009-01-28 Esteban Sanchez * godmode/alerts/configure_alert_template.php: Removed a javascript diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 50d986f19c..db7fa6d6ce 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -126,13 +126,13 @@ function get_user_info ($id_user) { */ function get_users ($order = "fullname") { switch ($order) { - case "id_user": - case "registered": - case "last_connect": - case "fullname": - break; - default: - $order = "fullname"; + case "id_user": + case "registered": + case "last_connect": + case "fullname": + break; + default: + $order = "fullname"; } $output = array(); @@ -170,18 +170,17 @@ function create_user ($id_user, $password, $user_info) { foreach ($user_info as $key => $value) { switch ($key) { - case "fullname": - case "firstname": - case "lastname": - case "middlename": - case "comments": - case "email": - case "phone": - $values[$key] = $value; - break; - default: - continue; //ignore + case "fullname": + case "firstname": + case "lastname": + case "middlename": + case "comments": + case "email": + case "phone": + $values[$key] = $value; break; + default: + continue; //ignore } } @@ -223,18 +222,18 @@ function process_user_info ($id_user, $user_info) { $values = array (); foreach ($user_info as $key => $value) { switch ($key) { - case "fullname": - case "firstname": - case "lastname": - case "middlename": - case "comments": - case "email": - case "phone": - $values[$key] = $value; - break; - default: - continue; //ignore - break; + case "fullname": + case "firstname": + case "lastname": + case "middlename": + case "comments": + case "email": + case "phone": + $values[$key] = $value; + break; + default: + continue; //ignore + break; } } return process_sql_update ("tusuario", $values, array ("id_user" => $id_user)); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a72b852c5c..b8595948ee 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -132,6 +132,8 @@ function get_group_stats ($id_group) { $data["total_checks"] = 0; $data["total_alerts"] = 0; $data["total_agents"] = 0; + $data["total_alerts"] = 0; + $data["total_checks"] = 0; $data["monitor_health"] = 100; $data["alert_level"] = 100; $data["module_sanity"] = 100; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index b648f5118d..d058349aca 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -315,10 +315,11 @@ function print_string_substr ($string, $cutoff = 16, $return = false) { * * @param int Alert template id. * @param bool Wheter to return or print it out. + * @param bool Wheter to put the values in the string or not. * * @return An HTML string if return was true. */ -function print_alert_template_example ($id_alert_template, $return = false) { +function print_alert_template_example ($id_alert_template, $return = false, $print_values = true) { $output = ''; $output .= ' '; @@ -362,12 +363,13 @@ function print_alert_template_example ($id_alert_template, $return = false) { break; } - /* Replace span elements with real values. This is done in such way to avoid - duplicating strings and make it easily modificable via Javascript. */ - $output = str_replace ('', $template['value'], $output); - $output = str_replace ('', $template['max_value'], $output); - $output = str_replace ('', $template['min_value'], $output); - + if ($print_values) { + /* Replace span elements with real values. This is done in such way to avoid + duplicating strings and make it easily modificable via Javascript. */ + $output = str_replace ('', $template['value'], $output); + $output = str_replace ('', $template['max_value'], $output); + $output = str_replace ('', $template['min_value'], $output); + } $output .= ''; if ($return) return $output; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 8d726dd2c5..00c5981bfa 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -198,7 +198,11 @@ echo ""; echo "".__('User ack.').""; echo ""; $users = get_users (); -print_select ($users, "id_user_ack", $id_user_ack, '', __('Any'), 0); +$values = array (); +foreach ($users as $id_user => $user) { + $values[$id_user] = $user['id_user']; +} +print_select ($values, "id_user_ack", $id_user_ack, '', __('Any'), 0); echo ""; diff --git a/pandora_console/pandoradb_migrate_20_to_21.sql b/pandora_console/pandoradb_migrate_20_to_21.sql index 189a85a74c..f8240f38c9 100644 --- a/pandora_console/pandoradb_migrate_20_to_21.sql +++ b/pandora_console/pandoradb_migrate_20_to_21.sql @@ -171,12 +171,14 @@ DEFAULT '0', ADD `min_critical` DOUBLE( 18, 2 ) NOT NULL DEFAULT `min_ff_event` INT( 4 ) UNSIGNED NOT NULL DEFAULT '0'; ALTER TABLE `tusuario` CHANGE `nombre_real` `fullname` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; - ALTER TABLE `tusuario` CHANGE `comentarios` `comments` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; - ALTER TABLE `tusuario` CHANGE `id_usuario` `id_user` VARCHAR( 60 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0'; ALTER TABLE `tusuario` CHANGE `fecha_registro` `last_connect` BIGINT( 20 ) NOT NULL DEFAULT '0'; ALTER TABLE `tusuario` ADD UNIQUE (`id_user`); ALTER TABLE `tusuario` ADD `registered` BIGINT( 20 ) NOT NULL DEFAULT '0' AFTER `last_connect` ; -ALTER TABLE `tusuario` ADD `firstname` VARCHAR( 255 ) NOT NULL AFTER `fullname` , ADD `lastname` VARCHAR( 255 ) NOT NULL AFTER `firstname` , ADD `middlename` VARCHAR( 255 ) NOT NULL AFTER `lastname`; -ALTER TABLE `tusuario` CHANGE `direccion` `email` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL , CHANGE `telefono` `phone` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL , CHANGE `nivel` `is_admin` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `tusuario` ADD `firstname` VARCHAR( 255 ) NOT NULL AFTER `fullname`; +ALTER TABLE `tusuario` ADD `lastname` VARCHAR( 255 ) NOT NULL AFTER `firstname`; +ALTER TABLE `tusuario` ADD `middlename` VARCHAR( 255 ) NOT NULL AFTER `lastname`; +ALTER TABLE `tusuario` CHANGE `direccion` `email` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL; +ALTER TABLE `tusuario` CHANGE `telefono` `phone` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL; +ALTER TABLE `tusuario` CHANGE `nivel` `is_admin` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';