diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0b2df2fd81..0c843be4fe 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,48 @@ +2009-03-03 Esteban Sanchez + + * general/main_menu.php: Operation and godmode menus files includes + now the dependant files. + + * godmode/agentes/modificar_agente.php: Removed unnecessary + require() + + * godmode/alerts/alert_list.php: Avoid notice for undefined index when + calling max(). Added option to delete the template. + + * godmode/alerts/configure_alert_template.php, + godmode/alerts/alert_templates.php: Fixed field2_recovery and + field3_recovery updating. + + * operation/menu.php, godmode/menu.php: Require functions_menu.php. + + * include/config_process.php: Updated build version. + + * include/functions.php: Keep time in a static variable on + get_system_time(). + + * include/functions_db.php: Now a custom operation can be passed to + format_array_to_where_clause_sql() if the field key is numeric. + + * include/functions_reporting.php: Return float value on + get_agentmodule_sla(). Added required files. + + * include/functions_ui.php: Show template name on format_alert_row(). + Style correction. + + * operation/agentes/export_csv.php: Style correction. + + * operation/events/export_csv.php: Use pandora functions to fetch + results. Fixed auth part. Style correction. + + * operation/reporting/custom_reporting.php: Fixed enterprise include. + + * operation/reporting/reporting_xml.php: Fixed auth part. + + * index.php: process_page_head() may looked for uninitialized + $config["refr"]. + + * include/styles/pandora_width.css: Fixed style for ol.steps + 2009-03-02 Evi Vanoost * include/functions_reporting.php: Rewrote get_agentmodule_sla with diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 5e7526ae9d..3b58fdb748 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -21,18 +21,11 @@ if (! isset ($config["id_user"])) { exit (); } -require_once ('include/functions_menu.php'); - echo '
:: '.__('Operation').' ::
'; -$menu = array (); require ("operation/menu.php"); -print_menu ($menu); echo '
:: '.__('Administration').' ::
'; -$menu = array (); require ("godmode/menu.php"); -print_menu ($menu); -unset ($menu); require ("links_menu.php"); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index aa1d5dc856..e12ee028c7 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -16,11 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - // Load global vars -require_once ("include/config.php"); - - check_login (); // Take some parameters (GET) diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 25ce70961e..5322c76e83 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -122,9 +122,9 @@ if ($create_alert) { foreach ($actions as $id_action) { $values = array (); if (isset ($fires_min[$id_action])) - $values['fires_min'] = max ($fires_min[$id_action], 0); + $values['fires_min'] = @max ($fires_min[$id_action], 0); if ($fires_max != -1) - $values['fires_max'] = max ($fires_max[$id_action], 0); + $values['fires_max'] = @max ($fires_max[$id_action], 0); add_alert_agent_module_action ($id, $id_action, $values); } } @@ -228,6 +228,7 @@ if (! $id_agente) { $table->head[2] = __('Module'); $table->head[3] = __('Template'); $table->head[4] = __('Actions'); +$table->head[5] = ''; $table->data = array (); foreach ($simple_alerts as $alert) { @@ -295,6 +296,12 @@ foreach ($simple_alerts as $alert) { $data[4] .= ' '.__('Add action'); $data[4] .= ''; + $data[5] = '
'; + + $data[5] .= print_input_image ('delete', 'images/cross.png', 1, '', true); + $data[5] .= print_input_hidden ('delete_alert', 1, true); + $data[5] .= print_input_hidden ('id_alert', $alert['id'], true); + $data[5] .= '
'; array_push ($table->data, $data); } @@ -442,6 +449,7 @@ $(document).ready (function () { return true; }); + $("a.add_action").click (function () { id = this.id.split ("-").pop (); @@ -452,7 +460,7 @@ $(document).ready (function () { return false; }); - $("form.delete_link").submit (function () { + $("form.delete_link, form.delete_alert_form").submit (function () { if (! confirm ("")) return false; return true; diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 12ae8ee3ee..64d3d1f536 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -110,8 +110,8 @@ if ($update_template) { $id = (int) get_parameter ('id'); $recovery_notify = (bool) get_parameter ('recovery_notify'); - $field2_recovery = (bool) get_parameter ('field2_recovery'); - $field3_recovery = (bool) get_parameter ('field3_recovery'); + $field2_recovery = (string) get_parameter ('field2_recovery'); + $field3_recovery = (string) get_parameter ('field3_recovery'); $result = update_alert_template ($id, array ('recovery_notify' => $recovery_notify, diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index ec9c7681f5..eecd9fdf07 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -89,7 +89,7 @@ function print_alert_template_steps ($step, $id) { } echo ''; - echo '
'; + echo '
'; } function update_template ($step) { @@ -171,9 +171,9 @@ function update_template ($step) { $result = update_alert_template ($id, $values); } elseif ($step == 3) { $recovery_notify = (bool) get_parameter ('recovery_notify'); - $field2_recovery = (bool) get_parameter ('field2_recovery'); - $field3_recovery = (bool) get_parameter ('field3_recovery'); - + $field2_recovery = (string) get_parameter ('field2_recovery'); + $field3_recovery = (string) get_parameter ('field3_recovery'); + print_r ($_POST); $result = update_alert_template ($id, array ('recovery_notify' => $recovery_notify, 'field2_recovery' => $field2_recovery, diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 4bb51b51bf..9a33459adc 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -16,7 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -enterprise_include ('godmode/menu.php'); +require_once ('include/config.php'); check_login (); @@ -24,6 +24,10 @@ if ((! give_acl ($config['id_user'], 0, "LM")) && (! give_acl ($config['id_user' return; } +enterprise_include ('godmode/menu.php'); +require_once ('include/functions_menu.php'); + +$menu = array (); $menu['class'] = 'godmode'; if (give_acl ($config['id_user'], 0, "AW")) { @@ -197,4 +201,6 @@ if (is_array ($config['extensions'])) { $menu["gextensions"]["sub"] = $sub; } + +print_menu ($menu); ?> diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index de6afeeeb1..ad92ae075a 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //Pandora Version -$build_version = 'PC090217'; +$build_version = 'PC090303'; $pandora_version = 'v2.1-dev'; $config['start_time'] = microtime (true); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 1c4c1cf974..6b18c327ef 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -169,7 +169,7 @@ function popup_help ($help_id, $return = false) { * (use general/noaccess.php followed by exit instead) */ function no_permission () { - require("config.php"); + require ("config.php"); echo "

