diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 77d4eaf32e..620e0cf5d0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,44 @@ +2009-11-31 Sancho Lerena + + * include/functions_reporting.php: SLA readjust to be used in SLA view. + + * include/config_process.php, + * include/functions_config.php: Added support for custom_logo option. + + * include/help/en/help_agent_access.php, + include/help/en/help_custom_logo.php: New help topics. + + * include/functions_agents.php: Replaced audit_db with pandora_audit(). + + * include/functions_db.php: pandora_audit() will replace audit_db(). + + * operation/agentes/sla_view.php: now show render ok modules with min_critical + defined and uses to calculate automatically a SLA based on it's critical + definition. + + * operation/messages/message.php: Message view was not working!. Fixed + + * Some new images added: + images/people_2.png + images/MiniLogoArtica.jpg + images/pandora_header_logo_enterprise.png + images/custom_logo + images/custom_logo/sourceforge.png + images/custom_logo/artica_logo.png + images/custom_logo/pandora_logo_head.png + images/pandora_header_logo.png + images/people_1.png: + + * general/header.php: Changes to add new custom logo feature and replace + logos with a image instead text. + + * godmode/setup/setup_visuals.php: now is possible to choose a custom logo + to be displayed in header. + + *operation/agentes/ver_agente.php, + * godmode/agentes/configurar_agente.php: Tabs do not have text at sides. This + avoid problems in other languages different than english with long text strings. + 2009-11-30 Miguel de Dios * include/functions_agents.php: added new parameter for order the result of diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index c36468db15..f16af9752c 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -17,7 +17,8 @@ require_once ("include/functions_messages.php"); ?> - + "; ?> "; - echo " diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 6e7d671a3f..c1108e533b 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -192,40 +192,35 @@ if ($id_agente) { echo '"; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 2e12da3a17..ee0cc7d47d 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -80,7 +80,7 @@ $table->data[9][1] = print_select ($iconsets, 'status_images_set', $config["stat $table->data[10][0] = __('Font path'); $table->data[10][1] = print_input_text ('fontpath', $config["fontpath"], '', 50, 255, true); -$table->data[11][0] = __('Use agent access graph'); +$table->data[11][0] = __('Use agent access graph'). print_help_icon("agent_access", true); $table->data[11][1] = __('Yes').' '.print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).'  '; $table->data[11][1] .= __('No').' '.print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true); @@ -88,6 +88,9 @@ $table->data[12][0] = __('Flash charts'); $table->data[12][1] = __('Yes').' '.print_radio_button ('flash_charts', 1, '', $config["flash_charts"], true).'  '; $table->data[12][1] .= __('No').' '.print_radio_button ('flash_charts', 0, '', $config["flash_charts"], true); +$table->data[13][0] = __('Custom logo') . print_help_icon("custom_logo", true); +$table->data[13][1] = print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true); + echo ''; print_input_hidden ('update_config', 1); diff --git a/pandora_console/images/custom_logo/artica_logo.png b/pandora_console/images/custom_logo/artica_logo.png new file mode 100644 index 0000000000..35bd9c091d Binary files /dev/null and b/pandora_console/images/custom_logo/artica_logo.png differ diff --git a/pandora_console/images/custom_logo/pandora_logo_head.png b/pandora_console/images/custom_logo/pandora_logo_head.png new file mode 100755 index 0000000000..7429a27d15 Binary files /dev/null and b/pandora_console/images/custom_logo/pandora_logo_head.png differ diff --git a/pandora_console/images/custom_logo/sourceforge.png b/pandora_console/images/custom_logo/sourceforge.png new file mode 100644 index 0000000000..0bcfe45f55 Binary files /dev/null and b/pandora_console/images/custom_logo/sourceforge.png differ diff --git a/pandora_console/images/pandora_header_logo.png b/pandora_console/images/pandora_header_logo.png new file mode 100644 index 0000000000..9c6ac364b7 Binary files /dev/null and b/pandora_console/images/pandora_header_logo.png differ diff --git a/pandora_console/images/pandora_header_logo_enterprise.png b/pandora_console/images/pandora_header_logo_enterprise.png new file mode 100644 index 0000000000..22437f3018 Binary files /dev/null and b/pandora_console/images/pandora_header_logo_enterprise.png differ diff --git a/pandora_console/images/people_1.png b/pandora_console/images/people_1.png new file mode 100755 index 0000000000..dff7714bbc Binary files /dev/null and b/pandora_console/images/people_1.png differ diff --git a/pandora_console/images/people_2.png b/pandora_console/images/people_2.png new file mode 100755 index 0000000000..ff8971af41 Binary files /dev/null and b/pandora_console/images/people_2.png differ diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 27aa60555b..d26c3dee97 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -26,7 +26,7 @@ $build_version = 'PC091127'; $pandora_version = 'v3.0RC3-dev'; /* Help to debug problems. Override global PHP configuration */ -error_reporting(E_ERROR); +error_reporting(E_ALL); ini_set("display_errors", 0); ini_set("error_log", $config["homedir"]."/pandora_console.log"); @@ -57,6 +57,9 @@ process_config (); require_once ('streams.php'); require_once ('gettext.php'); +global $REMOTE_ADDR; + +$config["remote_addr"] = $_SERVER['REMOTE_ADDR']; // Set user language if provided, overriding System language if (isset ($config['id_user'])){ diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 9714af16df..d86ed9e009 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -91,8 +91,7 @@ function create_agent ($name, $id_group, $interval, $ip_address, $values = false process_sql_commit (); - audit_db ($config['id_user'], $REMOTE_ADDR, "Agent management", - "New agent '$name' created"); + pandora_audit ("Agent management", "New agent '$name' created"); return $id_agent; } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 61246c2389..33356c634a 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -161,6 +161,8 @@ function update_config () { update_config_value ('flash_charts', (bool) get_parameter ('flash_charts', $config["flash_charts"])); update_config_value ('attachment_store', (string) get_parameter ('attachment_store', $config["attachment_store"])); update_config_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']))); + + update_config_value ('custom_logo', (string) get_parameter ('custom_logo', $config["custom_logo"])); } /** @@ -303,6 +305,10 @@ function process_config () { update_config_value ( 'flash_charts', true); } + if (!isset ($config["custom_logo"])){ + update_config_value ('custom_logo', 'pandora_logo_head.png'); + } + /* Finally, check if any value was overwritten in a form */ update_config (); } diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index d2e6b54c4c..be9e2706f9 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -184,7 +184,7 @@ function safe_acl_group ($id_user, $id_groups, $access) { /** - * Adds an audit log entry. + * Adds an audit log entry (DEPRECATED!) * * @param string $id User id * @param string $ip Client IP @@ -198,6 +198,26 @@ function audit_db ($id, $ip, $accion, $descripcion){ process_sql ($sql); } + +/** + * Adds an audit log entry (new function in 3.0) + * + * @param string $accion Action description + * @param string $descripcion Long action description + */ +function pandora_audit ($accion, $descripcion){ + global $config; + $ip = $config["remote_addr"]; + $id = $config["id_user"]; + + $accion = safe_input($accion); + $descripcion = safe_input($descripcion); + $sql = sprintf ("INSERT INTO tsesion (ID_usuario, accion, fecha, IP_origen,descripcion, utimestamp) VALUES ('%s','%s',NOW(),'%s','%s',UNIX_TIMESTAMP(NOW()))",$id,$accion,$ip,$descripcion); + process_sql ($sql); +} + + + /** * Log in a user into Pandora. * diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 16b1fba838..e61c6222c4 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -44,7 +44,7 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max $date = get_system_time (); } - if (empty ($period)) { + if ((empty ($period)) OR ($period == 0)) { global $config; $period = $config["sla_period"]; } diff --git a/pandora_console/include/functions_themes.php b/pandora_console/include/functions_themes.php index 659577e322..323321b2ee 100644 --- a/pandora_console/include/functions_themes.php +++ b/pandora_console/include/functions_themes.php @@ -43,4 +43,6 @@ function get_css_themes () { return $retval; } + + ?> diff --git a/pandora_console/include/help/en/help_agent_access.php b/pandora_console/include/help/en/help_agent_access.php new file mode 100644 index 0000000000..e523322200 --- /dev/null +++ b/pandora_console/include/help/en/help_agent_access.php @@ -0,0 +1,9 @@ + +

