diff -Nru cacti-0.8.7e/about.php cacti-0.8.7g/about.php --- cacti-0.8.7e/about.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/about.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ + Login to cacti + +
- <?php print $graph_title;?> + <?php print htmlspecialchars($graph_title);?> - Graph Source/Properties - CSV Export
+ Graph Source/Properties + CSV Export
- +
@@ -229,9 +232,9 @@ break; case 'properties': ?> - + - Viewing Graph Properties '' + Viewing Graph Properties '' @@ -239,16 +242,16 @@
- <?php print $graph_title;?> + <?php print htmlspecialchars($graph_title);?> - Zoom Graph
- CSV Export
+ Zoom Graph
+ CSV Export
- +
diff -Nru cacti-0.8.7e/graph_settings.php cacti-0.8.7g/graph_settings.php --- cacti-0.8.7e/graph_settings.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graph_settings.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ \n"; - html_graph_start_box(1, false); - - print "
Graph Settings
"; + html_start_box("Graph Settings", "100%", $colors["header"], "3", "center", ""); while (list($tab_short_name, $tab_fields) = each($settings_graphs)) { ?> - + @@ -149,8 +147,7 @@ ); } - html_graph_end_box(); - + html_end_box(); ?> - - - "> - - -
- -
-
- - -
+ @@ -444,9 +476,9 @@ $hosts = db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname"); if (sizeof($hosts) > 0) { - foreach ($hosts as $item) { - print "\n"; - } + foreach ($hosts as $item) { + print "\n"; + } } ?> @@ -478,8 +510,8 @@
- () + () - *">Edit this Host
- *Create New Host + *">Edit this Host
+ *">Create New Host
@@ -490,11 +522,11 @@ Search:  - "> + "> -   - +   + @@ -509,6 +541,14 @@ $i = 0; + if ($changed) { + foreach($snmp_queries as $query) { + kill_session_var("sess_graphs_new_page" . $query["id"]); + unset($_REQUEST["page" . $query["id"]]); + load_current_session_value("page" . $query["id"], "sess_graphs_new_page" . $query["id"], "1"); + } + } + if ($_REQUEST["graph_type"] > 0) { load_current_session_value("page" . $_REQUEST["graph_type"], "sess_graphs_new_page" . $_REQUEST["graph_type"], "1"); }else if ($_REQUEST["graph_type"] == -2) { @@ -517,6 +557,8 @@ } } + $script = "\n"; - if (sizeof($template_graphs) > 0) { - print "\n"; + $script .= ")\n"; } /* create a row for each graph template associated with the host template */ @@ -565,8 +603,8 @@ print ""; $i++; - print " - Create: " . $graph_template["graph_template_name"] . " + print " + Create: " . htmlspecialchars($graph_template["graph_template_name"]) . " @@ -575,7 +613,7 @@ } } - print "\n"; + $script .= "gt_update_deps(1);\n"; $available_graph_templates = db_fetch_assoc("SELECT graph_templates.id, graph_templates.name @@ -605,8 +643,6 @@ ($_REQUEST["graph_type"] != -2 ? " AND snmp_query.id=" . $_REQUEST["graph_type"] : '') . " ORDER BY snmp_query.name"); - print "\n"; - if (sizeof($snmp_queries) > 0) { foreach ($snmp_queries as $snmp_query) { unset($total_rows); @@ -643,8 +679,6 @@ $snmp_query_graphs = db_fetch_assoc("SELECT snmp_query_graph.id,snmp_query_graph.name FROM snmp_query_graph WHERE snmp_query_graph.snmp_query_id=" . $snmp_query["id"] . " ORDER BY snmp_query_graph.name"); if (sizeof($snmp_query_graphs) > 0) { - print "\n"; } print " \n @@ -682,7 +714,7 @@ Data Query [" . $snmp_query["name"] . "]
- Reload Associated Query +
@@ -787,13 +819,13 @@ \n \n \n
- << "; if ($page > 1) { $nav .= ""; } $nav .= "Previous"; if ($page > 1) { $nav .= ""; } $nav .= " + << "; if ($page > 1) { $nav .= ""; } $nav .= "Previous"; if ($page > 1) { $nav .= ""; } $nav .= " Showing Rows " . (($row_limit*($page-1))+1) . " to " . ((($total_rows < $row_limit) || ($total_rows < ($row_limit*$page))) ? $total_rows : ($row_limit*$page)) . " of $total_rows [$url_page_select] - "; if (($page * $row_limit) < $total_rows) { $nav .= ""; } $nav .= "Next"; if (($page * $row_limit) < $total_rows) { $nav .= ""; } $nav .= " >> + "; if (($page * $row_limit) < $total_rows) { $nav .= ""; } $nav .= "Next"; if (($page * $row_limit) < $total_rows) { $nav .= ""; } $nav .= " >>
@@ -807,7 +839,7 @@ if ($field_array["direction"] == "input") { foreach($field_names as $row) { if ($row["field_name"] == $field_name) { - $html_dq_header .= "" . $field_array["name"] . "\n"; + $html_dq_header .= "" . $field_array["name"] . "\n"; break; } } @@ -816,7 +848,7 @@ if (!sizeof($snmp_query_indexes)) { print "This data query returned 0 rows, perhaps there was a problem executing this - data query. You can run this data + data query. You can run this data query in debug mode to get more information.\n"; }else{ print " @@ -875,16 +907,16 @@ $data_query_graphs = db_fetch_assoc("select snmp_query_graph.id,snmp_query_graph.name from snmp_query_graph where snmp_query_graph.snmp_query_id=" . $snmp_query["id"] . " order by snmp_query_graph.name"); if (sizeof($data_query_graphs) == 1) { - form_hidden_box("sgg_" . $snmp_query["id"] . "' id='sgg_" . $snmp_query["id"], $data_query_graphs[0]["id"], ""); + echo "\n"; }elseif (sizeof($data_query_graphs) > 1) { print " @@ -893,16 +925,27 @@ } print "
"; - print "\n"; + + $script .= "dq_update_deps(" . $snmp_query["id"] . "," . $num_visible_fields . ");\n"; } } } + if (strlen($script)) { + $script .= "\n"; + print $script; + } + form_hidden_box("save_component_graph", "1", ""); form_hidden_box("host_id", $host["id"], "0"); form_hidden_box("host_template_id", $host["host_template_id"], "0"); - form_save_button((isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php")); + if (isset($_SERVER["HTTP_REFERER"]) && !substr_count($_SERVER["HTTP_REFERER"], "graphs_new")) { + $_REQUEST["returnto"] = basename($_SERVER["HTTP_REFERER"]); + } + load_current_session_value("returnto", "sess_graphs_new_returnto", ""); + + form_save_button($_REQUEST["returnto"]); print "\n"; print "\n"; diff -Nru cacti-0.8.7e/graphs.php cacti-0.8.7g/graphs.php --- cacti-0.8.7e/graphs.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graphs.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ " . get_graph_title($matches[1]) . "
"; $graph_array[$i] = $matches[1]; - } - $i++; + $i++; + } } include_once("./include/top_header.php"); @@ -394,121 +394,130 @@ print "\n"; - if ($_POST["drp_action"] == "1") { /* delete */ - $graphs = array(); + if (isset($graph_array) && sizeof($graph_array)) { + if ($_POST["drp_action"] == "1") { /* delete */ + $graphs = array(); - /* find out which (if any) data sources are being used by this graph, so we can tell the user */ - if (isset($graph_array)) { - $data_sources = db_fetch_assoc("select - data_template_data.local_data_id, - data_template_data.name_cache - from (data_template_rrd,data_template_data,graph_templates_item) - where graph_templates_item.task_item_id=data_template_rrd.id - and data_template_rrd.local_data_id=data_template_data.local_data_id - and " . array_to_sql_or($graph_array, "graph_templates_item.local_graph_id") . " - and data_template_data.local_data_id > 0 - group by data_template_data.local_data_id - order by data_template_data.name_cache"); - } - - print " - + "; - } - print " - - \n - "; - }elseif ($_POST["drp_action"] == "2") { /* change graph template */ - print " - - \n - "; - }elseif ($_POST["drp_action"] == "3") { /* duplicate */ - print " - - \n - "; - }elseif ($_POST["drp_action"] == "4") { /* graph -> graph template */ - print " - - \n - "; - }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */ - print " - - \n - \n - "; - }elseif ($_POST["drp_action"] == "5") { /* change host */ - print " - - \n - "; - }elseif ($_POST["drp_action"] == "6") { /* reapply suggested naming to host */ - print " - - \n - "; - }elseif ($_POST["drp_action"] == "7") { /* reapply suggested naming to host */ - print " - - \n - "; - } + if (isset($data_sources) && sizeof($data_sources)) { + print "\n"; - $save_html = ""; + print ""; + + print "
"; + form_radio_button("delete_type", "1", "1", "Leave the Data Source(s) untouched.", "1"); print "
"; + form_radio_button("delete_type", "1", "2", "Delete all Data Source(s) referenced by these Graph(s).", "1"); print "
"; + print ""; + } + print " + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "2") { /* change graph template */ + print " + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "3") { /* duplicate */ + print " + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "4") { /* graph -> graph template */ + print " + + \n + "; + $save_html = " "; + }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */ + print " + + \n + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "5") { /* change host */ + print " + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "6") { /* reapply suggested naming to host */ + print " + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "7") { /* resize graphs */ + print " + + \n + "; + + $save_html = " "; + } }else{ - $save_html = ""; + print "\n"; + $save_html = ""; } print " @@ -516,7 +525,6 @@ - Cancel $save_html @@ -563,7 +571,7 @@ order by graph_templates_item.sequence"); $host_id = db_fetch_cell("select host_id from graph_local where id=" . $_GET["id"]); - $header_label = "[edit: " . get_graph_title($_GET["id"]) . "]"; + $header_label = "[edit: " . htmlspecialchars(get_graph_title($_GET["id"])) . "]"; } $graph_template_id = db_fetch_cell("select graph_template_id from graph_local where id=" . $_GET["id"]); @@ -826,7 +834,7 @@ $graphs_template = db_fetch_row("select * from graph_templates_graph where id=$local_graph_template_graph_id"); $host_id = db_fetch_cell("select host_id from graph_local where id=" . $_GET["id"]); - $header_label = "[edit: " . get_graph_title($_GET["id"]) . "]"; + $header_label = "[edit: " . htmlspecialchars(get_graph_title($_GET["id"])) . "]"; if ($graphs["graph_template_id"] == "0") { $use_graph_template = false; @@ -850,16 +858,16 @@
-   +   Select a graph type:  - "; html_create_list($data_query_graphs,"name","id","0"); print "
-

Are you sure you want to delete the following graphs?

-

$graph_list

- "; - if (sizeof($data_sources) > 0) { - print "

The following data sources are in use by these graphs:

\n"; + /* find out which (if any) data sources are being used by this graph, so we can tell the user */ + if (isset($graph_array) && sizeof($graph_array)) { + $data_sources = db_fetch_assoc("select + data_template_data.local_data_id, + data_template_data.name_cache + from (data_template_rrd,data_template_data,graph_templates_item) + where graph_templates_item.task_item_id=data_template_rrd.id + and data_template_rrd.local_data_id=data_template_data.local_data_id + and " . array_to_sql_or($graph_array, "graph_templates_item.local_graph_id") . " + and data_template_data.local_data_id > 0 + group by data_template_data.local_data_id + order by data_template_data.name_cache"); + } - foreach ($data_sources as $data_source) { - print "" . $data_source["name_cache"] . "
\n"; - } + print "
+

When you click \"Continue\", the following Graph(s) will be deleted. Please note, Data Source(s) should be deleted only if they are only used by these Graph(s) + and not others.

+

    $graph_list

"; - print "
"; - form_radio_button("delete_type", "1", "1", "Leave the data sources untouched.", "1"); print "
"; - form_radio_button("delete_type", "1", "2", "Delete all data sources referenced by these graphs.", "1"); print "
"; - print "
-

Choose a graph template and click save to change the graph template for - the following graphs. Be aware that all warnings will be suppressed during the - conversion, so graph data loss is possible.

-

$graph_list

-

New Graph Template:
"; form_dropdown("graph_template_id",db_fetch_assoc("select graph_templates.id,graph_templates.name from graph_templates order by name"),"name","id","","","0"); print "

-
-

When you click save, the following graphs will be duplicated. You can - optionally change the title format for the new graphs.

-

$graph_list

-

Title Format:
"; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

-
-

When you click save, the following graphs will be converted into graph templates. - You can optionally change the title format for the new graph templates.

-

$graph_list

-

Title Format:
"; form_text_box("title_format", " Template", "", "255", "30", "text"); print "

-
-

When you click save, the following graphs will be placed under the branch selected - below.

-

$graph_list

-

Destination Branch:
"; grow_dropdown_tree($matches[1], "tree_item_id", "0"); print "

-
-

Choose a new host for these graphs:

-

$graph_list

-

New Host:
"; form_dropdown("host_id",db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname"),"name","id","","","0"); print "