".__('You don\'t have access')."

"; echo "No access

"; echo ""; @@ -352,6 +352,10 @@ function human_time_comparation ($timestamp) { */ function get_system_time () { global $config; + static $time = 0; + + if ($time != 0) + return $time; if ($config["timesource"] = "sql") { $time = get_db_sql ("SELECT UNIX_TIMESTAMP()"); diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index c59aa3520e..909e43507b 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1984,9 +1984,16 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal $i = 1; $max = count ($values); foreach ($values as $field => $value) { - if (is_numeric ($field)) - /* Avoid numeric field names */ + if (is_numeric ($field)) { + /* User provide the exact operation to do */ + $query .= $value; + + if ($i < $max) { + $query .= ' '.$join.' '; + } + $i++; continue; + } if ($field[0] != "`") { $field = "`".$field."`"; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 7978e634f3..37ab59ab95 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -17,6 +17,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +require_once ($config["homedir"]."/include/functions.php"); +require_once ($config["homedir"]."/include/functions_db.php"); require_once ($config["homedir"]."/include/functions_agents.php"); /** @@ -29,7 +31,7 @@ require_once ($config["homedir"]."/include/functions_agents.php"); * ignore max value * @param int Beginning date of the report in UNIX time (current date by default). * - * @return int SLA percentage of the requested module. + * @return float SLA percentage of the requested module. */ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max_value = false, $date = 0) { if (empty ($date)) { @@ -40,19 +42,28 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max global $config; $period = $config["sla_period"]; } - + $datelimit = $date - $period; // start date /* Get the total data entries in the interval */ - $sql = sprintf ('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d', $id_agentmodule, $datelimit, $date); + $sql = sprintf ('SELECT COUNT(*) + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d + AND utimestamp <= %d', $id_agentmodule, $datelimit, $date); $total = get_db_sql ($sql); if (empty ($total)) { //No data to calculate on so we return 100 (fail to good) - return 100; - } + return 100.0; + } - $sql = sprintf ('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d AND datos < %d', $id_agentmodule, $datelimit, $date, $min_value); + $sql = sprintf ('SELECT COUNT(*) + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d + AND utimestamp <= %d + AND datos < %d', $id_agentmodule, $datelimit, $date, $min_value); if ($max_value > $min_value) { $sql .= sprintf (' AND datos > %d', $max_value); } @@ -64,7 +75,7 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max //Calculate percentage $result = 100 - ($bad / $total) * 100; - return $result; + return (float) $result; } /** diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 00445a347b..885b7021f9 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -244,7 +244,7 @@ function format_alert_row ($alert, $compound = false, $agent = true, $url = '') } else { $id_agent = get_agentmodule_agent ($alert['id_agent_module']); $template = get_alert_template ($alert['id_alert_template']); - $description = $template['description']; + $description = $template['name']; } $data = array (); @@ -640,7 +640,9 @@ function process_page_head ($string, $bitfield) { } //Pandora specific jquery should go first - $config['jquery'] = array_merge (array ("jquery" => "include/javascript/jquery.js", "pandora" => "include/javascript/jquery.pandora.js"), $config['jquery']); + $config['jquery'] = array_merge (array ("jquery" => "include/javascript/jquery.js", + "pandora" => "include/javascript/jquery.pandora.js"), + $config['jquery']); //Then add each script as necessary diff --git a/pandora_console/include/styles/pandora_width.css b/pandora_console/include/styles/pandora_width.css index de35b674fb..e1e3709205 100644 --- a/pandora_console/include/styles/pandora_width.css +++ b/pandora_console/include/styles/pandora_width.css @@ -51,3 +51,6 @@ div#head { div#foot { width: auto; } +ol.steps { + margin-bottom: 70px; +} diff --git a/pandora_console/index.php b/pandora_console/index.php index 38e9c88512..2883148a63 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -97,18 +97,18 @@ if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) { exit; //Always exit after sending location headers } - -echo ''."\n"; -echo ''."\n"; -echo ''; - //This starts the page head. In the call back function, things from $page['head'] array will be processed into the head -ob_start ('process_page_head'); // Pure mode (without menu, header and footer). $config["pure"] = (bool) get_parameter ("pure"); // Auto Refresh page (can now be disabled anywhere in the script) $config["refr"] = (int) get_parameter ("refr"); +echo ''."\n"; +echo ''."\n"; +echo ''; +//This starts the page head. In the call back function, things from $page['head'] array will be processed into the head +ob_start ('process_page_head'); + enterprise_include ('index.php'); //This tag is included in the buffer passed to process_page_head so technically it can be stripped diff --git a/pandora_console/operation/agentes/export_csv.php b/pandora_console/operation/agentes/export_csv.php index bf7d9cb835..339c0f7c01 100644 --- a/pandora_console/operation/agentes/export_csv.php +++ b/pandora_console/operation/agentes/export_csv.php @@ -16,7 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -session_start(); +session_start (); require_once ("../../include/config.php"); require_once ("../../include/functions.php"); diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index acf2756e77..bc8ef13502 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -16,80 +16,85 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - session_start(); -include ("../../include/config.php"); -include ("../../include/functions.php"); -include_once ("../../include/functions_db.php"); +require_once ("../../include/config.php"); +if (!isset ($config["auth"])) { + require_once ("../../include/auth/mysql.php"); +} else { + require_once ("../../include/auth/".$config["auth"]["scheme"].".php"); +} +require_once ("../../include/functions.php"); +require_once ("../../include/functions_db.php"); +require_once ("../../include/functions_events.php"); -session_write_close(); +session_write_close (); $config["id_user"] = $_SESSION["id_usuario"]; -if ( (give_acl($config["id_user"], 0, "AR")==0) AND (give_acl($config["id_user"], 0, "AW")==0) ){ - require ("../../general/noaccess.php"); +if (! give_acl ($config["id_user"], 0, "AR") && ! give_acl ($config["id_user"], 0, "AW")) { exit; } +$offset = (int) get_parameter ("offset"); +$ev_group = (int) get_parameter ("ev_group"); // group +$search = (int) get_parameter ("search"); // free search +$event_type = (string) get_parameter ("event_type", "all"); // 0 all +$severity = (int) get_parameter ("severity", -1); // -1 all +$status = (int) get_parameter ("status", -1); // -1 all, 0 only red, 1 only green +$id_agent = (int) get_parameter ("id_agent", -1); -$offset = get_parameter ( "offset",0); -$ev_group = get_parameter ("ev_group", 0); // group -$search = get_parameter ("search", ""); // free search -$event_type = get_parameter ("event_type", "all"); // 0 all -$severity = get_parameter ("severity", -1); // -1 all -$status = get_parameter ("status", -1); // -1 all, 0 only red, 1 only green -$id_agent = get_parameter ("id_agent", -1); - -$sql_post = ""; +$filter = array (); if ($ev_group > 1) - $sql_post .= " AND id_grupo = $ev_group"; + $filter['id_grupo'] = $ev_group; if ($status == 1) - $sql_post .= " AND estado = 1"; + $filter['estado'] = 1; if ($status == 0) - $sql_post .= " AND estado = 0"; + $filter['estado'] = 0; if ($search != "") - $sql_post .= " AND evento LIKE '%$search%'"; + $filter[] = 'evento LIKE "%'.$search.'%"'; if (($event_type != "all") AND ($event_type != 0)) - $sql_post .= " AND event_type = '$event_type'"; + $filter['event_type'] = $event_type; if ($severity != -1) - $sql_post .= " AND criticity >= $severity"; + $filter[] = 'criticity >= '.$severity; if ($id_agent != -1) - $sql_post .= " AND id_agente = $id_agent"; + $filter['id_agente'] = $id_agent; -$sql2 = "SELECT * FROM tevento WHERE 1=1 "; -$sql2 .= $sql_post . " ORDER BY timestamp DESC"; -$now = date("Y-m-d"); +$filter['order'] = 'timestamp DESC'; +$now = date ("Y-m-d"); // Show contentype header -Header("Content-type: text/txt"); -header('Content-Disposition: attachment; filename="pandora_export_event'.$now.'.txt"'); +Header ("Content-type: text/txt"); +header ('Content-Disposition: attachment; filename="pandora_export_event'.$now.'.txt"'); echo "timestamp, agent, group, event, status, user, event_type, severity"; -echo chr(13); +echo chr (13); -$result=mysql_query($sql2); -while ($row=mysql_fetch_array($result)){ - $id_grupo = $row["id_grupo"]; - if (give_acl($config["id_user"], $id_grupo, "AR") == 1){ // Only incident read access to view data ! - echo $row["timestamp"]; - echo ", "; - echo get_db_sql("SELECT nombre FROM tagente WHERE id_agente = '".$row["id_agente"]."'"); - echo ", "; - echo get_db_sql("SELECT nombre FROM tgrupo WHERE id_grupo = '".$row["id_grupo"]."'"); - echo ", "; - echo $row["evento"]; - echo ", "; - echo $row["estado"]; - echo ", "; - echo $row["id_usuario"]; - echo ", "; - echo $row["event_type"]; - echo ", "; - echo $row["criticity"]; - echo chr(13); - } +$fields = array ('id_grupo', 'id_agente', 'evento', 'estado', 'id_usuario', + 'event_type', 'criticity', 'timestamp'); +$events = get_events ($filter, $fields); +if ($events === false) + $events = array (); +foreach ($events as $event) { + if (! give_acl ($config["id_user"], $event["id_grupo"], "AR")) + continue; + + echo $event["timestamp"]; + echo ","; + echo get_db_value ('nombre', 'tagente', 'id_agente', $event["id_agente"]); + echo ","; + echo get_db_value ('nombre', 'tgrupo', 'id_grupo', $event["id_grupo"]); + echo ","; + echo $event["evento"]; + echo ","; + echo $event["estado"]; + echo ","; + echo $event["id_usuario"]; + echo ","; + echo $event["event_type"]; + echo ","; + echo $event["criticity"]; + echo chr (13); } ?> diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 9939149ae9..e5773b2ff7 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -20,8 +20,11 @@ if (! isset ($config['id_user'])) { return; } +require_once ('include/functions_menu.php'); + enterprise_include ('operation/menu.php'); +$menu = array (); $menu['class'] = 'operation'; // Agent read, Server read @@ -197,4 +200,6 @@ if (give_acl ($config['id_user'], 0, "AR")) { $menu["extensions"]["sub"] = $sub; } } + +print_menu ($menu); ?> diff --git a/pandora_console/operation/reporting/custom_reporting.php b/pandora_console/operation/reporting/custom_reporting.php index 3991119cd8..8bae3dd539 100644 --- a/pandora_console/operation/reporting/custom_reporting.php +++ b/pandora_console/operation/reporting/custom_reporting.php @@ -16,17 +16,11 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - // Login check -require ("include/config.php"); - check_login (); // Load enterprise extensions -if (file_exists( $config["homedir"] . "/enterprise/operation/reporting/custom_reporting.php")) { - include $config["homedir"] . "/enterprise/operation/reporting/custom_reporting.php"; -} - +enterprise_include ('operation/reporting/custom_reporting.php'); echo "

".__('Reporting')." > "; echo __('Custom reporting')."

"; diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index ec3220a322..5f09b5c6cf 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -512,7 +512,6 @@ foreach ($contents as $content) { break; } - print_table ($table); flush (); } diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index 68181febd5..634ad46f19 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Login check -if (isset ($_GET["direct"])) { +if (isset ($_GET["direct"])) { /* This is in case somebody wants to access the XML directly without having the possibility to login and handle sessions @@ -27,10 +27,9 @@ if (isset ($_GET["direct"])) { Although it's not recommended, you can put your login and password in a GET request (append &nick=&password=). - You SHOULD put it in a POST but some programs - might not be able to handle it without extensive re-programming - (M$ ShitPoint). Either way, you should have a read-only user for getting reports + might not be able to handle it without extensive re-programming. + Either way, you should have a read-only user for getting reports XMLHttpRequest can do it (example): @@ -56,9 +55,9 @@ if (isset ($_GET["direct"])) { require_once ("../../include/functions_reporting.php"); if (!isset ($config["auth"])) { - require_once ("include/auth/mysql.php"); + require_once ("../../include/auth/mysql.php"); } else { - require_once ("include/auth/".$config["auth"]["scheme"].".php"); + require_once ("../../include/auth/".$config["auth"]["scheme"].".php"); } $nick = get_parameter ("nick"); @@ -77,12 +76,12 @@ if (isset ($_GET["direct"])) { } else { // User not known $login_failed = true; - require_once ('general/login_page.php'); + require_once ($config['homedir'].'/general/login_page.php'); audit_db ($nick, $REMOTE_ADDR, "Logon Failed", "Invalid login: ".$nick); exit; } } else { - require_once ("include/config.php"); + @require_once ("include/config.php"); require_once ("include/functions_reporting.php"); if (!isset ($config["auth"])) { @@ -92,7 +91,7 @@ if (isset ($_GET["direct"])) { } } -check_login(); +check_login (); $id_report = (int) get_parameter ('id'); @@ -100,7 +99,7 @@ if (! $id_report) { audit_db ($config['id_user'], $REMOTE_ADDR, "HACK Attempt", "Trying to access graph viewer without valid ID"); require ("general/noaccess.php"); - exit; + return; } $report = get_db_row ('treport', 'id_report', $id_report); @@ -108,7 +107,7 @@ $report = get_db_row ('treport', 'id_report', $id_report); if (! give_acl ($config['id_user'], $report['id_group'], "AR")) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation","Trying to access graph reader"); include ("general/noaccess.php"); - exit; + return; } /* Check if the user can see the graph */ @@ -161,7 +160,7 @@ foreach ($contents as $content) { switch ($content["type"]) { case 1: - case 'simple_graph': + case 'simple_graph': $data["title"] = __('Simple graph'); $data["objdata"]["img"] = 'reporting/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=720&period='.$content['period'].'&date='.$datetime.'&avg_only=1&pure=1'; break; @@ -188,7 +187,7 @@ foreach ($contents as $content) { case 'SLA': $data["title"] = __('S.L.A.'); - $slas = get_db_all_rows_field_filter ('treport_content_sla_combined','id_report_content', $content['id_rc']); + $slas = get_db_all_rows_field_filter ('treport_content_sla_combined', 'id_report_content', $content['id_rc']); if ($slas === false) { $data["objdata"]["error"] = __('There are no SLAs defined'); $slas = array (); @@ -217,7 +216,7 @@ foreach ($contents as $content) { break; case 4: - case 'event_report': + case 'event_report': $data["title"] = __("Event report"); $table_report = event_reporting ($report['id_group'], $content['period'], $datetime, true); $data["objdata"] = " $value) { if (is_int ($name)) {