Agent access

+ +Agent access graphs render access "contacts" per hour in a graph with a 24hr (daily) scale. This is used to know the contact frecuency of each agent. This could be useful to detect bottlenecks and agent break down. This could be time-consuming and if you're low on resources, this option could be deactivated in main application setup. + diff --git a/pandora_console/include/help/en/help_custom_logo.php b/pandora_console/include/help/en/help_custom_logo.php new file mode 100644 index 0000000000..192c5f473b --- /dev/null +++ b/pandora_console/include/help/en/help_custom_logo.php @@ -0,0 +1,11 @@ + +

Custom logo (Branding)

+ +This option is used to display your own logo in the Pandora FMS header. You can use any kind of graphic in PNG format. There is a fixed height/widthfor any image displayed here of 60x139 pixels. +

+Upload your custom branding logo, using the file manager to /images/custom_logo directory. + diff --git a/pandora_console/operation/agentes/sla_view.php b/pandora_console/operation/agentes/sla_view.php index f409afc3ae..20eb269a14 100644 --- a/pandora_console/operation/agentes/sla_view.php +++ b/pandora_console/operation/agentes/sla_view.php @@ -75,7 +75,13 @@ foreach ($modules as $module_id => $module) { $data = array (); $data[0] = print_moduletype_icon ($module["id_tipo_modulo"], true); $data[1] = print_string_substr ($module["nombre"], 25, true); - $data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], 1)).'%'; + if ($module["min_critical"] != 0){ + $sla_min = $module["min_critical"]; + $data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], $sla_min)); + $data[2] = 100 - $data[2]. "%"; + } else { + $data[2] = format_numeric (get_agentmodule_sla ($module_id, $config["sla_period"], 1)).'%'; + } //TODO: Make this work for all new status $status = get_agentmodule_status ($module_id); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 0e874c9f18..ef1589fea3 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -193,7 +193,7 @@ if (isset($_GET["flag_agent"])){ echo "'; // text + + $order = array("\r\n", "\n", "\r"); + $replace = '
'; + $parsed_message = str_replace($order, $replace, $message["message"]); + echo ' -
+ .png" class="bot" alt="user" /> [] @@ -91,14 +92,13 @@ require_once ("include/functions_messages.php"); echo ''; } echo ""; + echo ""; echo ""; - echo "
Pandora FMS
"; - if (file_exists (ENTERPRISE_DIR."/load_enterprise.php")) - echo '
Enterprise
'; - else - echo '
OpenSource
'; - echo "
"; + if (file_exists ($ENTERPRISE_DIR."/load_enterprise.php")){ + echo ""; + } else { + echo ""; + } ?>
'.$message["subject"].'
'.__('Message').':
'.$message["message"].'
'; + '.$parsed_message.''; //Prevent RE: RE: RE: if (strstr ($message["subject"], "RE:")) { @@ -125,7 +130,8 @@ if (isset ($_GET["new_msg"])) { //create message } else { $new_subj = "RE: ".$message["subject"]; } - + + //Start the message much like an e-mail reply $new_msg = "\n\n\nOn ".date ($config["date_format"], $message["timestamp"]).' '.get_user_fullname ($message["sender"]).' '.__('wrote').":\n\n".$message["message"];