diff -Naur cacti-0.8.6j-old/auth_login.php cacti-0.8.6j/auth_login.php --- cacti-0.8.6j-old/auth_login.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/auth_login.php 2007-01-23 21:02:52.000000000 -0600 @@ -111,9 +111,16 @@ 'Location' does not work. This seems to fix the bug for me at least... -->
"> + + - + @@ -155,6 +162,8 @@ + + diff -Naur cacti-0.8.6j-old/data_sources.php cacti-0.8.6j/data_sources.php --- cacti-0.8.6j-old/data_sources.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/data_sources.php 2007-01-23 21:02:52.000000000 -0600 @@ -1072,18 +1072,25 @@ foreach ($data_sources as $data_source) { $data_template_name = ((empty($data_source["data_template_name"])) ? "None" : $data_source["data_template_name"]); form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++; + + $ds_table['data_source'] = $data_source; + $ds_table['data_input_name'] = $data_source['data_input_name']; + $ds_table['active'] = (($data_source["active"] == "on") ? "Yes" : "No"); + $ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "None" : $data_source["data_template_name"]); + $ds_table = do_hook_function("data_sources_table", $ds_table); + ?> @@ -208,6 +209,7 @@ @@ -239,6 +241,7 @@ @@ -259,4 +262,4 @@ include_once("./include/bottom_footer.php"); -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/graphs_new.php cacti-0.8.6j/graphs_new.php --- cacti-0.8.6j-old/graphs_new.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/graphs_new.php 2007-01-23 21:02:52.000000000 -0600 @@ -405,7 +405,8 @@ \n "; + } else { + $save['drp_action'] = $_POST['drp_action']; + $save['graph_list'] = $graph_list; + $save['graph_array'] = $graph_array; + do_hook_function('graphs_action_prepare', $save); } if (!isset($graph_array)) { @@ -1149,4 +1158,4 @@ print "\n"; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/host.php cacti-0.8.6j/host.php --- cacti-0.8.6j-old/host.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/host.php 2007-01-23 21:02:52.000000000 -0600 @@ -44,6 +44,8 @@ 5 => "Clear Statistics" ); +$device_actions = do_hook_function('device_action_array', $device_actions); + /* set default action */ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; } @@ -280,6 +282,8 @@ api_tree_item_save(0, $_POST["tree_id"], TREE_ITEM_TYPE_HOST, $_POST["tree_item_id"], "", 0, read_graph_config_option("default_rra_id"), $selected_items[$i], 1, 1, false); } + } else { + do_hook_function('device_action_execute', $_POST['drp_action']); } header("Location: host.php"); @@ -385,6 +389,11 @@ \n \n "; + } else { + $save['drp_action'] = $_POST['drp_action']; + $save['host_list'] = $host_list; + $save['host_array'] = (isset($host_array)? $host_array : array()); + do_hook_function('device_action_prepare', $save); } if (!isset($host_array)) { diff -Naur cacti-0.8.6j-old/include/auth.php cacti-0.8.6j/include/auth.php --- cacti-0.8.6j-old/include/auth.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/auth.php 2007-01-23 21:02:52.000000000 -0600 @@ -77,7 +77,7 @@ Cacti - + @@ -85,7 +85,7 @@
\\1", title_trim($data_source["name_cache"], read_config_option("max_title_data_source"))); }else{ print title_trim($data_source["name_cache"], read_config_option("max_title_data_source")); } ?> - \\1", $data_source["data_input_name"]); }else{ print $data_source["data_input_name"]; } ?> + \\1", $ds_table['data_input_name']); }else{ print $ds_table['data_input_name']; } ?> - No");?> + - \\1", $data_template_name); }else{ print $data_template_name; } ?> + \\1", $ds_table['template_name']); }else{ print $ds_table['template_name']; } ?> "> diff -Naur cacti-0.8.6j-old/graph_image.php cacti-0.8.6j/graph_image.php --- cacti-0.8.6j-old/graph_image.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/graph_image.php 2007-01-23 21:02:52.000000000 -0600 @@ -46,6 +46,8 @@ /* flush the headers now */ ob_end_flush(); +do_hook_function('graph_image'); + session_write_close(); $graph_data_array = array(); diff -Naur cacti-0.8.6j-old/graph.php cacti-0.8.6j/graph.php --- cacti-0.8.6j-old/graph.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/graph.php 2007-01-23 14:54:36.000000000 -0600 @@ -94,6 +94,7 @@ Zoom Graph
Graph Source/Properties + 'view', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $rra["id"], 'view_type' => $_REQUEST["view_type"])); ?>
Graph Source/Properties + 'zoom', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
Zoom Graph
+ 'properties', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
*">Edit this Host
- *Create New Host + *Create New Host
+
diff -Naur cacti-0.8.6j-old/graphs.php cacti-0.8.6j/graphs.php --- cacti-0.8.6j-old/graphs.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/graphs.php 2007-01-23 21:02:52.000000000 -0600 @@ -47,6 +47,8 @@ 4 => "Convert to Graph Template" ); +$graph_actions = do_hook_function('graphs_action_array', $graph_actions); + /* set default action */ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; } @@ -357,8 +359,10 @@ input_validate_input_number($selected_items[$i]); /* ==================================================== */ - api_resize_graphs($selected_items[$i], $_POST["graph_width"], $_POST["graph_height"]); + api_resize_graphs($selected_items[$i], $_POST['graph_width'], $_POST['graph_height']); } + } else { + do_hook_function('graphs_action_execute', $_POST['drp_action']); } header("Location: graphs.php"); @@ -499,6 +503,11 @@
- + @@ -93,7 +93,7 @@ need access to this particular section, please contact the Cacti administrator. - +
Access Deniedimages/auth_deny.gif' border='0' alt='Access Denied'>
( Return | Login )( Return | logout.php'>Login )
diff -Naur cacti-0.8.6j-old/include/config_arrays.php cacti-0.8.6j/include/config_arrays.php --- cacti-0.8.6j-old/include/config_arrays.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/config_arrays.php 2007-01-23 21:02:52.000000000 -0600 @@ -24,6 +24,8 @@ +-------------------------------------------------------------------------+ */ +global $menu; + $messages = array( 1 => array( "message" => 'Save Successful.', @@ -452,4 +454,10 @@ GDC_SLASH => "/" ); -?> +$plugin_architecture = array( + "version" => '1.1' + ); + +do_hook("config_arrays"); + +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/config_form.php cacti-0.8.6j/include/config_form.php --- cacti-0.8.6j-old/include/config_form.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/config_form.php 2007-01-23 21:02:52.000000000 -0600 @@ -25,7 +25,8 @@ */ if (!defined("VALID_HOST_FIELDS")) { - define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)"); + $string = do_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)'); + define("VALID_HOST_FIELDS", $string); } /* file: cdef.php, action: edit */ @@ -1000,4 +1001,6 @@ ) ); -?> +do_hook("config_form"); + +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/config.php cacti-0.8.6j/include/config.php --- cacti-0.8.6j-old/include/config.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/config.php 2007-01-23 21:02:52.000000000 -0600 @@ -32,6 +32,22 @@ $database_password = "cactiuser"; $database_port = "3306"; +$plugins = array(); +//$plugins[] = 'thold'; + +/* Do not edit this line */ +$config = array(); + + +/* + This is full URL Path to the Cacti installation + For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/' + as the url path. For just http://server/ use '/' +*/ + +$config['url_path'] = '/'; + + /* ----- you probably do not need to change anything below this line ----- */ /* Files that do not need http header information - Command line scripts */ @@ -52,7 +68,7 @@ "ss_sql.php" ); -$config = array(); + $colors = array(); /* this should be auto-detected, set it manually if needed */ @@ -66,6 +82,13 @@ $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__)); $config["include_path"] = dirname(__FILE__); +define('URL_PATH', $config['url_path']); + +/* include the plugin function, we do this before everything else, + incase we want to add hooks to change config options */ + +include_once($config["include_path"] . "/plugins.php"); + /* colors */ $colors["dark_outline"] = "454E53"; $colors["dark_bar"] = "AEB4B7"; @@ -169,4 +192,4 @@ /* current cacti version */ $config["cacti_version"] = "0.8.6j"; -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/config_settings.php cacti-0.8.6j/include/config_settings.php --- cacti-0.8.6j-old/include/config_settings.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/config_settings.php 2007-01-23 21:02:52.000000000 -0600 @@ -928,4 +928,6 @@ ) ); -?> +do_hook("config_settings"); + +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/plugins.php cacti-0.8.6j/include/plugins.php --- cacti-0.8.6j-old/include/plugins.php 1969-12-31 17:00:00.000000000 -0700 +++ cacti-0.8.6j/include/plugins.php 2007-01-23 21:02:52.000000000 -0600 @@ -0,0 +1,70 @@ + \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/top_graph_header.php cacti-0.8.6j/include/top_graph_header.php --- cacti-0.8.6j-old/include/top_graph_header.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/top_graph_header.php 2007-01-23 21:02:52.000000000 -0600 @@ -97,17 +97,18 @@ if ($_SESSION["custom"]) { print "\r\n"; }else{ - print "\r\n"; + $refresh = do_hook_function("top_graph_refresh", read_graph_config_option("page_refresh")); + print "\r\n"; } } ?> - + - - - - - + + + + + @@ -118,13 +119,14 @@ +  ConsoleGraphs 
-  ConsoleGraphs  - - + - 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"> 
@@ -132,7 +134,7 @@ -
+
@@ -144,7 +146,7 @@ - Logged in as (Logout)  + Logged in as (Logout @@ -152,10 +154,10 @@ - - " height="2" border="0">
+ + " height="2" border="0">
- + @@ -203,4 +205,4 @@ - + \ No newline at end of file diff -Naur cacti-0.8.6j-old/include/top_header.php cacti-0.8.6j/include/top_header.php --- cacti-0.8.6j-old/include/top_header.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/include/top_header.php 2007-01-23 21:02:52.000000000 -0600 @@ -24,20 +24,20 @@ +-------------------------------------------------------------------------+ */ -global $colors; +global $colors, $config; ?> cacti - - + + "; }?> - + @@ -45,10 +45,11 @@
+  ConsoleConsole
-  ConsoleGraphs - - +
@@ -56,7 +57,7 @@ -
+
@@ -68,7 +69,7 @@ - Logged in as (Logout)  + Logged in as (Logout @@ -76,10 +77,10 @@ - -
- - + +
+ + @@ -89,9 +90,9 @@ -
-

-
+
+

about.php'>

+
diff -Naur cacti-0.8.6j-old/index.php cacti-0.8.6j/index.php --- cacti-0.8.6j-old/index.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/index.php 2007-01-23 21:02:52.000000000 -0600 @@ -27,6 +27,8 @@ include("./include/auth.php"); include("./include/top_header.php"); +do_hook("console_before"); + ?> @@ -44,6 +46,8 @@
diff -Naur cacti-0.8.6j-old/lib/api_device.php cacti-0.8.6j/lib/api_device.php --- cacti-0.8.6j-old/lib/api_device.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/api_device.php 2007-01-23 21:02:52.000000000 -0600 @@ -76,6 +76,8 @@ $save["snmp_timeout"] = form_input_validate($snmp_timeout, "snmp_timeout", "^[0-9]+$", false, 3); $save["disabled"] = form_input_validate($disabled, "disabled", "", true, 3); + $save = do_hook_function("api_device_save", $save); + $host_id = 0; if (!is_error_message()) { @@ -123,4 +125,4 @@ return $host_id; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/functions.php cacti-0.8.6j/lib/functions.php --- cacti-0.8.6j-old/lib/functions.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/functions.php 2007-01-23 21:02:52.000000000 -0600 @@ -620,6 +620,8 @@ } } + do_hook_function("update_host_status", array('issue_log_message' => $issue_log_message, 'status' => $status, 'host_id' => $host_id, 'hosts' => $hosts)); + db_execute("update host set status = '" . $hosts[$host_id]["status"] . "', status_event_count = '" . $hosts[$host_id]["status_event_count"] . "', @@ -1323,6 +1325,7 @@ /* draw_navigation_text - determines the top header navigation text for the current page and displays it to the browser */ function draw_navigation_text() { + global $config; $nav_level_cache = (isset($_SESSION["sess_nav_level_cache"]) ? $_SESSION["sess_nav_level_cache"] : array()); $nav = array( @@ -1335,7 +1338,7 @@ "graph.php:zoom" => array("title" => "Zoom", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"), "graph.php:properties" => array("title" => "Properties", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"), "graph_settings.php:" => array("title" => "Settings", "mapping" => "graph_view.php:", "url" => "graph_settings.php", "level" => "1"), - "index.php:" => array("title" => "Console", "mapping" => "", "url" => "index.php", "level" => "0"), + "index.php:" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"), "graphs.php:" => array("title" => "Graph Management", "mapping" => "index.php:", "url" => "graphs.php", "level" => "1"), "graphs.php:graph_edit" => array("title" => "(Edit)", "mapping" => "index.php:,graphs.php:", "url" => "", "level" => "2"), "graphs.php:graph_diff" => array("title" => "Change Graph Template", "mapping" => "index.php:,graphs.php:,graphs.php:graph_edit", "url" => "", "level" => "3"), @@ -1410,6 +1413,8 @@ "templates_import.php:" => array("title" => "Import Templates", "mapping" => "index.php:", "url" => "templates_import.php", "level" => "1"), ); + $nav = do_hook_function("draw_navigation_text", $nav); + $current_page = basename($_SERVER["PHP_SELF"]); $current_action = (isset($_REQUEST["action"]) ? $_REQUEST["action"] : ""); @@ -1721,4 +1726,4 @@ return $string; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/html_form.php cacti-0.8.6j/lib/html_form.php --- cacti-0.8.6j-old/lib/html_form.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/html_form.php 2007-01-23 21:02:52.000000000 -0600 @@ -419,11 +419,13 @@ on a confirmation form @arg $cancel_url - the url to go to when the user clicks 'cancel' @arg $action_url - the url to go to when the user clicks 'delete' */ -function form_confirm_buttons($action_url, $cancel_url) { ?> +function form_confirm_buttons($action_url, $cancel_url) { + global $config; + ?> - Cancel - ">Delete + Cancel + ">Delete - Cancel - + images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'> + images/' alt='' align='absmiddle'> @@ -463,4 +466,4 @@ +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/html.php cacti-0.8.6j/lib/html.php --- cacti-0.8.6j-old/lib/html.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/html.php 2007-01-23 14:57:46.000000000 -0600 @@ -88,6 +88,7 @@ @arg $extra_url_args - extra arguments to append to the url @arg $header - html to use as a header */ function html_graph_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") { + global $config; $i = 0; if (sizeof($graph_array) > 0) { if ($header != "") { @@ -101,10 +102,11 @@
- <?php print $graph["title_cache"];?> + graph.php?action=view&local_graph_id=&rra_id=all'>graph_image.php?local_graph_id=&rra_id=0' border='0' alt=''> - Zoom Graph
+ graph.php?action=zoom&local_graph_id=&rra_id=0&'>images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'>
+ 'graphs', 'local_graph_id' => $graph["local_graph_id"], 'rra' => 0, 'view_type' => '')); ?>
@@ -130,6 +132,7 @@ @arg $extra_url_args - extra arguments to append to the url @arg $header - html to use as a header */ function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") { + global $config; $i = 0; $k = 0; if (sizeof($graph_array) > 0) { if ($header != "") { @@ -144,10 +147,11 @@
- <?php print $graph["title_cache"];?> + graph.php?action=view&rra_id=all&local_graph_id='>graph_image.php?local_graph_id=&rra_id=0&graph_height=&graph_width=&graph_nolegend=true' border='0' alt=''> - Zoom Graph
+ graph.php?action=zoom&local_graph_id=&rra_id=0&'>images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'>
+ 'thumbnails', 'local_graph_id' => $graph["local_graph_id"], 'rra' => 0, 'view_type' => '')); ?>
@@ -530,6 +534,8 @@ } while (list($item_sub_url, $item_sub_title) = each($item_title)) { + $item_sub_url = $config['url_path'] . $item_sub_url; + /* indent sub-items */ if ($i > 0) { $prepend_string = "--- "; @@ -539,7 +545,7 @@ /* do not put a line between each sub-item */ if (($i == 0) || ($draw_sub_items == false)) { - $background = "images/menu_line.gif"; + $background = $config['url_path'] . "images/menu_line.gif"; }else{ $background = ""; } @@ -568,17 +574,18 @@ }else{ if ((isset($user_realms[$current_realm_id])) || (!isset($user_auth_realm_filenames{basename($item_url)}))) { /* draw normal (non sub-item) menu item */ + $item_url = $config['url_path'] . $item_url; if (basename($_SERVER["PHP_SELF"]) == basename($item_url)) { - print "$item_title\n"; + print "$item_title\n"; }else{ - print "$item_title\n"; + print "$item_title\n"; } } } } } - print "\n"; + print "\n"; print ''; } @@ -588,18 +595,19 @@ @arg $actions_array - an array that contains a list of possible actions. this array should be compatible with the form_dropdown() function */ function draw_actions_dropdown($actions_array) { + global $config; ?>
-   + images/arrow.gif' alt='' align='absmiddle'>  Choose an action: - + images/button_go.gif' alt='Go'>
@@ -626,4 +634,4 @@ +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/html_tree.php cacti-0.8.6j/lib/html_tree.php --- cacti-0.8.6j-old/lib/html_tree.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/html_tree.php 2007-01-23 21:02:52.000000000 -0600 @@ -886,7 +886,7 @@ if (read_graph_config_option("thumbnail_section_tree_1") == "on") { if (read_graph_config_option("timespan_sel") == "on") { print "$graph_title\n"; /* if we are at the end of a row, start a new one */ @@ -895,7 +895,7 @@ } }else{ print "$graph_title\n"; /* if we are at the end of a row, start a new one */ @@ -905,10 +905,10 @@ } }else{ if (read_graph_config_option("timespan_sel") == "on") { - print "$graph_title"; + print "$graph_title"; print "\n"; }else{ - print "$graph_title"; + print "$graph_title"; print "\n"; } } @@ -978,4 +978,4 @@ return $html; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/poller.php cacti-0.8.6j/lib/poller.php --- cacti-0.8.6j-old/lib/poller.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/poller.php 2007-01-23 21:02:52.000000000 -0600 @@ -228,6 +228,12 @@ $limit = "LIMIT 10000"; } + if ($remainder) { + $limit = ""; + }else{ + $limit = "LIMIT 10000"; + } + /* create/update the rrd files */ $results = db_fetch_assoc("select poller_output.output, @@ -296,11 +302,14 @@ } } } + do_hook_function("poller_output", $rrd_update_array); - $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe); + if (do_hook_function("poller_on_demand", $results)) { + $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe); + } } return $rrds_processed; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/rrd.php cacti-0.8.6j/lib/rrd.php --- cacti-0.8.6j-old/lib/rrd.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/rrd.php 2007-01-23 21:02:52.000000000 -0600 @@ -471,6 +471,10 @@ } } + $data = do_hook_function("rrdtool_function_graph_cache_check", array('local_graph_id' => $local_graph_id,'rra_id' => $rra_id,'rrd_struc' => $rrd_struc,'graph_data_array' => $graph_data_array, 'return' => false)); + if (isset($data['return']) && $data['return'] != false) + return $data['return']; + /* find the step and how often this graph is updated with new data */ $ds_step = db_fetch_cell("select data_template_data.rrd_step @@ -1145,15 +1149,21 @@ rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, RRDTOOL_OUTPUT_NULL, $rrd_struc); return 0; }else{ + $graph_data_array = do_hook_function("prep_graph_array", $graph_data_array); + if (isset($graph_data_array["output_flag"])) { $output_flag = $graph_data_array["output_flag"]; }else{ $output_flag = RRDTOOL_OUTPUT_GRAPH_DATA; } - return rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrd_struc); + $output = rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrd_struc); + + do_hook_function("rrdtool_function_graph_set_file", array('output' => $output, 'local_graph_id' => $local_graph_id, 'rra_id' => $rra_id)); + + return $output; } } } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/lib/variables.php cacti-0.8.6j/lib/variables.php --- cacti-0.8.6j-old/lib/variables.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/lib/variables.php 2007-01-23 21:02:52.000000000 -0600 @@ -179,6 +179,9 @@ $string = str_replace($l_escape_string . "host_snmp_timeout" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["snmp_timeout"], $string); $string = str_replace($l_escape_string . "host_id" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["id"], $string); + $temp = do_hook_function('substitute_host_data', array('string' => $string, 'l_escape_string' => $l_escape_string, 'r_escape_string' => $r_escape_string, 'host_id' => $host_id)); + $string = $temp['string']; + return $string; } @@ -207,4 +210,4 @@ return $string; } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/plugins/index.php cacti-0.8.6j/plugins/index.php --- cacti-0.8.6j-old/plugins/index.php 1969-12-31 17:00:00.000000000 -0700 +++ cacti-0.8.6j/plugins/index.php 2007-01-23 21:02:52.000000000 -0600 @@ -0,0 +1,5 @@ + diff -Naur cacti-0.8.6j-old/poller.php cacti-0.8.6j/poller.php --- cacti-0.8.6j-old/poller.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/poller.php 2007-01-23 21:02:52.000000000 -0600 @@ -40,6 +40,8 @@ include_once($config["base_path"] . "/lib/graph_export.php"); include_once($config["base_path"] . "/lib/rrd.php"); +do_hook("poller_top"); + /* Record Start Time */ list($micro,$seconds) = split(" ", microtime()); $start = $seconds + $micro; @@ -188,7 +190,6 @@ /* insert poller stats into the settings table */ db_execute("replace into settings (name,value) values ('stats_poller','$cacti_stats')"); - db_execute("truncate table poller_output"); break; }else { @@ -261,4 +262,6 @@ } // End Mainline Processing -?> +do_hook("poller_bottom"); + +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/user_admin.php cacti-0.8.6j/user_admin.php --- cacti-0.8.6j-old/user_admin.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/user_admin.php 2007-01-23 15:11:46.000000000 -0600 @@ -72,11 +72,13 @@ include_once("include/bottom_footer.php"); break; default: - include_once("include/top_header.php"); + if (!do_hook_function("user_admin_action", $_REQUEST["action"])) { + include_once("include/top_header.php"); - user(); + user(); - include_once("include/bottom_footer.php"); + include_once("include/bottom_footer.php"); + } break; } @@ -158,6 +160,7 @@ $save["policy_trees"] = form_input_validate((isset($_POST["policy_trees"]) ? $_POST["policy_trees"] : $_POST["_policy_trees"]), "policy_trees", "", true, 3); $save["policy_hosts"] = form_input_validate((isset($_POST["policy_hosts"]) ? $_POST["policy_hosts"] : $_POST["_policy_hosts"]), "policy_hosts", "", true, 3); $save["policy_graph_templates"] = form_input_validate((isset($_POST["policy_graph_templates"]) ? $_POST["policy_graph_templates"] : $_POST["_policy_graph_templates"]), "policy_graph_templates", "", true, 3); + $save = do_hook_function("user_admin_setup_sql_save", $save); if (!is_error_message()) { $user_id = sql_save($save, "user_auth"); @@ -200,6 +203,8 @@ policy_hosts='" . $_POST["policy_hosts"] . "', policy_graph_templates='" . $_POST["policy_graph_templates"] . "' where id=" . $_POST["id"]); + }else{ + do_hook("user_admin_user_save"); } } } @@ -695,6 +700,7 @@ nowrap='nowrap' width='130' align='center' class='tab'> Graph Settings + @@ -708,7 +714,9 @@ }elseif ($_GET["action"] == "graph_perms_edit") { graph_perms_edit(); }else{ - user_realms_edit(); + if (do_hook_function("user_admin_run_action", $_REQUEST["action"])) { + user_realms_edit(); + } } form_save_button("user_admin.php"); @@ -791,4 +799,4 @@ } html_end_box(); } -?> +?> \ No newline at end of file diff -Naur cacti-0.8.6j-old/utilities.php cacti-0.8.6j/utilities.php --- cacti-0.8.6j-old/utilities.php 2007-01-23 21:01:57.000000000 -0600 +++ cacti-0.8.6j/utilities.php 2007-01-23 21:02:52.000000000 -0600 @@ -122,11 +122,14 @@ include_once("./include/bottom_footer.php"); break; default: - include_once("./include/top_header.php"); - utilities(); + if (!do_hook_function("utilities_action", $_REQUEST["action"])) { + include_once("./include/top_header.php"); - include_once("./include/bottom_footer.php"); + utilities(); + + include_once("./include/bottom_footer.php"); + } break; } @@ -973,7 +976,9 @@ +?> \ No newline at end of file