-
-

When you click save, the following graphs will have thier suggested naming convensions - recalculated and applies to the graphs.

-

$graph_list

-
-

When you click save, the following graphs will be resized per your specifications.

-

$graph_list

-

Graph Height:
"; form_text_box("graph_height", "", "", "255", "30", "text"); print "

-

Graph Width:
"; form_text_box("graph_width", "", "", "255", "30", "text"); print "

-

The following Data Source(s) are in use by these Graph(s):

\n"; - if (!isset($graph_array)) { - print "
You must select at least one graph.
+

Choose a Graph Template and click \"Continue\" to change the Graph Template for + the following Graph(s). Be aware that all warnings will be suppressed during the + conversion, so Graph data loss is possible.

+

    $graph_list

+

New Graph Template:
"; form_dropdown("graph_template_id",db_fetch_assoc("select graph_templates.id,graph_templates.name from graph_templates order by name"),"name","id","","","0"); print "

+
+

When you click \"Continue\", the following Graph(s) will be duplicated. You can + optionally change the title format for the new Graph(s).

+

    $graph_list

+

Title Format:
"; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

+
+

When you click \"Continue\", the following Graph(s) will be converted into Graph Template(s). + You can optionally change the title format for the new Graph Template(s).

+

    $graph_list

+

Title Format:
"; form_text_box("title_format", " Template", "", "255", "30", "text"); print "

+
+

When you click \"Continue\", the following Graph(s) will be placed under the Tree Branch selected below.

+

    $graph_list

+

Destination Branch:
"; grow_dropdown_tree($matches[1], "tree_item_id", "0"); print "

+
+

Choose a new Device for these Graph(s) and click \"Continue\"

+

    $graph_list

+

New Host:
"; form_dropdown("host_id",db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname"),"name","id","","","0"); print "

+
+

When you click \"Continue\", the following Graph(s) will have thier suggested naming convensions + recalculated and applies to the Graph(s).

+

    $graph_list

+
+

When you click \"Continue\", the following Graph(s) will be resized per your specifications.

+

    $graph_list

+

Graph Height:
"; form_text_box("graph_height", "", "", "255", "30", "text"); print "

+

Graph Width:
"; form_text_box("graph_width", "", "", "255", "30", "text"); print "

