1 diff -Naur cacti-0.8.6j-old/auth_login.php cacti-0.8.6j/auth_login.php
2 --- cacti-0.8.6j-old/auth_login.php 2007-01-23 21:01:57.000000000 -0600
3 +++ cacti-0.8.6j/auth_login.php 2007-01-23 21:02:52.000000000 -0600
5 'Location' does not work. This seems to fix the bug for me at least... -->
6 <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
8 +<?php do_hook("login_before");
10 +$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
11 +$cacti_logo = do_hook_function('cacti_image', $cacti_logo);
15 <table align="center">
17 - <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
18 + <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
21 if ($_REQUEST["action"] == "login") {?>
24 <input type="hidden" name="action" value="login">
26 +<?php do_hook("login_after"); ?>
31 diff -Naur cacti-0.8.6j-old/data_sources.php cacti-0.8.6j/data_sources.php
32 --- cacti-0.8.6j-old/data_sources.php 2007-01-23 21:01:57.000000000 -0600
33 +++ cacti-0.8.6j/data_sources.php 2007-01-23 21:02:52.000000000 -0600
34 @@ -1072,18 +1072,25 @@
35 foreach ($data_sources as $data_source) {
36 $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
37 form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
39 + $ds_table['data_source'] = $data_source;
40 + $ds_table['data_input_name'] = $data_source['data_input_name'];
41 + $ds_table['active'] = (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");
42 + $ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
43 + $ds_table = do_hook_function("data_sources_table", $ds_table);
47 <a class='linkEditMain' href='data_sources.php?action=ds_edit&id=<?php print $data_source["local_data_id"];?>' title='<?php print $data_source["name_cache"];?>'><?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", 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")); } ?></a>
50 - <?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_source["data_input_name"]); }else{ print $data_source["data_input_name"]; } ?></a>
51 + <?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $ds_table['data_input_name']); }else{ print $ds_table['data_input_name']; } ?></a>
54 - <?php print (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");?>
55 + <?php print $ds_table['active']; ?>
58 - <?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_template_name); }else{ print $data_template_name; } ?></a>
59 + <?php if ($_REQUEST["filter"] != "") { print eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $ds_table['template_name']); }else{ print $ds_table['template_name']; } ?></a>
61 <td style="<?php print get_checkbox_style();?>" width="1%" align="right">
62 <input type='checkbox' style='margin: 0px;' name='chk_<?php print $data_source["local_data_id"];?>' title="<?php print $data_source["name_cache"];?>">
63 diff -Naur cacti-0.8.6j-old/graph_image.php cacti-0.8.6j/graph_image.php
64 --- cacti-0.8.6j-old/graph_image.php 2007-01-23 21:01:57.000000000 -0600
65 +++ cacti-0.8.6j/graph_image.php 2007-01-23 21:02:52.000000000 -0600
67 /* flush the headers now */
70 +do_hook_function('graph_image');
72 session_write_close();
74 $graph_data_array = array();
75 diff -Naur cacti-0.8.6j-old/graph.php cacti-0.8.6j/graph.php
76 --- cacti-0.8.6j-old/graph.php 2007-01-23 21:01:57.000000000 -0600
77 +++ cacti-0.8.6j/graph.php 2007-01-23 14:54:36.000000000 -0600
79 <td valign='top' style='padding: 3px;' class='noprint'>
80 <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
81 <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
82 + <?php do_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $rra["id"], 'view_type' => $_REQUEST["view_type"])); ?>
88 <td valign='top' style='padding: 3px;' class='noprint'>
89 <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
90 + <?php do_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
96 <td valign='top' style='padding: 3px;'>
97 <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
98 + <?php do_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
104 include_once("./include/bottom_footer.php");
108 \ No newline at end of file
109 diff -Naur cacti-0.8.6j-old/graphs_new.php cacti-0.8.6j/graphs_new.php
110 --- cacti-0.8.6j-old/graphs_new.php 2007-01-23 21:01:57.000000000 -0600
111 +++ cacti-0.8.6j/graphs_new.php 2007-01-23 21:02:52.000000000 -0600
114 <td class="textInfo" rowspan="2" valign="top">
115 <span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
116 - <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
117 + <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
118 + <?php do_hook("graphs_new_top_links"); ?>
122 diff -Naur cacti-0.8.6j-old/graphs.php cacti-0.8.6j/graphs.php
123 --- cacti-0.8.6j-old/graphs.php 2007-01-23 21:01:57.000000000 -0600
124 +++ cacti-0.8.6j/graphs.php 2007-01-23 21:02:52.000000000 -0600
126 4 => "Convert to Graph Template"
129 +$graph_actions = do_hook_function('graphs_action_array', $graph_actions);
131 /* set default action */
132 if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
135 input_validate_input_number($selected_items[$i]);
136 /* ==================================================== */
138 - api_resize_graphs($selected_items[$i], $_POST["graph_width"], $_POST["graph_height"]);
139 + api_resize_graphs($selected_items[$i], $_POST['graph_width'], $_POST['graph_height']);
142 + do_hook_function('graphs_action_execute', $_POST['drp_action']);
145 header("Location: graphs.php");
151 + $save['drp_action'] = $_POST['drp_action'];
152 + $save['graph_list'] = $graph_list;
153 + $save['graph_array'] = $graph_array;
154 + do_hook_function('graphs_action_prepare', $save);
157 if (!isset($graph_array)) {
158 @@ -1149,4 +1158,4 @@
164 \ No newline at end of file
165 diff -Naur cacti-0.8.6j-old/host.php cacti-0.8.6j/host.php
166 --- cacti-0.8.6j-old/host.php 2007-01-23 21:01:57.000000000 -0600
167 +++ cacti-0.8.6j/host.php 2007-01-23 21:02:52.000000000 -0600
169 5 => "Clear Statistics"
172 +$device_actions = do_hook_function('device_action_array', $device_actions);
174 /* set default action */
175 if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
179 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);
182 + do_hook_function('device_action_execute', $_POST['drp_action']);
185 header("Location: host.php");
188 <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\n
191 + $save['drp_action'] = $_POST['drp_action'];
192 + $save['host_list'] = $host_list;
193 + $save['host_array'] = (isset($host_array)? $host_array : array());
194 + do_hook_function('device_action_prepare', $save);
197 if (!isset($host_array)) {
198 diff -Naur cacti-0.8.6j-old/include/auth.php cacti-0.8.6j/include/auth.php
199 --- cacti-0.8.6j-old/include/auth.php 2007-01-23 21:01:57.000000000 -0600
200 +++ cacti-0.8.6j/include/auth.php 2007-01-23 21:02:52.000000000 -0600
205 - <link href="include/main.css" rel="stylesheet">
206 + <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
212 <table width="450" align='center'>
214 - <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
215 + <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
217 <tr height='10'><td></td></tr>
220 need access to this particular section, please contact the Cacti administrator.</td>
223 - <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='logout.php'>Login</a> )</td>
224 + <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='<?php echo $config['url_path']; ?>logout.php'>Login</a> )</td>
228 diff -Naur cacti-0.8.6j-old/include/config_arrays.php cacti-0.8.6j/include/config_arrays.php
229 --- cacti-0.8.6j-old/include/config_arrays.php 2007-01-23 21:01:57.000000000 -0600
230 +++ cacti-0.8.6j/include/config_arrays.php 2007-01-23 21:02:52.000000000 -0600
232 +-------------------------------------------------------------------------+
239 "message" => 'Save Successful.',
245 +$plugin_architecture = array(
249 +do_hook("config_arrays");
252 \ No newline at end of file
253 diff -Naur cacti-0.8.6j-old/include/config_form.php cacti-0.8.6j/include/config_form.php
254 --- cacti-0.8.6j-old/include/config_form.php 2007-01-23 21:01:57.000000000 -0600
255 +++ cacti-0.8.6j/include/config_form.php 2007-01-23 21:02:52.000000000 -0600
259 if (!defined("VALID_HOST_FIELDS")) {
260 - define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)");
261 + $string = do_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_version|snmp_port|snmp_timeout)');
262 + define("VALID_HOST_FIELDS", $string);
265 /* file: cdef.php, action: edit */
266 @@ -1000,4 +1001,6 @@
271 +do_hook("config_form");
274 \ No newline at end of file
275 diff -Naur cacti-0.8.6j-old/include/config.php cacti-0.8.6j/include/config.php
276 --- cacti-0.8.6j-old/include/config.php 2007-01-23 21:01:57.000000000 -0600
277 +++ cacti-0.8.6j/include/config.php 2007-01-23 21:02:52.000000000 -0600
279 $database_password = "cactiuser";
280 $database_port = "3306";
283 +//$plugins[] = 'thold';
285 +/* Do not edit this line */
290 + This is full URL Path to the Cacti installation
291 + For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
292 + as the url path. For just http://server/ use '/'
295 +$config['url_path'] = '/';
298 /* ----- you probably do not need to change anything below this line ----- */
300 /* Files that do not need http header information - Command line scripts */
309 /* this should be auto-detected, set it manually if needed */
311 $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
312 $config["include_path"] = dirname(__FILE__);
314 +define('URL_PATH', $config['url_path']);
316 +/* include the plugin function, we do this before everything else,
317 + incase we want to add hooks to change config options */
319 +include_once($config["include_path"] . "/plugins.php");
322 $colors["dark_outline"] = "454E53";
323 $colors["dark_bar"] = "AEB4B7";
325 /* current cacti version */
326 $config["cacti_version"] = "0.8.6j";
330 \ No newline at end of file
331 diff -Naur cacti-0.8.6j-old/include/config_settings.php cacti-0.8.6j/include/config_settings.php
332 --- cacti-0.8.6j-old/include/config_settings.php 2007-01-23 21:01:57.000000000 -0600
333 +++ cacti-0.8.6j/include/config_settings.php 2007-01-23 21:02:52.000000000 -0600
339 +do_hook("config_settings");
342 \ No newline at end of file
343 diff -Naur cacti-0.8.6j-old/include/plugins.php cacti-0.8.6j/include/plugins.php
344 --- cacti-0.8.6j-old/include/plugins.php 1969-12-31 17:00:00.000000000 -0700
345 +++ cacti-0.8.6j/include/plugins.php 2007-01-23 21:02:52.000000000 -0600
350 + * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
351 + * Licensed under the GNU GPL. For full terms see the file COPYING.
354 +global $plugin_hooks;
355 +$plugin_hooks = array();
357 +function use_plugin ($name) {
359 + if (file_exists($config["base_path"] . "/plugins/$name/setup.php")) {
360 + include_once($config["base_path"] . "/plugins/$name/setup.php");
361 + $function = "plugin_init_$name";
362 + if (function_exists($function)) {
369 + * This function executes a hook.
370 + * @param string $name Name of hook to fire
371 + * @return mixed $data
373 +function do_hook ($name) {
374 + global $plugin_hooks;
375 + $data = func_get_args();
378 + if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
379 + foreach ($plugin_hooks[$name] as $function) {
380 + if (function_exists($function)) {
386 + /* Variable-length argument lists have a slight problem when */
387 + /* passing values by reference. Pity. This is a workaround. */
391 +function do_hook_function($name,$parm=NULL) {
392 + global $plugin_hooks;
395 + if (isset($plugin_hooks[$name])
396 + && is_array($plugin_hooks[$name])) {
397 + foreach ($plugin_hooks[$name] as $function) {
398 + if (function_exists($function)) {
399 + $ret = $function($ret);
404 + /* Variable-length argument lists have a slight problem when */
405 + /* passing values by reference. Pity. This is a workaround. */
409 +/* On startup, register all plugins configured for use. */
410 +if (isset($plugins) && is_array($plugins)) {
411 + foreach ($plugins as $name) {
417 \ No newline at end of file
418 diff -Naur cacti-0.8.6j-old/include/top_graph_header.php cacti-0.8.6j/include/top_graph_header.php
419 --- cacti-0.8.6j-old/include/top_graph_header.php 2007-01-23 21:01:57.000000000 -0600
420 +++ cacti-0.8.6j/include/top_graph_header.php 2007-01-23 21:02:52.000000000 -0600
422 if ($_SESSION["custom"]) {
423 print "<meta http-equiv=refresh content='99999'>\r\n";
425 - print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
426 + $refresh = do_hook_function("top_graph_refresh", read_graph_config_option("page_refresh"));
427 + print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
431 - <link href="include/main.css" rel="stylesheet">
432 + <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
434 - <script type="text/javascript" src="include/treeview/ua.js"></script>
435 - <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
436 - <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
437 - <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
438 - <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
439 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
440 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
441 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
442 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
443 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
446 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
447 @@ -118,13 +119,14 @@
448 <table width="100%" cellspacing="0" cellpadding="0">
451 - <?php if ($show_console_tab == true) {?><a href="index.php"><img src="images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="graph_view.php"><img src="images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a>
453 + <?php if ($show_console_tab == true) {?><a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a><?php
454 + do_hook("top_graph_header_tabs");
457 - <img src="images/cacti_backdrop2.gif" align="absmiddle">
458 + <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
460 <td align="right" nowrap>
461 - <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="graph_settings.php"><img src="images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="graph_view.php?action=tree"><img src="images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="graph_view.php?action=list"><img src="images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="graph_view.php?action=preview"><img src="images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
462 + <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="' . $config['url_path'] . 'graph_settings.php"><img src="' . $config['url_path'] . 'images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php echo $config['url_path'] ?>graph_view.php?action=tree"><img src="<?php echo $config['url_path'] ?>images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="<?php echo $config['url_path'] ?>graph_view.php?action=list"><img src="<?php echo $config['url_path'] ?>images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="<?php echo $config['url_path'] ?>graph_view.php?action=preview"><img src="<?php echo $config['url_path'] ?>images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
468 <tr height="2" colspan="2" bgcolor="#183c8f" class="noprint">
470 - <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
471 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
474 <tr height="5" bgcolor="#e9e9e9" class="noprint">
478 <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
479 - Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="logout.php">Logout</a>)
480 + Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="<?php echo $config['url_path']; ?>logout.php">Logout</a>)
484 @@ -152,10 +154,10 @@
488 - <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
489 - <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
490 + <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
491 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
493 - <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
494 + <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
504 \ No newline at end of file
505 diff -Naur cacti-0.8.6j-old/include/top_header.php cacti-0.8.6j/include/top_header.php
506 --- cacti-0.8.6j-old/include/top_header.php 2007-01-23 21:01:57.000000000 -0600
507 +++ cacti-0.8.6j/include/top_header.php 2007-01-23 21:02:52.000000000 -0600
509 +-------------------------------------------------------------------------+
513 +global $colors, $config;
518 - <link href="include/main.css" rel="stylesheet">
519 - <script type="text/javascript" src="include/layout.js"></script>
520 + <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
521 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
522 <?php if (isset($refresh)) {
523 print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
528 -<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
529 +<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
531 <table width="100%" cellspacing="0" cellpadding="0">
532 <tr height="37" bgcolor="#a9a9a9">
534 <table width="100%" cellspacing="0" cellpadding="0">
537 - <a href="index.php"><img src="images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><a href="graph_view.php"><img src="images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a>
539 + <a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs.gif" alt="Console" align="absmiddle" border="0"></a><?php
540 + do_hook("top_header_tabs");
543 - <img src="images/cacti_backdrop.gif" align="absmiddle">
544 + <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
550 <tr height="2" bgcolor="#183c8f">
552 - <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
553 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
556 <tr height="5" bgcolor="#e9e9e9">
560 <?php if (read_config_option("global_auth") == "on") { ?>
561 - Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="logout.php">Logout</a>)
562 + Logged in as <strong><?php print db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);?></strong> (<a href="<?php echo $config['url_path']; ?>logout.php">Logout</a>)
570 - <td bgcolor="#f5f5f5" colspan="1" height="8" width="135" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
571 - <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
573 - <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
574 + <td bgcolor="#f5f5f5" colspan="1" height="8" width="135" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
575 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
577 + <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
585 - <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
586 - <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
587 - <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
588 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
589 + <p align="center"><a href='<?php echo $config['url_path']; ?>about.php'><img src="<?php echo $config['url_path']; ?>images/cacti_logo.gif" border="0"></a></p>
590 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
594 diff -Naur cacti-0.8.6j-old/index.php cacti-0.8.6j/index.php
595 --- cacti-0.8.6j-old/index.php 2007-01-23 21:01:57.000000000 -0600
596 +++ cacti-0.8.6j/index.php 2007-01-23 21:02:52.000000000 -0600
598 include("./include/auth.php");
599 include("./include/top_header.php");
601 +do_hook("console_before");
604 <table width="98%" align="center">
610 +do_hook("console_after");
612 include("./include/bottom_footer.php");
615 diff -Naur cacti-0.8.6j-old/lib/api_device.php cacti-0.8.6j/lib/api_device.php
616 --- cacti-0.8.6j-old/lib/api_device.php 2007-01-23 21:01:57.000000000 -0600
617 +++ cacti-0.8.6j/lib/api_device.php 2007-01-23 21:02:52.000000000 -0600
619 $save["snmp_timeout"] = form_input_validate($snmp_timeout, "snmp_timeout", "^[0-9]+$", false, 3);
620 $save["disabled"] = form_input_validate($disabled, "disabled", "", true, 3);
622 + $save = do_hook_function("api_device_save", $save);
626 if (!is_error_message()) {
633 \ No newline at end of file
634 diff -Naur cacti-0.8.6j-old/lib/functions.php cacti-0.8.6j/lib/functions.php
635 --- cacti-0.8.6j-old/lib/functions.php 2007-01-23 21:01:57.000000000 -0600
636 +++ cacti-0.8.6j/lib/functions.php 2007-01-23 21:02:52.000000000 -0600
641 + do_hook_function("update_host_status", array('issue_log_message' => $issue_log_message, 'status' => $status, 'host_id' => $host_id, 'hosts' => $hosts));
643 db_execute("update host set
644 status = '" . $hosts[$host_id]["status"] . "',
645 status_event_count = '" . $hosts[$host_id]["status_event_count"] . "',
646 @@ -1323,6 +1325,7 @@
647 /* draw_navigation_text - determines the top header navigation text for the current page and displays it to
649 function draw_navigation_text() {
651 $nav_level_cache = (isset($_SESSION["sess_nav_level_cache"]) ? $_SESSION["sess_nav_level_cache"] : array());
654 @@ -1335,7 +1338,7 @@
655 "graph.php:zoom" => array("title" => "Zoom", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"),
656 "graph.php:properties" => array("title" => "Properties", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"),
657 "graph_settings.php:" => array("title" => "Settings", "mapping" => "graph_view.php:", "url" => "graph_settings.php", "level" => "1"),
658 - "index.php:" => array("title" => "Console", "mapping" => "", "url" => "index.php", "level" => "0"),
659 + "index.php:" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"),
660 "graphs.php:" => array("title" => "Graph Management", "mapping" => "index.php:", "url" => "graphs.php", "level" => "1"),
661 "graphs.php:graph_edit" => array("title" => "(Edit)", "mapping" => "index.php:,graphs.php:", "url" => "", "level" => "2"),
662 "graphs.php:graph_diff" => array("title" => "Change Graph Template", "mapping" => "index.php:,graphs.php:,graphs.php:graph_edit", "url" => "", "level" => "3"),
663 @@ -1410,6 +1413,8 @@
664 "templates_import.php:" => array("title" => "Import Templates", "mapping" => "index.php:", "url" => "templates_import.php", "level" => "1"),
667 + $nav = do_hook_function("draw_navigation_text", $nav);
669 $current_page = basename($_SERVER["PHP_SELF"]);
670 $current_action = (isset($_REQUEST["action"]) ? $_REQUEST["action"] : "");
672 @@ -1721,4 +1726,4 @@
678 \ No newline at end of file
679 diff -Naur cacti-0.8.6j-old/lib/html_form.php cacti-0.8.6j/lib/html_form.php
680 --- cacti-0.8.6j-old/lib/html_form.php 2007-01-23 21:01:57.000000000 -0600
681 +++ cacti-0.8.6j/lib/html_form.php 2007-01-23 21:02:52.000000000 -0600
682 @@ -419,11 +419,13 @@
683 on a confirmation form
684 @arg $cancel_url - the url to go to when the user clicks 'cancel'
685 @arg $action_url - the url to go to when the user clicks 'delete' */
686 -function form_confirm_buttons($action_url, $cancel_url) { ?>
687 +function form_confirm_buttons($action_url, $cancel_url) {
691 <td bgcolor="#E1E1E1">
692 - <a href="<?php print $cancel_url;?>"><img src="images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
693 - <a href="<?php print $action_url . "&confirm=yes";?>"><img src="images/button_delete.gif" border="0" alt="Delete" align="absmiddle"></a>
694 + <a href="<?php print $cancel_url;?>"><img src="<?php print $config['url_path'] ?>images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
695 + <a href="<?php print $action_url . "&confirm=yes";?>"><img src="<?php print $config['url_path'] ?>images/button_delete.gif" border="0" alt="Delete" align="absmiddle"></a>
700 @arg $force_type - if specified, will force the 'action' button to be either
701 'save' or 'create'. otherwise this field should be properly auto-detected */
702 function form_save_button($cancel_url, $force_type = "", $key_field = "id") {
704 if (empty($force_type)) {
705 if (empty($_GET[$key_field])) {
706 $img = "button_create.gif";
709 <td bgcolor="#f5f5f5" align="right">
710 <input type='hidden' name='action' value='save'>
711 - <a href='<?php print $cancel_url;?>'><img src='images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
712 - <input type='image' src='images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
713 + <a href='<?php print $cancel_url;?>'><img src='<?php echo $config['url_path']; ?>images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
714 + <input type='image' src='<?php echo $config['url_path']; ?>images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
724 \ No newline at end of file
725 diff -Naur cacti-0.8.6j-old/lib/html.php cacti-0.8.6j/lib/html.php
726 --- cacti-0.8.6j-old/lib/html.php 2007-01-23 21:01:57.000000000 -0600
727 +++ cacti-0.8.6j/lib/html.php 2007-01-23 14:57:46.000000000 -0600
729 @arg $extra_url_args - extra arguments to append to the url
730 @arg $header - html to use as a header */
731 function html_graph_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") {
734 if (sizeof($graph_array) > 0) {
736 @@ -101,10 +102,11 @@
737 <table width='1' cellpadding='0'>
740 - <a href='graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img src='graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
741 + <a href='<?php print $config['url_path']; ?>graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img src='<?php print $config['url_path']; ?>graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
743 <td valign='top' style='padding: 3px;' class='noprint'>
744 - <a href='graph.php?action=zoom&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
745 + <a href='<?php print $config['url_path']; ?>graph.php?action=zoom&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='<?php print $config['url_path']; ?>images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
746 + <?php do_hook('graph_buttons', array('hook' => 'graphs', 'local_graph_id' => $graph["local_graph_id"], 'rra' => 0, 'view_type' => '')); ?>
751 @arg $extra_url_args - extra arguments to append to the url
752 @arg $header - html to use as a header */
753 function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") {
756 if (sizeof($graph_array) > 0) {
758 @@ -144,10 +147,11 @@
759 <table width='1' cellpadding='0'>
762 - <a href='graph.php?action=view&rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img src='graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&graph_height=<?php print read_graph_config_option("default_height");?>&graph_width=<?php print read_graph_config_option("default_width");?>&graph_nolegend=true<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
763 + <a href='<?php print $config['url_path']; ?>graph.php?action=view&rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img src='<?php print $config['url_path']; ?>graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&graph_height=<?php print read_graph_config_option("default_height");?>&graph_width=<?php print read_graph_config_option("default_width");?>&graph_nolegend=true<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
765 <td valign='top' style='padding: 3px;'>
766 - <a href='graph.php?action=zoom&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
767 + <a href='<?php print $config['url_path']; ?>graph.php?action=zoom&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='<?php print $config['url_path']; ?>images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
768 + <?php do_hook('graph_buttons', array('hook' => 'thumbnails', 'local_graph_id' => $graph["local_graph_id"], 'rra' => 0, 'view_type' => '')); ?>
775 while (list($item_sub_url, $item_sub_title) = each($item_title)) {
776 + $item_sub_url = $config['url_path'] . $item_sub_url;
778 /* indent sub-items */
780 $prepend_string = "--- ";
783 /* do not put a line between each sub-item */
784 if (($i == 0) || ($draw_sub_items == false)) {
785 - $background = "images/menu_line.gif";
786 + $background = $config['url_path'] . "images/menu_line.gif";
790 @@ -568,17 +574,18 @@
792 if ((isset($user_realms[$current_realm_id])) || (!isset($user_auth_realm_filenames{basename($item_url)}))) {
793 /* draw normal (non sub-item) menu item */
794 + $item_url = $config['url_path'] . $item_url;
795 if (basename($_SERVER["PHP_SELF"]) == basename($item_url)) {
796 - print "<tr><td class='textMenuItemSelected' background='images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
797 + print "<tr><td class='textMenuItemSelected' background='" . $config['url_path'] . "images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
799 - print "<tr><td class='textMenuItem' background='images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
800 + print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
807 - print "<tr><td class='textMenuItem' background='images/menu_line.gif'></td></tr>\n";
808 + print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'></td></tr>\n";
810 print '</table></td></tr>';
812 @@ -588,18 +595,19 @@
813 @arg $actions_array - an array that contains a list of possible actions. this array should
814 be compatible with the form_dropdown() function */
815 function draw_actions_dropdown($actions_array) {
818 <table align='center' width='98%'>
820 <td width='1' valign='top'>
821 - <img src='images/arrow.gif' alt='' align='absmiddle'>
822 + <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='absmiddle'>
826 <?php form_dropdown("drp_action",$actions_array,"","","1","","");?>
828 <td width='1' align='right'>
829 - <input type='image' src='images/button_go.gif' alt='Go'>
830 + <input type='image' src='<?php echo $config['url_path']; ?>images/button_go.gif' alt='Go'>
840 \ No newline at end of file
841 diff -Naur cacti-0.8.6j-old/lib/html_tree.php cacti-0.8.6j/lib/html_tree.php
842 --- cacti-0.8.6j-old/lib/html_tree.php 2007-01-23 21:01:57.000000000 -0600
843 +++ cacti-0.8.6j/lib/html_tree.php 2007-01-23 21:02:52.000000000 -0600
845 if (read_graph_config_option("thumbnail_section_tree_1") == "on") {
846 if (read_graph_config_option("timespan_sel") == "on") {
847 print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
848 - src='graph_image.php?local_graph_id=$local_graph_id&rra_id=0&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end() . '&graph_height=' .
849 + src='graph_image.php?action=view&local_graph_id=$local_graph_id&rra_id=0&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end() . '&graph_height=' .
850 read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
852 /* if we are at the end of a row, start a new one */
856 print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
857 - src='graph_image.php?local_graph_id=$local_graph_id&rra_id=$rra_id&graph_start=" . -(db_fetch_cell("select timespan from rra where id=$rra_id")) . '&graph_height=' .
858 + src='graph_image.php?action=view&local_graph_id=$local_graph_id&rra_id=$rra_id&graph_start=" . -(db_fetch_cell("select timespan from rra where id=$rra_id")) . '&graph_height=' .
859 read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
861 /* if we are at the end of a row, start a new one */
862 @@ -905,10 +905,10 @@
865 if (read_graph_config_option("timespan_sel") == "on") {
866 - print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img src='graph_image.php?local_graph_id=$local_graph_id&rra_id=0&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end() . "' border='0' alt='$graph_title'></a></td>";
867 + print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img src='graph_image.php?action=view&local_graph_id=$local_graph_id&rra_id=0&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end() . "' border='0' alt='$graph_title'></a></td>";
870 - print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img src='graph_image.php?local_graph_id=$local_graph_id&rra_id=$rra_id' border='0' alt='$graph_title'></a></td>";
871 + print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img src='graph_image.php?action=view&local_graph_id=$local_graph_id&rra_id=$rra_id' border='0' alt='$graph_title'></a></td>";
881 \ No newline at end of file
882 diff -Naur cacti-0.8.6j-old/lib/poller.php cacti-0.8.6j/lib/poller.php
883 --- cacti-0.8.6j-old/lib/poller.php 2007-01-23 21:01:57.000000000 -0600
884 +++ cacti-0.8.6j/lib/poller.php 2007-01-23 21:02:52.000000000 -0600
886 $limit = "LIMIT 10000";
892 + $limit = "LIMIT 10000";
895 /* create/update the rrd files */
896 $results = db_fetch_assoc("select
897 poller_output.output,
898 @@ -296,11 +302,14 @@
902 + do_hook_function("poller_output", $rrd_update_array);
904 - $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe);
905 + if (do_hook_function("poller_on_demand", $results)) {
906 + $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe);
910 return $rrds_processed;
915 \ No newline at end of file
916 diff -Naur cacti-0.8.6j-old/lib/rrd.php cacti-0.8.6j/lib/rrd.php
917 --- cacti-0.8.6j-old/lib/rrd.php 2007-01-23 21:01:57.000000000 -0600
918 +++ cacti-0.8.6j/lib/rrd.php 2007-01-23 21:02:52.000000000 -0600
923 + $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));
924 + if (isset($data['return']) && $data['return'] != false)
925 + return $data['return'];
927 /* find the step and how often this graph is updated with new data */
928 $ds_step = db_fetch_cell("select
929 data_template_data.rrd_step
930 @@ -1145,15 +1149,21 @@
931 rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, RRDTOOL_OUTPUT_NULL, $rrd_struc);
934 + $graph_data_array = do_hook_function("prep_graph_array", $graph_data_array);
936 if (isset($graph_data_array["output_flag"])) {
937 $output_flag = $graph_data_array["output_flag"];
939 $output_flag = RRDTOOL_OUTPUT_GRAPH_DATA;
942 - return rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrd_struc);
943 + $output = rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrd_struc);
945 + do_hook_function("rrdtool_function_graph_set_file", array('output' => $output, 'local_graph_id' => $local_graph_id, 'rra_id' => $rra_id));
954 \ No newline at end of file
955 diff -Naur cacti-0.8.6j-old/lib/variables.php cacti-0.8.6j/lib/variables.php
956 --- cacti-0.8.6j-old/lib/variables.php 2007-01-23 21:01:57.000000000 -0600
957 +++ cacti-0.8.6j/lib/variables.php 2007-01-23 21:02:52.000000000 -0600
959 $string = str_replace($l_escape_string . "host_snmp_timeout" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["snmp_timeout"], $string);
960 $string = str_replace($l_escape_string . "host_id" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["id"], $string);
962 + $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));
963 + $string = $temp['string'];
974 \ No newline at end of file
975 diff -Naur cacti-0.8.6j-old/plugins/index.php cacti-0.8.6j/plugins/index.php
976 --- cacti-0.8.6j-old/plugins/index.php 1969-12-31 17:00:00.000000000 -0700
977 +++ cacti-0.8.6j/plugins/index.php 2007-01-23 21:02:52.000000000 -0600
981 +header("Location:../index.php");
984 diff -Naur cacti-0.8.6j-old/poller.php cacti-0.8.6j/poller.php
985 --- cacti-0.8.6j-old/poller.php 2007-01-23 21:01:57.000000000 -0600
986 +++ cacti-0.8.6j/poller.php 2007-01-23 21:02:52.000000000 -0600
988 include_once($config["base_path"] . "/lib/graph_export.php");
989 include_once($config["base_path"] . "/lib/rrd.php");
991 +do_hook("poller_top");
993 /* Record Start Time */
994 list($micro,$seconds) = split(" ", microtime());
995 $start = $seconds + $micro;
998 /* insert poller stats into the settings table */
999 db_execute("replace into settings (name,value) values ('stats_poller','$cacti_stats')");
1000 - db_execute("truncate table poller_output");
1006 // End Mainline Processing
1009 +do_hook("poller_bottom");
1012 \ No newline at end of file
1013 diff -Naur cacti-0.8.6j-old/user_admin.php cacti-0.8.6j/user_admin.php
1014 --- cacti-0.8.6j-old/user_admin.php 2007-01-23 21:01:57.000000000 -0600
1015 +++ cacti-0.8.6j/user_admin.php 2007-01-23 15:11:46.000000000 -0600
1017 include_once("include/bottom_footer.php");
1020 - include_once("include/top_header.php");
1021 + if (!do_hook_function("user_admin_action", $_REQUEST["action"])) {
1022 + include_once("include/top_header.php");
1027 - include_once("include/bottom_footer.php");
1028 + include_once("include/bottom_footer.php");
1034 $save["policy_trees"] = form_input_validate((isset($_POST["policy_trees"]) ? $_POST["policy_trees"] : $_POST["_policy_trees"]), "policy_trees", "", true, 3);
1035 $save["policy_hosts"] = form_input_validate((isset($_POST["policy_hosts"]) ? $_POST["policy_hosts"] : $_POST["_policy_hosts"]), "policy_hosts", "", true, 3);
1036 $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);
1037 + $save = do_hook_function("user_admin_setup_sql_save", $save);
1039 if (!is_error_message()) {
1040 $user_id = sql_save($save, "user_auth");
1042 policy_hosts='" . $_POST["policy_hosts"] . "',
1043 policy_graph_templates='" . $_POST["policy_graph_templates"] . "'
1044 where id=" . $_POST["id"]);
1046 + do_hook("user_admin_user_save");
1051 <td <?php print (($_GET["action"] == "graph_settings_edit") ? "bgcolor='silver'" : "bgcolor='#DFDFDF'");?> nowrap='nowrap' width='130' align='center' class='tab'>
1052 <span class='textHeader'><a href='user_admin.php?action=graph_settings_edit&id=<?php print $_GET["id"];?>'>Graph Settings</a></span>
1054 + <?php do_hook("user_admin_tab");?>
1059 }elseif ($_GET["action"] == "graph_perms_edit") {
1062 - user_realms_edit();
1063 + if (do_hook_function("user_admin_run_action", $_REQUEST["action"])) {
1064 + user_realms_edit();
1068 form_save_button("user_admin.php");
1075 \ No newline at end of file
1076 diff -Naur cacti-0.8.6j-old/utilities.php cacti-0.8.6j/utilities.php
1077 --- cacti-0.8.6j-old/utilities.php 2007-01-23 21:01:57.000000000 -0600
1078 +++ cacti-0.8.6j/utilities.php 2007-01-23 21:02:52.000000000 -0600
1079 @@ -122,11 +122,14 @@
1080 include_once("./include/bottom_footer.php");
1083 - include_once("./include/top_header.php");
1086 + if (!do_hook_function("utilities_action", $_REQUEST["action"])) {
1087 + include_once("./include/top_header.php");
1089 - include_once("./include/bottom_footer.php");
1092 + include_once("./include/bottom_footer.php");
1101 + do_hook("utilities_list");
1108 \ No newline at end of file