+
You must select at least one graph.
@@ -941,7 +949,7 @@
- + - *Turn Graph Debug Mode.
+ *Turn Graph Debug Mode.
*Edit Graph Template.
*Edit Graph Template.
*Edit Host.
*Edit Host.
Graph Management", "100%", $colors["header"], "3", "center", "graphs.php?action=graph_edit&host_id=" . get_request_var_request("host_id")); ?> - "> - + ">
- &rra_id=" alt=""> + " alt=""> RRDTool Command:
-
+
RRDTool Says:
-
+
+
@@ -1146,9 +1154,9 @@ } if (sizeof($hosts) > 0) { - foreach ($hosts as $host) { - print "\n"; - } + foreach ($hosts as $host) { + print "\n"; + } } ?> @@ -1178,16 +1186,16 @@ } if (sizeof($templates) > 0) { - foreach ($templates as $template) { - print "\n"; - } + foreach ($templates as $template) { + print "\n"; + } } ?> -   - +   +
@@ -1197,7 +1205,7 @@  Search: 
- "> + "> Rows per Page:  @@ -1207,18 +1215,18 @@ 0) { - foreach ($item_rows as $key => $value) { - print "\n"; - } + foreach ($item_rows as $key => $value) { + print "\n"; + } } ?>
+ + - - \n"; + html_start_box("", "100%", $colors["header"], "3", "center", ""); $total_rows = db_fetch_cell("SELECT @@ -1280,13 +1291,13 @@ \n \n \n
- << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " + << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " Showing Rows " . ((get_request_var_request("graph_rows")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < get_request_var_request("graph_rows")) || ($total_rows < (get_request_var_request("graph_rows")*get_request_var_request("page")))) ? $total_rows : (get_request_var_request("graph_rows")*get_request_var_request("page"))) . " of $total_rows [$url_page_select] - "; if ((get_request_var_request("page") * get_request_var_request("graph_rows")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * get_request_var_request("graph_rows")) < $total_rows) { $nav .= ""; } $nav .= " >> + "; if ((get_request_var_request("page") * get_request_var_request("graph_rows")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * get_request_var_request("graph_rows")) < $total_rows) { $nav .= ""; } $nav .= " >>
@@ -1301,16 +1312,16 @@ "name" => array("Template Name", "ASC"), "height" => array("Size", "ASC")); - html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction")); + html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), false); $i = 0; if (sizeof($graph_list) > 0) { foreach ($graph_list as $graph) { $template_name = ((empty($graph["name"])) ? "None" : $graph["name"]); form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]); $i++; - form_selectable_cell("" . ((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", title_trim($graph["title_cache"], read_config_option("max_title_graph"))) : title_trim($graph["title_cache"], read_config_option("max_title_graph"))) . "", $graph["local_graph_id"]); + form_selectable_cell("" . ((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", title_trim(htmlspecialchars($graph["title_cache"]), read_config_option("max_title_graph"))) : title_trim(htmlspecialchars($graph["title_cache"]), read_config_option("max_title_graph"))) . "", $graph["local_graph_id"]); form_selectable_cell($graph["local_graph_id"], $graph["local_graph_id"]); - form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", $template_name) : $template_name) . "", $graph["local_graph_id"]); + form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", htmlspecialchars($template_name)) : htmlspecialchars($template_name)), $graph["local_graph_id"]); form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]); form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]); form_end_row(); diff -Nru cacti-0.8.7e/graph_templates_inputs.php cacti-0.8.7g/graph_templates_inputs.php --- cacti-0.8.7e/graph_templates_inputs.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graph_templates_inputs.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ '" . db_fetch_cell("select name from graph_template_input where id=" . $_GET["id"]) . "'? NOTE: Deleting this item will NOT affect graphs that use this template.", "graph_templates.php?action=template_edit&id=" . $_GET["graph_template_id"], "graph_templates_inputs.php?action=input_remove&id=" . $_GET["id"] . "&graph_template_id=" . $_GET["graph_template_id"]); + form_confirm("Are You Sure?", "Are you sure you want to delete the input item '" . db_fetch_cell("select name from graph_template_input where id=" . $_GET["id"]) . "'? NOTE: Deleting this item will NOT affect graphs that use this template.", htmlspecialchars("graph_templates.php?action=template_edit&id=" . $_GET["graph_template_id"]), htmlspecialchars("graph_templates_inputs.php?action=input_remove&id=" . $_GET["id"] . "&graph_template_id=" . $_GET["graph_template_id"])); include("./include/bottom_footer.php"); exit; } @@ -161,7 +161,7 @@ $graph_template_input = db_fetch_row("select * from graph_template_input where id=" . $_GET["id"]); } - html_start_box("Graph Item Inputs $header_label", "100%", $colors["header"], "3", "center", ""); + html_start_box("Graph Item Inputs " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", ""); draw_edit_form(array( "config" => array(), diff -Nru cacti-0.8.7e/graph_templates_items.php cacti-0.8.7g/graph_templates_items.php --- cacti-0.8.7e/graph_templates_items.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graph_templates_items.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ Graph Template Items $header_label", "100%", $colors["header"], "3", "center", ""); + html_start_box("Graph Template Items " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", ""); if (!empty($_GET["id"])) { $template_item = db_fetch_row("select * from graph_templates_item where id=" . $_GET["id"]); @@ -350,7 +350,7 @@ if (sizeof($graph_item_input_fields) > 0) { foreach ($graph_item_input_fields as $field) { - $form_array{$field["column_name"]}["friendly_name"] .= " [Field Not Templated]"; + $form_array{$field["column_name"]}["friendly_name"] .= " [Field Not Templated]"; } } } diff -Nru cacti-0.8.7e/graph_templates.php cacti-0.8.7g/graph_templates.php --- cacti-0.8.7e/graph_templates.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graph_templates.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ " . db_fetch_cell("select name from graph_templates where id=" . $matches[1]) . "
"; $graph_array[$i] = $matches[1]; - } - $i++; + $i++; + } } include_once("./include/top_header.php"); @@ -229,32 +225,32 @@ print "
\n"; - if ($_POST["drp_action"] == "1") { /* delete */ - print " - -

Are you sure you want to delete the following graph templates? Any graphs attached - to these templates will become individual graphs.

-

$graph_list

- - \n - "; - }elseif ($_POST["drp_action"] == "2") { /* duplicate */ - print " - -

When you click save, the following graph templates will be duplicated. You can - optionally change the title format for the new graph templates.

-

$graph_list

-

Title Format:
"; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

- - \n - "; - } - - if (!isset($graph_array)) { - print "You must select at least one graph template.\n"; - $save_html = ""; + if (isset($graph_array) && sizeof($graph_array)) { + if ($_POST["drp_action"] == "1") { /* delete */ + print " + +

When you click \"Continue\", the following Graph Template(s) will be deleted. Any Graph(s) associated with + the Template(s) will become individual Graph(s).

+

    $graph_list

+ + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "2") { /* duplicate */ + print " + +

When you click \"Continue\", the following Graph Template(s) will be duplicated. You can + optionally change the title format for the new Graph Template(s).

+

    $graph_list

+

Title Format:
"; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

+ + \n + "; + $save_html = " "; + } }else{ - $save_html = ""; + print "You must select at least one graph template.\n"; + $save_html = ""; } print " @@ -262,7 +258,6 @@ - Cancel $save_html @@ -308,7 +303,7 @@ $header_label = "[edit: " . db_fetch_cell("select name from graph_templates where id=" . $_GET["id"]) . "]"; } - html_start_box("Graph Template Items $header_label", "100%", $colors["header"], "3", "center", "graph_templates_items.php?action=item_edit&graph_template_id=" . $_GET["id"]); + html_start_box("Graph Template Items " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", "graph_templates_items.php?action=item_edit&graph_template_id=" . $_GET["id"]); draw_graph_items_list($template_item_list, "graph_templates_items.php", "graph_template_id=" . $_GET["id"], false); html_end_box(); @@ -326,10 +321,10 @@ form_alternate_row_color($colors["alternate"],$colors["light"],$i); ?> - &graph_template_id="> + "> - &graph_template_id=">Delete + ">Delete Template $header_label", "100%", $colors["header"], "3", "center", ""); + html_start_box("Template " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", ""); draw_edit_form(array( "config" => array(), @@ -404,7 +399,7 @@ form_hidden_box("rrdtool_version", read_config_option("rrdtool_version"), ""); html_end_box(); - form_save_button("graph_templates.php"); + form_save_button("graph_templates.php", "return"); //Now we need some javascript to make it dynamic ?> @@ -484,26 +479,26 @@ html_start_box("Graph Templates", "100%", $colors["header"], "3", "center", "graph_templates.php?action=template_edit"); ?> - "> - + "> +
Search:  - "> + "> -   - +   +
- - +
+ \n"; + html_start_box("", "100%", $colors["header"], "3", "center", ""); $total_rows = db_fetch_cell("SELECT @@ -534,13 +532,13 @@ \n \n \n
- << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " + << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " Showing Rows " . ((read_config_option("num_rows_device")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (read_config_option("num_rows_device")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_device")*get_request_var_request("page"))) . " of $total_rows [$url_page_select] - "; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= " >> + "; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= " >>
@@ -552,13 +550,13 @@ $display_text = array( "name" => array("Template Title", "ASC")); - html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction")); + html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), false); $i = 0; if (sizeof($template_list) > 0) { foreach ($template_list as $template) { form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $template["id"]);$i++; - form_selectable_cell("" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", $template["name"]) : $template["name"]) . "", $template["id"]); + form_selectable_cell("" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", htmlspecialchars($template["name"])) : htmlspecialchars($template["name"])) . "", $template["id"]); form_checkbox_cell($template["name"], $template["id"]); form_end_row(); } diff -Nru cacti-0.8.7e/graph_view.php cacti-0.8.7g/graph_view.php --- cacti-0.8.7e/graph_view.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/graph_view.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ - - Graph Filters", "100%", $colors["header"], "3", "center", ""); ?> - " class="noprint"> -
+ " class="noprint"> +
@@ -326,9 +310,9 @@ } if (sizeof($hosts) > 0) { - foreach ($hosts as $host) { - print "\n"; - } + foreach ($hosts as $host) { + print "\n"; + } } ?> @@ -357,9 +341,9 @@ } if (sizeof($graph_templates) > 0) { - foreach ($graph_templates as $template) { - print "\n"; - } + foreach ($graph_templates as $template) { + print "\n"; + } } ?> @@ -368,156 +352,103 @@  Search:  - "> + "> -   - +   +
-
+ - - - - " class="noprint"> -
- - - - - - - + } + ?> + + + + + +
-  Presets:  - - + + + + + - - - - - + + + + + + + + - - -
+  Presets:  + + - -  From:  - - -    - -  To:  - - -   - -    - + +  From:  + + + +   + +  To:  + + + +   + +   + +   - - -    - -
-
+   + +   + +
+ + + YOU DO NOT HAVE RIGHTS FOR LIST VIEW"; exit; } @@ -552,6 +480,7 @@ /* ================= input validation ================= */ input_validate_input_number(get_request_var_request("host_id")); input_validate_input_number(get_request_var_request("graph_template_id")); + input_validate_input_number(get_request_var_request("rows")); /* ==================================================== */ /* clean up search string */ @@ -559,43 +488,48 @@ $_REQUEST["filter"] = sanitize_search_string(get_request_var_request("filter")); } - /* reset the page counter to '1' if a search in initiated */ - if (isset($_REQUEST["filter"])) { - $_REQUEST["page"] = "1"; + /* reset the graph list on a new viewing */ + if (!isset($_REQUEST["page"])) { + $_REQUEST["graph_list"] = ""; + $_REQUEST["page"] = 1; } - load_current_session_value("host_id", "sess_graph_view_list_host", "0"); - load_current_session_value("graph_template_id", "sess_graph_view_list_graph_template", "0"); - load_current_session_value("filter", "sess_graph_view_list_filter", ""); - load_current_session_value("page", "sess_graph_view_list_current_page", ""); - /* if the user pushed the 'clear' button */ if (isset($_REQUEST["clear_x"])) { kill_session_var("sess_graph_view_list_current_page"); kill_session_var("sess_graph_view_list_filter"); kill_session_var("sess_graph_view_list_host"); kill_session_var("sess_graph_view_list_graph_template"); + kill_session_var("sess_graph_view_list_rows"); + kill_session_var("sess_graph_view_list_graph_list"); unset($_REQUEST["page"]); + unset($_REQUEST["rows"]); unset($_REQUEST["filter"]); unset($_REQUEST["host_id"]); unset($_REQUEST["graph_template_id"]); unset($_REQUEST["graph_list"]); unset($_REQUEST["graph_add"]); unset($_REQUEST["graph_remove"]); - + }else{ + /* if any of the settings changed, reset the page number */ + $changed = false; + $changed += check_changed("host_id", "sess_graphs_view_list_host"); + $changed += check_changed("rows", "sess_graphs_view_list_rows"); + $changed += check_changed("graph_template_id", "sess_graphs_view_list_graph_template"); + $changed += check_changed("filter", "sess_graphs_view_list_filter"); + if ($changed) $_REQUEST["page"] = 1; } - /* make sure we have a page set */ - if (! isset($_REQUEST["page"])) { - $_REQUEST["page"] = 1; - } - if (($_REQUEST["page"] == 0 ) || (empty($_REQUEST["page"]))) { - $_REQUEST["page"] = 1; - } + load_current_session_value("host_id", "sess_graph_view_list_host", "0"); + load_current_session_value("graph_template_id", "sess_graph_view_list_graph_template", "0"); + load_current_session_value("filter", "sess_graph_view_list_filter", ""); + load_current_session_value("page", "sess_graph_view_list_current_page", "1"); + load_current_session_value("rows", "sess_graph_view_list_rows", "-1"); + load_current_session_value("graph_list", "sess_graph_view_list_graph_list", ""); /* save selected graphs into url */ - if (! empty($_REQUEST["graph_list"])) { + if (!empty($_REQUEST["graph_list"])) { foreach (explode(",",$_REQUEST["graph_list"]) as $item) { $graph_list[$item] = 1; } @@ -614,53 +548,22 @@ } } - /* do some fancy navigation url construction so we don't have to try and rebuild the url string */ - if (ereg("page=[0-9]+",basename($_SERVER["QUERY_STRING"]))) { - $nav_url = str_replace("page=" . get_request_var_request("page"), "page=", basename($_SERVER["PHP_SELF"]) . "?" . $_SERVER["QUERY_STRING"]); - }else{ - #$nav_url = basename($_SERVER["PHP_SELF"]) . "?" . $_SERVER["QUERY_STRING"] . "&page=&host_id=" . get_request_var_request("host_id"); - $nav_url = basename($_SERVER["PHP_SELF"]) . "?" . $_SERVER["QUERY_STRING"] . "&page="; - } + /* update the revised graph list session variable */ + $_REQUEST["graph_list"] = implode(",", array_keys($graph_list)); + load_current_session_value("graph_list", "sess_graph_view_list_graph_list", ""); - $nav_url = ereg_replace("(\?|&)host_id=[0-9]+|(\?|&)graph_template_id=[0-9]+|(\?|&)filter=[a-zA-Z0-9]*|(\?|&)graph_add=[\,0-9]*|(\?|&)graph_remove=[\,0-9]*|(\?|&)graph_list=[\,0-9]*", "", $nav_url); - $graph_list_text = ""; - if (! empty($graph_list)) { - foreach ($graph_list as $item => $value) { - $graph_list_text .= $item . ","; - } - if (substr($graph_list_text,strlen($graph_list_text) - 1, 1) == ",") { - $graph_list_text = substr($graph_list_text,0,strlen($graph_list_text) - 1); - } - $nav_url .= "&graph_list=" . $graph_list_text; - } + // debugging + //echo "GraphList:" . (strlen($_REQUEST["graph_list"]) ? $_REQUEST["graph_list"]:"-") . ", GraphRemove:" . (isset($_REQUEST["graph_remove"]) && strlen($_REQUEST["graph_remove"]) ? $_REQUEST["graph_remove"]:"-") . ", GraphAdd:" . (isset($_REQUEST["graph_add"]) && strlen($_REQUEST["graph_add"]) ? $_REQUEST["graph_add"]:"-"); + + $nav_url = "graph_view.php?action=list&page="; /* display graph view filter selector */ - html_graph_start_box(3, FALSE); + html_start_box("Graph Filters", "100%", $colors["header"], "3", "center", ""); - if (empty($_REQUEST["host_id"])) { $_REQUEST["host_id"] = 0; } - if (empty($_REQUEST["graph_template_id"])) { $_REQUEST["graph_template_id"] = 0; } - if (empty($_REQUEST["filter"])) { $_REQUEST["filter"] = ""; } ?> - - - "> -
- - - + "> + + +
@@ -689,9 +592,9 @@ } if (sizeof($hosts) > 0) { - foreach ($hosts as $host) { - print "\n"; - } + foreach ($hosts as $host) { + print "\n"; + } } ?> @@ -701,7 +604,7 @@ + +  Graphs per Page:  + + - "> + "> -   - +   +
- + + +
+ +
+ + + + + + + + + +
+ << " . (get_request_var_request("page") > 1 ? "":"") . "Previous" . (get_request_var_request("page") > 1 ? "":"") . " + + Showing Rows " . (($_REQUEST["rows"]*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < $_REQUEST["rows"]) || ($total_rows < ($_REQUEST["rows"]*get_request_var_request("page")))) ? $total_rows : ($_REQUEST["rows"]*get_request_var_request("page"))) . " of " . $total_rows . " + + " . ((get_request_var_request("page") * $_REQUEST["rows"]) < $total_rows ? "":"") . "Next" . ((get_request_var_request("page") * $_REQUEST["rows"]) < $total_rows ? "":"") . " >> +
+ + "; + + html_start_box("", "100%", $colors["header"], "1", "center", ""); + print $nav; + html_header_checkbox(array("Graph Title", "Graph Size")); + + $i = 0; + if (sizeof($graphs)) { + foreach ($graphs as $graph) { + form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]); $i++; + form_selectable_cell("" . htmlspecialchars($graph["title_cache"]) . "", $graph["local_graph_id"]); + form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]); + form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]); + form_end_row(); + } + } + + print $nav; + html_end_box(); + + ?> + + + + + +
 
+ + + + + + -
- - - - - - - - - - -
- << 1) { print ""; } print "Previous"; if (get_request_var_request("page") > 1) { print ""; } ?> - - Showing Rows to of - - ", (get_request_var_request("page")+1), $nav_url) . "' onClick='return url_go(url_graph(\"" . str_replace("", (get_request_var_request("page")+1), $nav_url) . "\"))'>"; } print "Next"; if ((get_request_var_request("page") * ROWS_PER_PAGE) < $total_rows) { print ""; } ?> >> -
- - - - - - - \n"; - ?> - -
Select All
- - 0) { - foreach ($graphs as $graph) { - form_alternate_row_color("f5f5f5", "ffffff", $i); - - print ""; - print "\n"; - print "\n"; - - print "" . $graph["title_cache"] . "\n"; - print "" . $graph["height"] . "x" . $graph["width"] . "\n"; - print ""; - - $i++; - } - } - - ?> - - - - - \n"; - ?> - -
Select All
- - - - - - - - -
 
- - - - - - -
" . db_fetch_cell("select description from host where id=" . $matches[1]) . "
"; + $host_list .= "
  • " . htmlspecialchars(db_fetch_cell("select description from host where id=" . $matches[1])) . "
    "; $host_array[$i] = $matches[1]; - } - $i++; + $i++; + } } include_once("./include/top_header.php"); @@ -339,119 +335,125 @@ html_start_box("" . $device_actions{$_POST["drp_action"]} . "", "60%", $colors["header_panel"], "3", "center", ""); - print "
    \n"; - - if ($_POST["drp_action"] == "2") { /* Enable Devices */ - print " - -

    To enable the following devices, press the \"yes\" button below.

    -

    $host_list

    - - "; - }elseif ($_POST["drp_action"] == "3") { /* Disable Devices */ - print " - -

    To disable the following devices, press the \"yes\" button below.

    -

    $host_list

    - - "; - }elseif ($_POST["drp_action"] == "4") { /* change snmp options */ - print " - -

    To change SNMP parameters for the following devices, check the box next to the fields - you want to update, fill in the new value, and click Save.

    -

    $host_list

    - - "; - $form_array = array(); - while (list($field_name, $field_array) = each($fields_host_edit)) { - if ((ereg("^snmp_", $field_name)) || - ($field_name == "max_oids")) { - $form_array += array($field_name => $fields_host_edit[$field_name]); - - $form_array[$field_name]["value"] = ""; - $form_array[$field_name]["description"] = ""; - $form_array[$field_name]["form_id"] = 0; - $form_array[$field_name]["sub_checkbox"] = array( - "name" => "t_" . $field_name, - "friendly_name" => "Update this Field", - "value" => "" - ); - } - } + print "\n"; - draw_edit_form( - array( - "config" => array("no_form_tag" => true), - "fields" => $form_array - ) - ); - }elseif ($_POST["drp_action"] == "6") { /* change availability options */ - print " - -

    To change SNMP parameters for the following devices, check the box next to the fields - you want to update, fill in the new value, and click Save.

    -

    $host_list

    - - "; - $form_array = array(); - while (list($field_name, $field_array) = each($fields_host_edit)) { - if (ereg("(availability_method|ping_method|ping_port)", $field_name)) { - $form_array += array($field_name => $fields_host_edit[$field_name]); + if (isset($host_array) && sizeof($host_array)) { + if ($_POST["drp_action"] == "2") { /* Enable Devices */ + print " + +

    To enable the following Device(s), click \"Continue\".

    +

      " . $host_list . "

    + + "; - $form_array[$field_name]["value"] = ""; - $form_array[$field_name]["description"] = ""; - $form_array[$field_name]["form_id"] = 0; - $form_array[$field_name]["sub_checkbox"] = array( - "name" => "t_" . $field_name, - "friendly_name" => "Update this Field", - "value" => "" - ); + $save_html = " "; + }elseif ($_POST["drp_action"] == "3") { /* Disable Devices */ + print " + +

    To disable the following Device(s), click \"Continue\".

    +

      " . $host_list . "

    + + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "4") { /* change snmp options */ + print " + +

    To change SNMP parameters for the following Device(s), check the box next to the fields + you want to update, fill in the new value, and click \"Continue\".

    +

      " . $host_list . "

    + + "; + $form_array = array(); + while (list($field_name, $field_array) = each($fields_host_edit)) { + if ((ereg("^snmp_", $field_name)) || + ($field_name == "max_oids")) { + $form_array += array($field_name => $fields_host_edit[$field_name]); + + $form_array[$field_name]["value"] = ""; + $form_array[$field_name]["description"] = ""; + $form_array[$field_name]["form_id"] = 0; + $form_array[$field_name]["sub_checkbox"] = array( + "name" => "t_" . $field_name, + "friendly_name" => "Update this Field", + "value" => "" + ); + } } - } - draw_edit_form( - array( - "config" => array("no_form_tag" => true), - "fields" => $form_array - ) - ); - }elseif ($_POST["drp_action"] == "5") { /* Clear Statisitics for Selected Devices */ - print " - -

    To clear the counters for the following devices, press the \"yes\" button below.

    -

    $host_list

    - - "; - }elseif ($_POST["drp_action"] == "1") { /* delete */ - print " - -

    Are you sure you want to delete the following devices?

    -

    $host_list

    "; - form_radio_button("delete_type", "2", "1", "Leave all graphs and data sources untouched. Data sources will be disabled however.", "1"); print "
    "; - form_radio_button("delete_type", "2", "2", "Delete all associated graphs and data sources.", "1"); print "
    "; - print " - - \n - "; - }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */ - print " - -

    When you click save, the following hosts will be placed under the branch selected - below.

    -

    $host_list

    -

    Destination Branch:
    "; grow_dropdown_tree($matches[1], "tree_item_id", "0"); print "

    - - \n - \n - "; - } + draw_edit_form( + array( + "config" => array("no_form_tag" => true), + "fields" => $form_array + ) + ); + $save_html = " "; + }elseif ($_POST["drp_action"] == "6") { /* change availability options */ + print " + +

    To change Availability parameters for the following Device(s), check the box next to the fields + you want to update, fill in the new value, and click \"Continue\".

    +

      " . $host_list . "

    + + "; + $form_array = array(); + while (list($field_name, $field_array) = each($fields_host_edit)) { + if (ereg("(availability_method|ping_method|ping_port)", $field_name)) { + $form_array += array($field_name => $fields_host_edit[$field_name]); + + $form_array[$field_name]["value"] = ""; + $form_array[$field_name]["description"] = ""; + $form_array[$field_name]["form_id"] = 0; + $form_array[$field_name]["sub_checkbox"] = array( + "name" => "t_" . $field_name, + "friendly_name" => "Update this Field", + "value" => "" + ); + } + } - if (!isset($host_array)) { - print "You must select at least one device.\n"; - $save_html = ""; + draw_edit_form( + array( + "config" => array("no_form_tag" => true), + "fields" => $form_array + ) + ); + $save_html = " "; + }elseif ($_POST["drp_action"] == "5") { /* Clear Statisitics for Selected Devices */ + print " + +

    To clear the counters for the following Device(s), press the \"Continue\" button below.

    +

      " . $host_list . "

    + + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "1") { /* delete */ + print " + +

    When you click \"Continue\" the following Device(s) will be deleted.

    +

      " . $host_list . "

    "; + form_radio_button("delete_type", "2", "1", "Leave all Graph(s) and Data Source(s) untouched. Data Source(s) will be disabled however.", "1"); print "
    "; + form_radio_button("delete_type", "2", "2", "Delete all associated Graph(s) and Data Source(s).", "1"); print "
    "; + print " + + \n + "; + $save_html = " "; + }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */ + print " + +

    When you click \"Continue\", the following Device(s) will be placed under the branch selected + below.

    +

      " . $host_list . "

    +

    Destination Branch:
    "; grow_dropdown_tree($matches[1], "tree_item_id", "0"); print "

    + + \n + \n + "; + $save_html = " "; + } }else{ - $save_html = ""; + print "You must select at least one device.\n"; + $save_html = ""; } print " @@ -459,7 +461,6 @@ - Cancel $save_html @@ -514,7 +515,7 @@ if ((read_config_option("deletion_verification") == "on") && (!isset($_GET["confirm"]))) { include("./include/top_header.php"); - form_confirm("Are You Sure?", "Are you sure you want to delete the host '" . db_fetch_cell("select description from host where id=" . $_GET["id"]) . "'?", "host.php", "host.php?action=remove&id=" . $_GET["id"]); + form_confirm("Are You Sure?", "Are you sure you want to delete the host '" . htmlspecialchars(db_fetch_cell("select description from host where id=" . $_GET["id"])) . "'?", htmlspecialchars("host.php"), htmlspecialchars("host.php?action=remove&id=" . $_GET["id"])); include("./include/bottom_footer.php"); exit; } @@ -531,11 +532,9 @@ input_validate_input_number(get_request_var("id")); /* ==================================================== */ - display_output_messages(); - if (!empty($_GET["id"])) { $host = db_fetch_row("select * from host where id=" . $_GET["id"]); - $header_label = "[edit: " . $host["description"] . "]"; + $header_label = "[edit: " . htmlspecialchars($host["description"]) . "]"; }else{ $header_label = "[new]"; } @@ -545,7 +544,7 @@ @@ -567,7 +566,7 @@ $host["snmp_context"], $host["snmp_port"], $host["snmp_timeout"], read_config_option("snmp_retries"),SNMP_WEBUI); /* modify for some system descriptions */ - /* 0000937: System output in hosts.php poor for Alcatel */ + /* 0000937: System output in host.php poor for Alcatel */ if (substr_count($snmp_system, "00:")) { $snmp_system = str_replace("00:", "", $snmp_system); $snmp_system = str_replace(":", " ", $snmp_system); @@ -641,9 +640,9 @@
    - () + ()
    - *">Create Graphs for this Host
    - *&ds_rows=30&filter=&template_id=-1&method_id=-1&page=1">Data Source List
    - *&graph_rows=30&filter=&template_id=-1&page=1">Graph List + *">Create Graphs for this Host
    + *">Data Source List
    + *">Graph List
    @@ -662,6 +661,10 @@ "fields" => inject_form_variables($fields_host_edit, (isset($host) ? $host : array())) )); + /* we have to hide this button to make a form change in the main form trigger the correct + * submit action */ + echo "
    "; + html_end_box(); ?> @@ -986,13 +989,13 @@ ?> - ) + ) - Is Being Graphed (Edit)" : "Not Being Graphed");?> + Is Being Graphed (Edit)" : "Not Being Graphed");?> - Delete Graph Template Association + Delete Graph Template Association -   +   @@ -1062,10 +1065,10 @@ ?> - ) + ) - (&host_id=">Verbose Query) + (">Verbose Query) @@ -1074,8 +1077,8 @@ Success" : "Fail");?> [ Item, Row] - Reload Data Query  - Delete Data Query Association + Reload Data Query  + Delete Data Query Association -   +   @@ -1103,7 +1106,7 @@ html_end_box(); } - form_save_button("host.php"); + form_save_button("host.php", "return"); } function host() { @@ -1189,9 +1192,9 @@ html_start_box("Devices", "100%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . get_request_var_request("host_template_id") . "&host_status=" . get_request_var_request("host_status")); ?> - "> - + "> +
    @@ -1205,9 +1208,9 @@ $host_templates = db_fetch_assoc("select id,name from host_template order by name"); if (sizeof($host_templates) > 0) { - foreach ($host_templates as $host_template) { - print "\n"; - } + foreach ($host_templates as $host_template) { + print "\n"; + } } ?> @@ -1231,7 +1234,7 @@  Search:  - "> + ">  Rows per Page:  @@ -1241,22 +1244,22 @@ 0) { - foreach ($item_rows as $key => $value) { - print "\n"; - } + foreach ($item_rows as $key => $value) { + print "\n"; + } } ?> -   - +   +
    - - +
    + \n"; + html_start_box("", "100%", $colors["header"], "3", "center", ""); $total_rows = db_fetch_cell("select @@ -1320,13 +1326,13 @@ \n \n \n
    - << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " + << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " Showing Rows " . ((get_request_var_request("host_rows")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (get_request_var_request("host_rows")*get_request_var_request("page")))) ? $total_rows : (get_request_var_request("host_rows")*get_request_var_request("page"))) . " of $total_rows [$url_page_select] - "; if ((get_request_var_request("page") * get_request_var_request("host_rows")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * get_request_var_request("host_rows")) < $total_rows) { $nav .= ""; } $nav .= " >> + "; if ((get_request_var_request("page") * get_request_var_request("host_rows")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * get_request_var_request("host_rows")) < $total_rows) { $nav .= ""; } $nav .= " >>
    @@ -1347,20 +1353,20 @@ "avg_time" => array("Average (ms)", "DESC"), "availability" => array("Availability", "ASC")); - html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction")); + html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), false); $i = 0; if (sizeof($hosts) > 0) { foreach ($hosts as $host) { form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $host["id"]); $i++; - form_selectable_cell("" . - (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", $host["description"]) : $host["description"]) . "", $host["id"], 250); + form_selectable_cell("" . + (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", htmlspecialchars($host["description"])) : htmlspecialchars($host["description"])) . "", $host["id"], 250); form_selectable_cell(round(($host["id"]), 2), $host["id"]); form_selectable_cell((isset($host_graphs[$host["id"]]) ? $host_graphs[$host["id"]] : 0), $host["id"]); form_selectable_cell((isset($host_data_sources[$host["id"]]) ? $host_data_sources[$host["id"]] : 0), $host["id"]); form_selectable_cell(get_colored_device_status(($host["disabled"] == "on" ? true : false), $host["status"]), $host["id"]); form_selectable_cell(round(($host["status_event_count"]), 2), $host["id"]); - form_selectable_cell((strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", $host["hostname"]) : $host["hostname"]), $host["id"]); + form_selectable_cell((strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", htmlspecialchars($host["hostname"])) : htmlspecialchars($host["hostname"])), $host["id"]); form_selectable_cell(round(($host["cur_time"]), 2), $host["id"]); form_selectable_cell(round(($host["avg_time"]), 2), $host["id"]); form_selectable_cell(round($host["availability"], 2), $host["id"]); diff -Nru cacti-0.8.7e/host_templates.php cacti-0.8.7g/host_templates.php --- cacti-0.8.7e/host_templates.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/host_templates.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ " . db_fetch_cell("select name from host_template where id=" . $matches[1]) . "
    "; $host_array[$i] = $matches[1]; - } - $i++; + $i++; + } } include_once("./include/top_header.php"); html_start_box("" . $host_actions{$_POST["drp_action"]} . "", "60%", $colors["header_panel"], "3", "center", ""); - print "
    \n"; + print "\n"; - if ($_POST["drp_action"] == "1") { /* delete */ - print " - -

    Are you sure you want to delete the following host templates? All devices currently attached - this these host templates will lose their template assocation.

    -

    $host_list

    - - \n - "; - }elseif ($_POST["drp_action"] == "2") { /* duplicate */ - print " - -

    When you click save, the following host templates will be duplicated. You can - optionally change the title format for the new host templates.

    -

    $host_list

    -

    Title Format:
    "; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

    - - \n - "; - } - - if (!isset($host_array)) { - print "You must select at least one host template.\n"; - $save_html = ""; + if (isset($host_array) && sizeof($host_array)) { + if ($_POST["drp_action"] == "1") { /* delete */ + print " + +

    Are you sure you want to delete the following Host Template(s)? All Devices currently associated + with these Host Template(s) will lose that assocation.

    +

      $host_list

    + + \n + "; + $save_html = " "; + }elseif ($_POST["drp_action"] == "2") { /* duplicate */ + print " + +

    When you click \"Continue\", the following Host Template(s) will be duplicated. You can + optionally change the title format for the new Host Template(s).

    +

      $host_list

    +

    Title Format:
    "; form_text_box("title_format", " (1)", "", "255", "30", "text"); print "

    + + \n + "; + $save_html = " "; + } }else{ - $save_html = ""; + print "You must select at least one host template.\n"; + $save_html = ""; } print " @@ -202,7 +198,6 @@ - Cancel $save_html @@ -242,8 +237,6 @@ input_validate_input_number(get_request_var("id")); /* ==================================================== */ - display_output_messages(); - if (!empty($_GET["id"])) { $host_template = db_fetch_row("select * from host_template where id=" . $_GET["id"]); $header_label = "[edit: " . $host_template["name"] . "]"; @@ -252,13 +245,17 @@ $_GET["id"] = 0; } - html_start_box("Host Templates $header_label", "100%", $colors["header"], "3", "center", ""); + html_start_box("Host Templates " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", ""); draw_edit_form(array( "config" => array(), "fields" => inject_form_variables($fields_host_template_edit, (isset($host_template) ? $host_template : array())) )); + /* we have to hide this button to make a form change in the main form trigger the correct + * submit action */ + echo "
    "; + html_end_box(); if (!empty($_GET["id"])) { @@ -279,10 +276,10 @@ ?> - ) + ) - Delete + Delete -   +   @@ -329,10 +326,10 @@ ?> - ) + ) - Delete + Delete -   +   @@ -363,7 +360,7 @@ html_end_box(); } - form_save_button("host_templates.php"); + form_save_button("host_templates.php", "return"); } function template() { @@ -412,26 +409,26 @@ html_start_box("Host Templates", "100%", $colors["header"], "3", "center", "host_templates.php?action=edit"); ?> - "> - + "> +
    Search:  - "> + "> -   - +   +
    -
    + \n"; + html_start_box("", "100%", $colors["header"], "3", "center", ""); $total_rows = db_fetch_cell("SELECT @@ -463,13 +463,13 @@ \n \n \n
    - << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " + << "; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= ""; } $nav .= " Showing Rows " . ((read_config_option("num_rows_device")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (read_config_option("num_rows_device")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_device")*get_request_var_request("page"))) . " of $total_rows [$url_page_select] - "; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= " >> + "; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= ""; } $nav .= " >>
    @@ -481,13 +481,13 @@ $display_text = array( "name" => array("Template Title", "ASC")); - html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction")); + html_header_sort_checkbox($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), false); $i = 0; if (sizeof($template_list) > 0) { foreach ($template_list as $template) { form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $template["id"]);$i++; - form_selectable_cell("" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", $template["name"]) : $template["name"]) . "", $template["id"]); + form_selectable_cell("" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "\\1", htmlspecialchars($template["name"])) : htmlspecialchars($template["name"])) . "", $template["id"]); form_checkbox_cell($template["name"], $template["id"]); form_end_row(); } diff -Nru cacti-0.8.7e/include/auth.php cacti-0.8.7g/include/auth.php --- cacti-0.8.7e/include/auth.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/auth.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ ( Return | Login Again )"; + }else{ + $goBack = "( Login Again )"; + } ?> + Cacti - - + + - +

    - + - +
    Access Denied
    You are not permitted to access this section of Cacti. If you feel that you need access to this particular section, please contact the Cacti administrator.
    ( Return | Login )
    diff -Nru cacti-0.8.7e/include/bottom_footer.php cacti-0.8.7g/include/bottom_footer.php --- cacti-0.8.7e/include/bottom_footer.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/bottom_footer.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ +
    + - diff -Nru cacti-0.8.7e/include/config.php cacti-0.8.7g/include/config.php --- cacti-0.8.7e/include/config.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/config.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ "DES (default)", "AES128" => "AES"); +$banned_snmp_strings = array( + "End of MIB", + "No Such"); + $logfile_options = array(1 => "Logfile Only", "Logfile and Syslog/Eventlog", @@ -259,10 +263,17 @@ "ucd-snmp" => "UCD-SNMP 4.x", "net-snmp" => "NET-SNMP 5.x"); -$rrdtool_versions = array( - "rrd-1.0.x" => "RRDTool 1.0.x", - "rrd-1.2.x" => "RRDTool 1.2.x", - "rrd-1.3.x" => "RRDTool 1.3.x"); +if ($config["cacti_server_os"] != "win32") { + $rrdtool_versions = array( + "rrd-1.0.x" => "RRDTool 1.0.x", + "rrd-1.2.x" => "RRDTool 1.2.x", + "rrd-1.3.x" => "RRDTool 1.3.x", + "rrd-1.4.x" => "RRDTool 1.4.x"); +}else{ + $rrdtool_versions = array( + "rrd-1.0.x" => "RRDTool 1.0.x", + "rrd-1.2.x" => "RRDTool 1.2.x"); +} $cdef_item_types = array( 1 => "Function", @@ -467,7 +478,7 @@ "email_templates.php" => 8, "event_queue.php" => 8, "smtp_queue.php" => 8, - "logout.php" => 7 + "logout.php" => -1 ); $hash_type_codes = array( @@ -509,7 +520,9 @@ "0.8.7b" => "0016", "0.8.7c" => "0017", "0.8.7d" => "0018", - "0.8.7e" => "0019" + "0.8.7e" => "0019", + "0.8.7f" => "0020", + "0.8.7g" => "0021" ); $hash_type_names = array( diff -Nru cacti-0.8.7e/include/global_constants.php cacti-0.8.7g/include/global_constants.php --- cacti-0.8.7e/include/global_constants.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/global_constants.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ $input_types, ), "input_string" => array( - "method" => "textbox", + "method" => "textarea", "friendly_name" => "Input String", "description" => "The data that is sent to the script, which includes the complete path to the script and input sources in <> brackets.", "value" => "|arg1:input_string|", + "textarea_rows" => "4", + "textarea_cols" => "60", + "class" => "textAreaNotes", "max_length" => "255", ), "id" => array( @@ -142,7 +145,8 @@ "friendly_name" => "Regular Expression Match", "description" => "If you want to require a certain regular expression to be matched againt input data, enter it here (ereg format).", "value" => "|arg1:regexp_match|", - "max_length" => "200" + "max_length" => "200", + "size" => "70" ), "allow_nulls" => array( "method" => "checkbox", @@ -155,7 +159,7 @@ "type_code" => array( "method" => "textbox", "friendly_name" => "Special Type Code", - "description" => "If this field should be treated specially by host templates, indicate so here. Valid keywords for this field are 'hostname', 'snmp_community', 'snmp_username', 'snmp_password', 'snmp_auth_protocol', 'snmp_priv_passphrase', 'snmp_priv_protocol', 'snmp_port', 'snmp_timeout', and 'snmp_version'.", + "description" => "If this field should be treated specially by host templates, indicate so here. Valid keywords for this field are " . (str_replace(")", "'", str_replace("(", "'", str_replace("|", "', '", VALID_HOST_FIELDS)))), "value" => "|arg1:type_code|", "max_length" => "40" ), @@ -942,6 +946,7 @@ "friendly_name" => "Description", "description" => "A description for this data query.", "value" => "|arg1:description|", + "size" => "80", "max_length" => "255", ), "xml_path" => array( @@ -950,6 +955,7 @@ "description" => "The full path to the XML file containing definitions for this data query.", "value" => "|arg1:xml_path|", "default" => "/resource/", + "size" => "80", "max_length" => "255", ), "data_input_id" => array( diff -Nru cacti-0.8.7e/include/global.php cacti-0.8.7g/include/global.php --- cacti-0.8.7e/include/global.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/global.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ diff -Nru cacti-0.8.7e/include/global_settings.php cacti-0.8.7g/include/global_settings.php --- cacti-0.8.7e/include/global_settings.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/global_settings.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ "255" ), "path_rrdtool_default_font" => array( - "friendly_name" => "RRDTool Default Font Path", - "description" => "The path to the rrdtool default true type font for version 1.2 and above.", - "method" => "filepath", + "friendly_name" => "RRDTool Default Font", + "description" => "For RRDtool 1.2, the path to the True Type Font File." . "
    " . + "For RRDtool 1.3 and above, the font name conforming to the pango naming convention:" . "
    " . + 'You can to use the full Pango syntax when selecting your font: The font name has the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, variant, weight, stretch, or gravity, and SIZE is a decimal number (size in points) or optionally followed by the unit modifier "px" for absolute size. Any one of the options may be absent.', + "method" => "font", "max_length" => "255" ), "path_php_binary" => array( @@ -197,7 +199,7 @@ "friendly_name" => "RRDTool Utility Version", "description" => "The version of RRDTool that you have installed.", "method" => "drop_array", - "default" => "rrd-1.0.x", + "default" => "rrd-1.2.x", "array" => $rrdtool_versions, ), "snmp_header" => array( @@ -208,7 +210,7 @@ "friendly_name" => "SNMP Version", "description" => "Default SNMP version for all new hosts.", "method" => "drop_array", - "default" => "Version 1", + "default" => "1", "array" => $snmp_versions, ), "snmp_community" => array( @@ -589,8 +591,11 @@ ), "title_font" => array( "friendly_name" => "Title Font File", - "description" => "The font file to use for Graph Titles", - "method" => "filepath", + "description" => "The font to use for Graph Titles" . "
    " . + "For RRDtool 1.2, the path to the True Type Font File." . "
    " . + "For RRDtool 1.3 and above, the font name conforming to the pango naming convention:" . "
    " . + 'You can to use the full Pango syntax when selecting your font: The font name has the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, variant, weight, stretch, or gravity, and SIZE is a decimal number (size in points) or optionally followed by the unit modifier "px" for absolute size. Any one of the options may be absent.', + "method" => "font", "max_length" => "100" ), "legend_size" => array( @@ -604,7 +609,7 @@ "legend_font" => array( "friendly_name" => "Legend Font File", "description" => "The font file to be used for Graph Legend items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ), "axis_size" => array( @@ -618,7 +623,7 @@ "axis_font" => array( "friendly_name" => "Axis Font File", "description" => "The font file to be used for Graph Axis items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ), "unit_size" => array( @@ -632,7 +637,7 @@ "unit_font" => array( "friendly_name" => "Unit Font File", "description" => "The font file to be used for Graph Unit items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ) ), @@ -714,7 +719,7 @@ ), "max_get_size" => array( "friendly_name" => "The Maximum SNMP OID's Per SNMP Get Request", - "description" => "The maximum number of snmp get OID's to issue per snmpbulkwalk request. Increasing this value speeds poller performance over slow links. The maximum value is 60 OID's. Decreasing this value to 0 or 1 will disable snmpbulkwalk", + "description" => "The maximum number of snmp get OID's to issue per snmpbulkwalk request. Increasing this value speeds poller performance over slow links. The maximum value is 100 OID's. Decreasing this value to 0 or 1 will disable snmpbulkwalk", "method" => "textbox", "default" => "10", "max_length" => "10", @@ -1140,7 +1145,7 @@ "title_font" => array( "friendly_name" => "Title Font File", "description" => "The font file to use for Graph Titles", - "method" => "filepath", + "method" => "font", "max_length" => "100" ), "legend_size" => array( @@ -1153,7 +1158,7 @@ "legend_font" => array( "friendly_name" => "Legend Font File", "description" => "The font file to be used for Graph Legend items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ), "axis_size" => array( @@ -1166,7 +1171,7 @@ "axis_font" => array( "friendly_name" => "Axis Font File", "description" => "The font file to be used for Graph Axis items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ), "unit_size" => array( @@ -1179,7 +1184,7 @@ "unit_font" => array( "friendly_name" => "Unit Font File", "description" => "The font file to be used for Graph Unit items", - "method" => "filepath", + "method" => "font", "max_length" => "100" ) ) diff -Nru cacti-0.8.7e/include/jscalendar/calendar.js cacti-0.8.7g/include/jscalendar/calendar.js --- cacti-0.8.7e/include/jscalendar/calendar.js 2007-10-31 00:48:09.000000000 +0000 +++ cacti-0.8.7g/include/jscalendar/calendar.js 2009-12-30 05:36:40.000000000 +0000 @@ -12,7 +12,7 @@ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ -// $Id: calendar.js 3686 2006-08-01 03:27:58Z iberry $ +// $Id$ /** The Calendar object constructor. */ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { diff -Nru cacti-0.8.7e/include/jscalendar/calendar-setup.js cacti-0.8.7g/include/jscalendar/calendar-setup.js --- cacti-0.8.7e/include/jscalendar/calendar-setup.js 2007-10-31 00:48:09.000000000 +0000 +++ cacti-0.8.7g/include/jscalendar/calendar-setup.js 2009-12-30 05:36:40.000000000 +0000 @@ -19,7 +19,7 @@ * than modifying calendar.js itself). */ -// $Id: calendar-setup.js 3686 2006-08-01 03:27:58Z iberry $ +// $Id$ /** * This function "patches" an input field (or other element) to use a calendar diff -Nru cacti-0.8.7e/include/layout.js cacti-0.8.7g/include/layout.js --- cacti-0.8.7e/include/layout.js 2009-02-11 22:49:04.000000000 +0000 +++ cacti-0.8.7g/include/layout.js 2010-05-09 15:04:19.000000000 +0000 @@ -1,6 +1,6 @@ /* +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2009 The Cacti Group | + | Copyright (C) 2004-2010 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | @@ -23,23 +23,21 @@ /* graph template stuff */ function gt_update_selection_indicators() { - if (document.getElementById) { - there_are_any_unchecked_ones = false; + there_are_any_unchecked_ones = false; - for (var j = 0; j < document.chk.elements.length; j++) { - if (document.chk.elements[j].name.substr(0,3) == 'cg_') { - if (document.chk.elements[j].checked == false) { - there_are_any_unchecked_ones = true; - } + for (var j = 0; j < document.chk.elements.length; j++) { + if (document.chk.elements[j].name.substr(0,3) == 'cg_') { + if (document.chk.elements[j].checked == false) { + there_are_any_unchecked_ones = true; + } - if (!isNaN(document.chk.elements[j].name.substr(3))) { - lineid = document.getElementById('gt_line' + document.chk.elements[j].name.substr(3)); + if (!isNaN(document.chk.elements[j].name.substr(3))) { + lineid = document.getElementById('gt_line' + document.chk.elements[j].name.substr(3)); - if (document.chk.elements[j].checked) { - lineid.style.backgroundColor = 'khaki'; - }else{ - lineid.style.backgroundColor = ''; - } + if (document.chk.elements[j].checked) { + lineid.style.backgroundColor = 'khaki'; + }else{ + lineid.style.backgroundColor = ''; } } } @@ -49,14 +47,9 @@ function gt_select_line(graph_template_id, update) { if (gt_is_disabled(graph_template_id)) { return; } - if (document.getElementById) { - msgid = document.getElementById('cg_' + graph_template_id); - lineid = document.getElementById('gt_line'+ graph_template_id); - - if (!update) msgid.checked = !msgid.checked; - - gt_update_selection_indicators(); - } + msgid = document.getElementById('cg_' + graph_template_id); + if (!update) msgid.checked = !msgid.checked; + gt_update_selection_indicators(); } function gt_is_disabled(graph_template_id) { @@ -75,7 +68,9 @@ for (var i = 0; i < gt_created_graphs.length; i++) { for (var j = 0; j < num_columns; j++) { lineid = document.getElementById('gt_text' + gt_created_graphs[i] + '_' + j); - lineid.style.color = '999999'; + if (lineid) { + lineid.style.color = '#999999'; + } } chkbx = document.getElementById('cg_' + gt_created_graphs[i]); @@ -83,7 +78,9 @@ chkbx.checked = false; lineid = document.getElementById('gt_line' + gt_created_graphs[i]); - lineid.style.backgroundColor = ''; + if (lineid) { + lineid.style.backgroundColor = ''; + } } } @@ -94,7 +91,9 @@ if (document.chk.elements[i].name.substr( 0, prefix.length ) == prefix) { for (var j = 0; j < num_columns; j++) { lineid = document.getElementById('gt_text' + document.chk.elements[i].name.substr(prefix.length) + '_' + j); - lineid.style.color = '000000'; + if (lineid) { + lineid.style.color = '#000000'; + } } chkbx = document.getElementById('cg_' + document.chk.elements[i].name.substr(prefix.length)); @@ -105,17 +104,16 @@ /* general id based selects */ function update_selection_indicators() { - if (document.getElementById) { - there_are_any_unchecked_ones = false; - - for (var j = 0; j < document.chk.elements.length; j++) { - if( document.chk.elements[j].name.substr( 0, 4 ) == 'chk_') { - if (document.chk.elements[j].checked == false) { - there_are_any_unchecked_ones = true; - } + there_are_any_unchecked_ones = false; - lineid = document.getElementById('line'+ document.chk.elements[j].name.substr(4)); + for (var j = 0; j < document.chk.elements.length; j++) { + if( document.chk.elements[j].name.substr( 0, 4 ) == 'chk_') { + if (document.chk.elements[j].checked == false) { + there_are_any_unchecked_ones = true; + } + lineid = document.getElementById('line'+ document.chk.elements[j].name.substr(4)); + if (lineid) { if (document.chk.elements[j].checked) { lineid.style.backgroundColor = 'khaki'; }else{ @@ -127,29 +125,23 @@ } function select_line(id, update) { - if (document.getElementById) { - msgid = document.getElementById('chk_' + id); - lineid = document.getElementById('line'+ id); - - if (!update) msgid.checked = !msgid.checked; - - update_selection_indicators(); - } + msgid = document.getElementById('chk_' + id); + if (!update) msgid.checked = !msgid.checked; + update_selection_indicators(); } /* data query stuff */ function dq_update_selection_indicators() { - if (document.getElementById) { - there_are_any_unchecked_ones = false; - - for (var j = 0; j < document.chk.elements.length; j++) { - if( document.chk.elements[j].name.substr( 0, 3 ) == 'sg_') { - if (document.chk.elements[j].checked == false) { - there_are_any_unchecked_ones = true; - } + there_are_any_unchecked_ones = false; - lineid = document.getElementById('line'+ document.chk.elements[j].name.substr(3)); + for (var j = 0; j < document.chk.elements.length; j++) { + if( document.chk.elements[j].name.substr( 0, 3 ) == 'sg_') { + if (document.chk.elements[j].checked == false) { + there_are_any_unchecked_ones = true; + } + lineid = document.getElementById('line'+ document.chk.elements[j].name.substr(3)); + if (lineid) { if (document.chk.elements[j].checked) { lineid.style.backgroundColor = 'khaki'; }else{ @@ -163,14 +155,12 @@ function dq_select_line(snmp_query_id, snmp_index, update) { if (dq_is_disabled(snmp_query_id, snmp_index)) { return; } - if (document.getElementById) { - msgid = document.getElementById('sg_' + snmp_query_id + '_' + snmp_index); - lineid = document.getElementById('line'+ snmp_query_id + '_' + snmp_index); + msgid = document.getElementById('sg_' + snmp_query_id + '_' + snmp_index); + lineid = document.getElementById('line'+ snmp_query_id + '_' + snmp_index); - if (!update) msgid.checked = !msgid.checked; + if (!update) msgid.checked = !msgid.checked; - dq_update_selection_indicators(); - } + dq_update_selection_indicators(); } function dq_is_disabled(snmp_query_id, snmp_index) { @@ -195,7 +185,7 @@ for (var i = 0; i < created_graphs[snmp_query_graph_id].length; i++) { for (var j = 0; j < num_columns; j++) { lineid = document.getElementById('text' + snmp_query_id + '_' + created_graphs[snmp_query_graph_id][i] + '_' + j); - if ( lineid ) { lineid.style.color = '999999' }; + if ( lineid ) { lineid.style.color = '#999999' }; } chkbx = document.getElementById('sg_' + snmp_query_id + '_' + created_graphs[snmp_query_graph_id][i]); @@ -216,7 +206,7 @@ if (document.chk.elements[i].name.substr( 0, prefix.length ) == prefix) { for (var j = 0; j < num_columns; j++) { lineid = document.getElementById('text' + snmp_query_id + '_' + document.chk.elements[i].name.substr(prefix.length) + '_' + j); - lineid.style.color = '000000'; + lineid.style.color = '#000000'; } chkbx = document.getElementById('sg_' + snmp_query_id + '_' + document.chk.elements[i].name.substr(prefix.length)); @@ -233,11 +223,12 @@ if (prefix == "chk_") { lineid = document.getElementById('line'+ document.chk.elements[i].name.substr(4)); - - if (document.chk.elements[i].checked) { - if ( lineid ) { lineid.style.backgroundColor = 'khaki'; } - }else{ - if ( lineid ) { lineid.style.backgroundColor = ''; } + if (lineid) { + if (document.chk.elements[i].checked) { + if ( lineid ) { lineid.style.backgroundColor = 'khaki'; } + }else{ + if ( lineid ) { lineid.style.backgroundColor = ''; } + } } } } @@ -252,3 +243,80 @@ } } +/* calendar stuff */ +// Initialize the calendar +var calendar=null; + +// This function displays the calendar associated to the input field 'id' +function showCalendar(id) { + var el = document.getElementById(id); + if (calendar != null) { + // we already have some calendar created + calendar.hide(); // so we hide it first. + } else { + // first-time call, create the calendar. + var cal = new Calendar(true, null, selected, closeHandler); + cal.weekNumbers = false; // Do not display the week number + cal.showsTime = true; // Display the time + cal.time24 = true; // Hours have a 24 hours format + cal.showsOtherMonths = false; // Just the current month is displayed + calendar = cal; // remember it in the global var + cal.setRange(1900, 2070); // min/max year allowed. + cal.create(); + } + + calendar.setDateFormat('%Y-%m-%d %H:%M'); // set the specified date format + calendar.parseDate(el.value); // try to parse the text in field + calendar.sel = el; // inform it what input field we use + + // Display the calendar below the input field + calendar.showAtElement(el, "Br"); // show the calendar + + return false; +} + +// This function update the date in the input field when selected +function selected(cal, date) { + cal.sel.value = date; // just update the date in the input field. +} + +// This function gets called when the end-user clicks on the 'Close' button. +// It just hides the calendar without destroying it. +function closeHandler(cal) { + cal.hide(); // hide the calendar + calendar = null; +} + +/* graph filtering */ +function applyTimespanFilterChange(objForm) { + strURL = '?predefined_timespan=' + objForm.predefined_timespan.value; + strURL = strURL + '&predefined_timeshift=' + objForm.predefined_timeshift.value; + document.location = strURL; +} + +function applyGraphPreviewFilterChange(objForm) { + strURL = '?action=preview'; + strURL = strURL + '&host_id=' + objForm.host_id.value; + strURL = strURL + '&graph_template_id=' + objForm.graph_template_id.value; + strURL = strURL + '&filter=' + objForm.filter.value; + document.location = strURL; +} + +function applyGraphListFilterChange(objForm) { + strURL = 'graph_view.php?action=list&page=1'; + strURL = strURL + '&host_id=' + objForm.host_id.value; + strURL = strURL + '&rows=' + objForm.rows.value; + strURL = strURL + '&graph_template_id=' + objForm.graph_template_id.value; + strURL = strURL + '&filter=' + objForm.filter.value; + strURL = strURL + url_graph(''); + document.location = strURL; + return false; +} + +function cactiReturnTo(location) { + if (location != "") { + document.location = location; + }else{ + document.history.back(); + } +} \ No newline at end of file diff -Nru cacti-0.8.7e/include/main.css cacti-0.8.7g/include/main.css --- cacti-0.8.7e/include/main.css 2007-10-31 00:48:09.000000000 +0000 +++ cacti-0.8.7g/include/main.css 2010-05-05 23:28:38.000000000 +0000 @@ -6,6 +6,7 @@ } body { + margin: 0px; background-color: #FFFFFF; background-repeat: repeat-y; } @@ -120,19 +121,25 @@ /* tabs */ td.tab { - border-top: 1px solid #999; - border-right: 1px solid #666; - border-left: 1px solid #999; - border-bottom: none; - border-radius: 2px; - -moz-border-radius: 2px; + border-top: 1px solid #999; + border-right: 1px solid #666; + border-left: 1px solid #999; + border-bottom: none; + border-top-radius-right: 4px; + border-top-radius-left: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; } table.tabs { - border-top: none; - border-right: none; - border-left: none; - border-bottom: 1px solid #666; + border-top: none; + border-right: none; + border-left: none; + border-bottom: 1px solid #666; + border-top-radius-right: 4px; + border-top-radius-left: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; } /* The main calendar widget. DIV containing a table. */ @@ -140,19 +147,19 @@ div.calendar { position: relative; } .calendar, .calendar table { - border: 1px solid #556; - font-size: 11px; - color: #000; - cursor: default; - background: #eef; - font-family: tahoma,verdana,sans-serif; + border: 1px solid #556; + font-size: 11px; + color: #000; + cursor: default; + background: #eef; + font-family: tahoma,verdana,sans-serif; } /* Header part -- contains navigation buttons and day names. */ .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - padding: 2px; /* Make the buttons seem like they're pressing */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ } .calendar .nav { diff -Nru cacti-0.8.7e/include/top_graph_header.php cacti-0.8.7g/include/top_graph_header.php --- cacti-0.8.7e/include/top_graph_header.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/include/top_graph_header.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ + - Cacti - \r\n"; - }else{ - print "\r\n"; - } + <?php echo draw_navigation_text("title");?> + \r\n"; + }else{ + print "\r\n"; } ?> - + + @@ -72,11 +75,10 @@ - + - - - +
    + - + - +
    @@ -84,23 +86,23 @@  Console" alt="Graphs" align="absmiddle" border="0"> 
    - Settings';}?>  .gif" border="0" title="Tree View" alt="Tree View" align="absmiddle">.gif" border="0" title="List View" alt="List View" align="absmiddle">.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"> 
    + Settings';}?>  ">.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle">.gif" border="0" title="List View" alt="List View" align="absmiddle">.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"> 
    -
    +
    - - - - - + - -
    - + @@ -112,50 +114,51 @@
    - " height="2" border="0">
    +
    + " style="height:2px;" border="0">
    +
    +
    -
    + +
    +
    "; }?> - - + - + - + - + - " else - leftSide = leftSide + "" + leftSide = leftSide + "" this.isRendered = 1 @@ -411,7 +411,7 @@ } else { - leftSide = leftSide + "" + leftSide = leftSide + "" } docW = docW + this.blockStartHTML("item") @@ -559,7 +559,7 @@ { if (leftSideCoded.charAt(i) == "1") { - retStr = retStr + "" + retStr = retStr + "" } if (leftSideCoded.charAt(i) == "0") { diff -Nru cacti-0.8.7e/include/treeview/ftiens4.js cacti-0.8.7g/include/treeview/ftiens4.js --- cacti-0.8.7e/include/treeview/ftiens4.js 2007-10-31 00:48:08.000000000 +0000 +++ cacti-0.8.7g/include/treeview/ftiens4.js 2010-05-05 23:28:38.000000000 +0000 @@ -132,7 +132,7 @@ if (this.isLastNode) //the last child in the children array leftSide = leftSide + "" else - leftSide = leftSide + "" + leftSide = leftSide + "" this.isRendered = 1 @@ -411,7 +411,7 @@ } else { - leftSide = leftSide + "" + leftSide = leftSide + "" } docW = docW + this.blockStartHTML("item") @@ -559,7 +559,7 @@ { if (leftSideCoded.charAt(i) == "1") { - retStr = retStr + "" + retStr = retStr + "" } if (leftSideCoded.charAt(i) == "0") { diff -Nru cacti-0.8.7e/include/zoom.js cacti-0.8.7g/include/zoom.js --- cacti-0.8.7e/include/zoom.js 2007-10-31 00:48:09.000000000 +0000 +++ cacti-0.8.7g/include/zoom.js 2010-05-15 14:36:39.000000000 +0000 @@ -31,7 +31,6 @@ var cURLBase = "graph.php?action=zoom"; // Global variables -var gZoomGraphName = "zoomGraphImage"; var gZoomGraphObj; var gMouseObj; var gUrlObj; @@ -122,7 +121,6 @@ // alert ("Button Pressed"); if (gBrowserObj.browser == "IE") { LeftButtonPressed = (this.event.button < 2); - // alert ("Net"); } else { LeftButtonPressed = (this.event.which < 2); } @@ -139,7 +137,6 @@ if ((this.event.button >= 2) && (this.event.button != 4)) { RightButtonPressed = true; } - // alert ("Net"); } else { if (this.event.which > 2) { RightButtonPressed = true; @@ -154,7 +151,7 @@ function mouseObjGetCurrentPosition() { this.currentX = this.event.clientX + document.body.scrollLeft; this.currentY = this.event.clientY + document.body.scrollTop; -// alert (this.currentX + "\n" + this.currentY); + // alert (this.currentX + "\n" + this.currentY); } /*+++++++++++++++++ mouseObjSaveCurrentToStartPosition ++++++++++++++++++++*/ @@ -215,52 +212,33 @@ /*+++++++++++++++++++++++++++ zoomGraphObjRefresh +++++++++++++++++++++++++*/ function zoomGraphObjRefresh() { - // constants - var cZoomBoxName = "zoomBox"; - var titleFontSize = parseInt(gUrlObj.getUrlParameterValue("title_font_size")); if (titleFontSize == 0) { var cZoomBoxTopOffsetWOText = 15 - 1; var cZoomBoxTopOffsetWText = 32 - 1; - var cZoomBoxRightOffset = -16; + var cZoomBoxRightOffset = 16; } else { var cZoomBoxTopOffsetWOText = 10 - 1; var cZoomBoxTopOffsetWText = titleFontSize + (titleFontSize * 1.6) + 10 - 1; - var cZoomBoxRightOffset = -28; + var cZoomBoxRightOffset = 28; } // zone outside of Zoom box where user can move cursor to without causing odd behavior - var cZoomSensitiveZoneName = "zoomSensitiveZone"; - var cZoomSensitiveZoneOffset = 30; + var cZoomSensitiveZoneOffset = 5; + + var imgObject = this.imgObject; + var imgAlt = imgObject.alt; - // variables - var imgObject; - // var imgSource; - var imgAlt; - - var divObject; - - var left; - var top; - var width; - var height; - - // zoomable selection area Width and Height - var zoomBoxWidth; - var zoomBoxHeight; - - imgObject = this.imgObject; - //imgSource = imgObject.src; - imgAlt = imgObject.alt; - - // determine the overall graph size - width = imgObject.width; - height = imgObject.height; + // get the graph area size from the url + var imageWidth = imgObject.clientWidth; + var imageHeight = imgObject.clientHeight; + //alert("Overall Image Dimensions:"+imageWidth+", "+imageHeight); // get the graph area size from the url - zoomBoxWidth = parseInt(gUrlObj.getUrlParameterValue("graph_width")) + 1; - zoomBoxHeight = parseInt(gUrlObj.getUrlParameterValue("graph_height")) + 1; + var graphWidth = parseInt(gUrlObj.getUrlParameterValue("graph_width")) + 1; + var graphHeight = parseInt(gUrlObj.getUrlParameterValue("graph_height")) + 1; + //alert("Inside Image Dimensions:"+zoomBoxWidth+", "+zoomBoxHeight); // Get absolute image position relative to the overall window. // @@ -268,24 +246,25 @@ // ancestory of elements (tables, div's, spans, etc...) until // we're at the top of the display. Along the way we add in each element's // coordinates to get absolute image postion. - left = 0; - top = 0; + var imageLeft = 0; + var imageTop = 0; do { - left += imgObject.offsetLeft; - top += imgObject.offsetTop; + imageLeft += imgObject.offsetLeft; + imageTop += imgObject.offsetTop; imgObject = imgObject.offsetParent; } while(imgObject); // set the images's Ix1,Iy1 and Ix2,Iy2 postions based upon results - this.zoomGraphLeft = left; - this.zoomGraphTop = top; - this.zoomGraphRight = left + width; - this.zoomGraphBottom = top + height; - this.zoomGraphWidth = width; - this.zoomGraphHeight = height; + this.zoomGraphLeft = imageLeft; + this.zoomGraphTop = imageTop; + this.zoomGraphRight = imageLeft + imageWidth; + this.zoomGraphBottom = imageTop + imageHeight; + this.zoomGraphWidth = imageWidth; + this.zoomGraphHeight = imageHeight; + //alert("Image Position (x,y):("+imageLeft+','+imageTop+') x ('+this.zoomGraphRight+', '+this.zoomGraphBottom+')'); // calculate the right hand coordinate (rrdGAx2) of the zoom box (aka rrd Graph area) - this.zoomBoxRight = this.zoomGraphRight + cZoomBoxRightOffset; + this.zoomBoxRight = this.zoomGraphRight - cZoomBoxRightOffset; // calculate the top coordinate (rrdGAy2) of the zoom box (aka rrd Graph area) if(imgAlt == "") { @@ -295,23 +274,24 @@ } // calculate the left hand coordinate (rrdGAx1) of the zoom box (aka rrd Graph area) - this.zoomBoxLeft = this.zoomBoxRight - zoomBoxWidth; + this.zoomBoxLeft = this.zoomBoxRight - graphWidth; // calculate the bottom coordinate (rrdGAy1) of the zoom box (aka rrd Graph area) - this.zoomBoxBottom = this.zoomBoxTop + zoomBoxHeight; + this.zoomBoxBottom = this.zoomBoxTop + graphHeight; + //alert("ZoomBox Position (x,y):("+this.zoomBoxLeft+', '+this.zoomBoxTop+') x ('+this.zoomBoxRight+', '+this.zoomBoxBottom+')'); // set the objects zoom sizes from the url values (aka rrd Graph size) - this.zoomBoxWidth = zoomBoxWidth; - this.zoomBoxHeight = zoomBoxHeight; + this.zoomBoxWidth = graphWidth; + this.zoomBoxHeight = graphHeight; // this.drawSelection(this.zoomBoxLeft, this.zoomBoxTop, this.zoomBoxRight, this.zoomBoxBottom); this.drawSelection(0, 0, 0, 0); // reset selection - divObject = document.getElementById(cZoomBoxName); - divObject.style.left = this.zoomBoxLeft; - divObject.style.top = this.zoomBoxTop; - divObject.style.width = this.zoomBoxWidth; - divObject.style.height = this.zoomBoxHeight; + var zoomBox = document.getElementById("zoomBox"); + zoomBox.style.left = this.zoomBoxLeft+'px'; + zoomBox.style.top = this.zoomBoxTop+'px'; + zoomBox.style.width = this.zoomBoxWidth+'px'; + zoomBox.style.height = this.zoomBoxHeight+'px'; // allow the crosshair to extend outside of the Graph area without graphical glitches this.zoomSensitiveZoneLeft = this.zoomBoxLeft - cZoomSensitiveZoneOffset; @@ -321,19 +301,16 @@ this.zoomSensitiveZoneWidth = this.zoomSensitiveZoneRight - this.zoomSensitiveZoneLeft; this.zoomSensitiveZoneHeight = this.zoomSensitiveZoneBottom - this.zoomSensitiveZoneTop; - divObject = document.getElementById(cZoomSensitiveZoneName); - divObject.style.left = this.zoomSensitiveZoneLeft; - divObject.style.top = this.zoomSensitiveZoneTop; - divObject.style.width = this.zoomSensitiveZoneWidth; - divObject.style.height = this.zoomSensitiveZoneHeight; + var zoomZone = document.getElementById("zoomSensitiveZone"); + zoomZone.style.left = this.zoomSensitiveZoneLeft+'px'; + zoomZone.style.top = this.zoomSensitiveZoneTop+'px'; + zoomZone.style.width = this.zoomSensitiveZoneWidth+'px'; + zoomZone.style.height = this.zoomSensitiveZoneHeight+'px'; } /*++++++++++++++++++++++ zoomGraphObjDrawSelection ++++++++++++++++++++++++*/ function zoomGraphObjDrawSelection (x1, y1, x2, y2) { - var cZoomBoxName = "zoomBox"; - var divObject; - x1 = x1 - this.zoomBoxLeft; x2 = x2 - this.zoomBoxLeft; y1 = y1 - this.zoomBoxTop; @@ -344,8 +321,21 @@ var minY = Math.min(y1, y2); var maxY = Math.max(y1, y2) + 1; - divObject = document.getElementById(cZoomBoxName); - divObject.style.clip ="rect(" + minY + "px " + maxX + "px " + maxY + "px " + minX + "px)"; + /* check for upper bounds */ + if (maxX > this.zoomBoxWidth) { + maxX = this.zoomBoxWidth; + } + + if (maxY > this.zoomBoxHeight) { + maxY = this.zoomBoxHeight; + } + + var divObject = document.getElementById("dragBox"); + divObject.style.top = this.zoomBoxTop+minY+"px"; + divObject.style.left = this.zoomBoxLeft+minX+"px"; + divObject.style.width = maxX-minX+"px"; + divObject.style.height = maxY-minY+"px"; +// divObject.style.clip ="rect(" + minY + "px " + maxX + "px " + maxY + "px " + minX + "px)"; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -392,18 +382,19 @@ this.majorver = ""; this.minorver = ""; - uaLen = ua.length; + if (ua) { + var uaLen = ua.length; + var i = ua.indexOf("("); + } // ##### split into stuff before parens and stuff in parens var preparens = ""; var parenthesized = ""; - i = ua.indexOf("("); - if (i >= 0) { preparens = Trim(ua.substring(0,i)); parenthesized = ua.substring(i+1, uaLen); - j = parenthesized.indexOf(")"); + var j = parenthesized.indexOf(")"); if (j >= 0) { parenthesized = parenthesized.substring(0, j); } @@ -489,10 +480,10 @@ function initBonsai() { gBrowserObj = new BrowserDetector(navigator.userAgent); - // alert("Browser: " + gBrowserObj.browser + "\nPlatform: " + gBrowserObj.platform + "\nVersion: " + gBrowserObj.version + "\nMajorVer: " + gBrowserObj.majorver + "\nMinorVer: " + gBrowserObj.minorver); + //alert("Browser: " + gBrowserObj.browser + "\nPlatform: " + gBrowserObj.platform + "\nVersion: " + gBrowserObj.version + "\nMajorVer: " + gBrowserObj.majorver + "\nMinorVer: " + gBrowserObj.minorver); // gUrlObj = new urlObj(document.URL); - gZoomGraphObj = new zoomGraphObj(gZoomGraphName); + gZoomGraphObj = new zoomGraphObj("zoomGraphImage"); gMouseObj = new mouseObj(); initEvents(); } @@ -514,16 +505,16 @@ /*++++++++++++++++++++++++++++ initEvents +++++++++++++++++++++++++++++++++*/ function initEvents() { - document.onmousemove = onMouseMouveEvent; - document.onmousedown = onMouseDownEvent; - document.onmouseup = onMouseUpEvent; - window.onresize = windowOnResizeEvent; + object = document.getElementById("zoomSensitiveZone"); - if (gBrowserObj.browser == "Netscape") { - document.captureEvents(Event.MOUSEMOVE); - document.captureEvents(Event.MOUSEDOWN); - document.captureEvents(Event.MOUSEUP); + if (object) { + object.onmousemove = onMouseMoveEvent; + object.onmousedown = onMouseDownEvent; + object.onmouseup = onMouseUpEvent; } + + window.onresize = windowOnResizeEvent; + } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -542,14 +533,15 @@ gMouseObj.saveCurrentToStartPosition(); gZoomGraphObj.drawSelection(gMouseObj.currentX, gMouseObj.currentY, gMouseObj.currentX, gMouseObj.currentY); } else if (gMouseObj.rightButtonPressed()) { + e.preventDefault(); var test = true; } } } -/*+++++++++++++++++++++++++++ onMouseMouveEvent +++++++++++++++++++++++++++*/ +/*+++++++++++++++++++++++++++ onMouseMoveEvent +++++++++++++++++++++++++++*/ -function onMouseMouveEvent(e) { +function onMouseMoveEvent(e) { gMouseObj.setEvent(e); if (gMouseObj.dragging) { gMouseObj.getCurrentPosition(); @@ -663,6 +655,5 @@ window.onload = initBonsai; -// end of script -//--> +--> \ No newline at end of file diff -Nru cacti-0.8.7e/index.php cacti-0.8.7g/index.php --- cacti-0.8.7e/index.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/index.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ diff -Nru cacti-0.8.7e/install/0_8_7f_to_0_8_7g.php cacti-0.8.7g/install/0_8_7f_to_0_8_7g.php --- cacti-0.8.7e/install/0_8_7f_to_0_8_7g.php 1970-01-01 00:00:00.000000000 +0000 +++ cacti-0.8.7g/install/0_8_7f_to_0_8_7g.php 2010-07-09 22:33:46.000000000 +0000 @@ -0,0 +1,28 @@ + diff -Nru cacti-0.8.7e/install/0_8_7_to_0_8_7a.php cacti-0.8.7g/install/0_8_7_to_0_8_7a.php --- cacti-0.8.7e/install/0_8_7_to_0_8_7a.php 2009-06-28 16:07:11.000000000 +0000 +++ cacti-0.8.7g/install/0_8_7_to_0_8_7a.php 2010-07-09 22:33:46.000000000 +0000 @@ -1,7 +1,7 @@ 0) { - if (ereg("^RRDtool 1\.3", $out_array[0])) { - $input["rrdtool_version"]["default"] = "rrd-1.3.x"; + if (ereg("^RRDtool 1\.4", $out_array[0])) { + $input["rrdtool_version"]["default"] = "rrd-1.4.x"; + }else if (ereg("^RRDtool 1\.3\.", $out_array[0])) { + $input["rrdtool_version"]["default"] = "rrd-1.3.x"; }else if (ereg("^RRDtool 1\.2\.", $out_array[0])) { $input["rrdtool_version"]["default"] = "rrd-1.2.x"; }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) { @@ -429,14 +433,22 @@ }elseif ($cacti_versions[$i] == "0.8.7e") { include ("0_8_7d_to_0_8_7e.php"); upgrade_to_0_8_7e(); + }elseif ($cacti_versions[$i] == "0.8.7f") { + include ("0_8_7e_to_0_8_7f.php"); + upgrade_to_0_8_7f(); + }elseif ($cacti_versions[$i] == "0.8.7g") { + include ("0_8_7f_to_0_8_7g.php"); + upgrade_to_0_8_7g(); } } } ?> +cacti +
    @@ -50,17 +51,17 @@
    -
    +
    - - @@ -85,9 +86,9 @@
    - + @@ -72,10 +73,10 @@
    -
    +
    +
    +
    -
    +

    -
    +
    +
    diff -Nru cacti-0.8.7e/include/treeview/ftiens4_export.js cacti-0.8.7g/include/treeview/ftiens4_export.js --- cacti-0.8.7e/include/treeview/ftiens4_export.js 2007-10-31 00:48:08.000000000 +0000 +++ cacti-0.8.7g/include/treeview/ftiens4_export.js 2010-05-05 23:28:38.000000000 +0000 @@ -132,7 +132,7 @@ if (this.isLastNode) //the last child in the children array leftSide = leftSide + "
    " + auxEv + "" + auxEv + "" + auxEv + "" + auxEv + "" + auxEv + "" + auxEv + "