]> git.pld-linux.org Git - packages/cacti.git/commitdiff
- drop obsolete files
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 5 Jul 2009 15:57:45 +0000 (15:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cacti-plugin-0.8.6h.diff -> 1.2
    cacti-plugin-0.8.6i.diff -> 1.2
    cacti-plugin-0.8.6j.diff -> 1.2
    cacti-plugin-0.8.7a.diff -> 1.2
    cacti-upgrade_from_086k_fix.patch -> 1.2
    cmd-php-non-unique-hosts.patch -> 1.2
    database_autoincrement_corruption.patch -> 1.2
    dec06-vulnerability-poller-0.8.6i.patch -> 1.2
    dec06-vulnerability-scripts-0.8.6i.patch -> 1.2
    fix_search_session_clear_issue.patch -> 1.2
    fix_sql_syntax_related_to_default_rra_id.patch -> 1.2
    graph-issue-wrra-specs.patch -> 1.2
    import_template_argument_space_removal.patch -> 1.2
    mysql_5x_strict.patch -> 1.3
    nth_percentile_empty_return_set_issue.patch -> 1.2
    poller_output_remainder.patch -> 1.2

16 files changed:
cacti-plugin-0.8.6h.diff [deleted file]
cacti-plugin-0.8.6i.diff [deleted file]
cacti-plugin-0.8.6j.diff [deleted file]
cacti-plugin-0.8.7a.diff [deleted file]
cacti-upgrade_from_086k_fix.patch [deleted file]
cmd-php-non-unique-hosts.patch [deleted file]
database_autoincrement_corruption.patch [deleted file]
dec06-vulnerability-poller-0.8.6i.patch [deleted file]
dec06-vulnerability-scripts-0.8.6i.patch [deleted file]
fix_search_session_clear_issue.patch [deleted file]
fix_sql_syntax_related_to_default_rra_id.patch [deleted file]
graph-issue-wrra-specs.patch [deleted file]
import_template_argument_space_removal.patch [deleted file]
mysql_5x_strict.patch [deleted file]
nth_percentile_empty_return_set_issue.patch [deleted file]
poller_output_remainder.patch [deleted file]

diff --git a/cacti-plugin-0.8.6h.diff b/cacti-plugin-0.8.6h.diff
deleted file mode 100644 (file)
index b1a4391..0000000
+++ /dev/null
@@ -1,861 +0,0 @@
-diff -Naur -U 8 cacti-0.8.6h-old/data_sources.php cacti-0.8.6h/data_sources.php
---- cacti-0.8.6h-old/data_sources.php  2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/data_sources.php      2006-01-05 23:25:32.000000000 -0600
-@@ -1038,28 +1038,35 @@
-       print $nav;
-       html_header_checkbox(array("Name", "Data Input Method", "Active", "Template Name"));
-       $i = 0;
-       if (sizeof($data_sources) > 0) {
-               foreach ($data_sources as $data_source) {
-                       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" : "<span style='color: red;'>No</span>");
-+                              $ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
-+                              $ds_table = do_hook_function("data_sources_table", $ds_table);
-+
-                               ?>
-                               <td>
-                                       <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>
-                               </td>
-                               <td>
--                                      <?php print $data_source["data_input_name"];?>
-+                                      <?php print $ds_table['data_input_name']; ?>
-                               </td>
-                               <td>
--                                      <?php print (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");?>
-+                                      <?php print $ds_table['active']; ?>
-                               </td>
-                               <td>
--                                      <?php print ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);?>
-+                                      <?php print $ds_table['template_name']; ?>
-                               </td>
-                               <td style="<?php print get_checkbox_style();?>" width="1%" align="right">
-                                       <input type='checkbox' style='margin: 0px;' name='chk_<?php print $data_source["local_data_id"];?>' title="<?php print $data_source["name_cache"];?>">
-                               </td>
-                       </tr>
-                       <?php
-               }
-diff -Naur -U 8 cacti-0.8.6h-old/graphs_new.php cacti-0.8.6h/graphs_new.php
---- cacti-0.8.6h-old/graphs_new.php    2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/graphs_new.php        2006-01-05 23:25:38.000000000 -0600
-@@ -394,17 +394,18 @@
-               </tr>
-               <tr>
-                       <td class="textArea" style="padding: 3px;" width="300" nowrap>
-                               Create new graphs for the following host:
-                       </td>
-                       <td class="textInfo" rowspan="2" valign="top">
-                               <span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
--                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
-+                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
-+                              <?php do_hook("graphs_new_top_links"); ?>
-                       </td>
-               </tr>
-                       <td>
-                               <select name="cbo_graph_id" onChange="window.location=document.form_graph_id.cbo_graph_id.options[document.form_graph_id.cbo_graph_id.selectedIndex].value">
-                                       <?php
-                                       $hosts = db_fetch_assoc("select id,CONCAT_WS('',description,' (',hostname,')') as name from host order by description,hostname");
-                                       if (sizeof($hosts) > 0) {
-diff -Naur -U 8 cacti-0.8.6h-old/include/config_arrays.php cacti-0.8.6h/include/config_arrays.php
---- cacti-0.8.6h-old/include/config_arrays.php 2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/config_arrays.php     2006-01-05 23:25:43.000000000 -0600
-@@ -19,16 +19,18 @@
-  | Ian Berry. See about.php for specific developer credit. Any questions   |
-  | or comments regarding this code should be directed to:                  |
-  | - iberry@raxnet.net                                                     |
-  +-------------------------------------------------------------------------+
-  | - raXnet - http://www.raxnet.net/                                       |
-  +-------------------------------------------------------------------------+
- */
-+global $menu;
-+
- $messages = array(
-       1  => array(
-               "message" => 'Save Successful.',
-               "type" => "info"),
-       2  => array(
-               "message" => 'Save Failed',
-               "type" => "error"),
-       3  => array(
-@@ -424,9 +426,11 @@
-       GD_Y_MN_D =>"Year, Month Name, Day"
-       );
- $graph_datechar = array(
-       GDC_HYPHEN => "-",
-       GDC_SLASH => "/"
-       );
--?>
-+do_hook("config_arrays");
-+
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/include/config_form.php cacti-0.8.6h/include/config_form.php
---- cacti-0.8.6h-old/include/config_form.php   2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/config_form.php       2006-01-05 23:25:49.000000000 -0600
-@@ -994,9 +994,11 @@
-               "value" => "|arg1:policy_graph_templates|"
-               ),
-       "save_component_user" => array(
-               "method" => "hidden",
-               "value" => "1"
-               )
-       );
--?>
-+do_hook("config_form");
-+
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/include/config.php cacti-0.8.6h/include/config.php
---- cacti-0.8.6h-old/include/config.php        2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/config.php    2006-01-05 23:25:41.000000000 -0600
-@@ -27,16 +27,29 @@
- /* make sure these values refect your actual database/host/user/password */
- $database_type = "mysql";
- $database_default = "cacti";
- $database_hostname = "localhost";
- $database_username = "cactiuser";
- $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 */
- $no_http_header_files = array(
-       "poller.php",
-       "cmd.php",
-       "query_host_cpu.php",
-       "query_host_partitions.php",
-@@ -46,30 +59,34 @@
-       "rebuild_poller_cache.php",
-       "script_server.php",
-       "sql.php",
-       "ss_host_cpu.php",
-       "ss_host_disk.php",
-       "ss_sql.php"
- );
--$config = array();
- $colors = array();
- /* this should be auto-detected, set it manually if needed */
- $config["cacti_server_os"] = (strstr(PHP_OS, "WIN")) ? "win32" : "unix";
- /* built-in snmp support */
- $config["php_snmp_support"] = function_exists("snmpget");
- /* used for includes */
- $config["base_path"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)), "\\", "/");
- $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
- $config["include_path"] = dirname(__FILE__);
-+/* 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";
- $colors["panel"] = "E5E5E5";
- $colors["panel_text"] = "000000";
- $colors["panel_link"] = "000000";
- $colors["light"] = "F5F5F5";
- $colors["alternate"] = "E7E9F2";
-diff -Naur -U 8 cacti-0.8.6h-old/include/config_settings.php cacti-0.8.6h/include/config_settings.php
---- cacti-0.8.6h-old/include/config_settings.php       2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/config_settings.php   2006-01-05 23:25:52.000000000 -0600
-@@ -842,9 +842,11 @@
-                       "friendly_name" => "Unit Font File",
-                       "description" => "The size of the font used for Graph Unit items",
-                       "method" => "textbox",
-                       "max_length" => "100"
-                       )
-               )
-       );
--?>
-+do_hook("config_settings");
-+
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/include/plugins.php cacti-0.8.6h/include/plugins.php
---- cacti-0.8.6h-old/include/plugins.php       1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.6h/include/plugins.php   2006-01-05 23:25:53.000000000 -0600
-@@ -0,0 +1,70 @@
-+<?php
-+
-+/*
-+ * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
-+ * Licensed under the GNU GPL. For full terms see the file COPYING.
-+ */
-+
-+global $plugin_hooks;
-+$plugin_hooks = array();
-+
-+function use_plugin ($name) {
-+    global $config;
-+    if (file_exists($config["base_path"] . "/plugins/$name/setup.php")) {
-+        include_once($config["base_path"] . "/plugins/$name/setup.php");
-+        $function = "plugin_init_$name";
-+        if (function_exists($function)) {
-+            $function();
-+        }
-+    }
-+}
-+
-+/**
-+ * This function executes a hook.
-+ * @param string $name Name of hook to fire
-+ * @return mixed $data
-+ */
-+function do_hook ($name) {
-+    global $plugin_hooks;
-+    $data = func_get_args();
-+    $ret = '';
-+
-+    if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $function($data);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $data;
-+}
-+
-+function do_hook_function($name,$parm=NULL) {
-+    global $plugin_hooks;
-+    $ret = $parm;
-+
-+    if (isset($plugin_hooks[$name])
-+          && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $ret = $function($ret);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $ret;
-+}
-+
-+/* On startup, register all plugins configured for use. */
-+if (isset($plugins) && is_array($plugins)) {
-+    foreach ($plugins as $name) {
-+        use_plugin($name);
-+    }
-+}
-+
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/include/top_graph_header.php cacti-0.8.6h/include/top_graph_header.php
---- cacti-0.8.6h-old/include/top_graph_header.php      2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/top_graph_header.php  2006-01-05 23:25:56.000000000 -0600
-@@ -76,75 +76,78 @@
- ?>
- <html>
- <head>
-       <title>cacti</title>
-       <?php if (isset($_SESSION["custom"])) {
-               if ($_SESSION["custom"]) {
-                       print "<meta http-equiv=refresh content='99999'; url='" . basename($_SERVER["PHP_SELF"]) . "'>\r\n";
-               }else{
--                      print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'; url='" . basename($_SERVER["PHP_SELF"]) . "'>\r\n";
-+                      $refresh = do_hook_function("top_graph_refresh", read_graph_config_option("page_refresh"));
-+                      print "<meta http-equiv=refresh content='" . $refresh . "'; url='" . basename($_SERVER["PHP_SELF"]) . "'>\r\n";
-               }
-       }
-       ?>
--      <link href="include/main.css" rel="stylesheet">
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/treeview/ua.js"></script>
--      <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
--      <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
- <table width="100%" height="100%" cellspacing="0" cellpadding="0">
-       <tr height="37" bgcolor="#a9a9a9">
-               <td colspan="2" valign="bottom" nowrap>
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td nowrap>
--                                              &nbsp;<?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>&nbsp;
-+                                              &nbsp;<?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
-+                                              do_hook("top_graph_header_tabs");
-+                                      ?>&nbsp;
-                                       </td>
-                                       <td>
--                                              <img src="images/cacti_backdrop2.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
-                                       </td>
-                                       <td align="right" nowrap>
--                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-+                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-       <tr height="2" colspan="2" bgcolor="#183c8f">
-               <td colspan="2">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9">
-               <td colspan="2">
-                       <table width="100%">
-                               <tr>
-                                       <td>
-                                               <?php draw_navigation_text();?>
-                                       </td>
-                                       <td align="right">
-                                               <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-       <tr>
--              <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
--                      <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
-+              <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;">
-+                      <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>
-               </td>
--              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
-+              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
-               </td>
-       </tr>
-       <?php if ((basename($_SERVER["PHP_SELF"]) == "graph.php") && ($_REQUEST["action"] == "properties")) {?>
-       <tr>
-               <td valign="top" height="1" colspan="3" bgcolor="#efefef">
-                       <?php
-diff -Naur -U 8 cacti-0.8.6h-old/include/top_header.php cacti-0.8.6h/include/top_header.php
---- cacti-0.8.6h-old/include/top_header.php    2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/include/top_header.php        2006-01-05 23:25:56.000000000 -0600
-@@ -19,79 +19,80 @@
-  | Ian Berry. See about.php for specific developer credit. Any questions   |
-  | or comments regarding this code should be directed to:                  |
-  | - iberry@raxnet.net                                                     |
-  +-------------------------------------------------------------------------+
-  | - raXnet - http://www.raxnet.net/                                       |
-  +-------------------------------------------------------------------------+
- */
--global $colors;
-+global $colors, $config;
- ?>
- <html>
- <head>
-       <title>cacti</title>
--      <link href="include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/layout.js"></script>
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
- </style>
- </head>
--<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
-+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
- <table width="100%" cellspacing="0" cellpadding="0">
-       <tr height="37" bgcolor="#a9a9a9">
-               <td valign="bottom" colspan="3" nowrap>
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td valign="bottom">
--                                              &nbsp;<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="Console" align="absmiddle" border="0"></a>
--                                      </td>
-+                                              &nbsp;<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
-+                                              do_hook("top_header_tabs");
-+                                      ?></td>
-                                       <td align="right">
--                                              <img src="images/cacti_backdrop.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-       <tr height="2" bgcolor="#183c8f">
-               <td colspan="3">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9">
-               <td colspan="3">
-                       <table width="100%">
-                               <tr>
-                                       <td>
-                                               <?php draw_navigation_text();?>
-                                       </td>
-                                       <td align="right">
-                                               <?php if (read_config_option("global_auth") == "on") { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-       <tr>
--              <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;">
--                      <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
-+              <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;">
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
-               </td>
--              <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-+              <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-               </td>
-       </tr>
-       <tr height="5">
-               <td valign="top" rowspan="2" width="135" style="padding: 5px; border-right: #aaaaaa 1px solid;" bgcolor='#f5f5f5'>
-                       <table bgcolor="#f5f5f5" width="100%" cellpadding="1" cellspacing="0" border="0">
-                               <?php draw_menu();?>
-                       </table>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
--                      <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <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>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-               </td>
-               <td></td>
-       </tr>
-       <tr>
-               <td width="135" height="500"></td>
-               <td width="100%" valign="top"><?php display_output_messages();?>
-diff -Naur -U 8 cacti-0.8.6h-old/lib/api_device.php cacti-0.8.6h/lib/api_device.php
---- cacti-0.8.6h-old/lib/api_device.php        2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/lib/api_device.php    2006-01-05 23:25:59.000000000 -0600
-@@ -71,16 +71,18 @@
-       $save["snmp_community"] = form_input_validate($snmp_community, "snmp_community", "", true, 3);
-       $save["snmp_version"] = form_input_validate($snmp_version, "snmp_version", "", true, 3);
-       $save["snmp_username"] = form_input_validate($snmp_username, "snmp_username", "", true, 3);
-       $save["snmp_password"] = form_input_validate($snmp_password, "snmp_password", "", true, 3);
-       $save["snmp_port"] = form_input_validate($snmp_port, "snmp_port", "^[0-9]+$", false, 3);
-       $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()) {
-               $host_id = sql_save($save, "host");
-               if ($host_id) {
-                       raise_message(1);
-diff -Naur -U 8 cacti-0.8.6h-old/lib/functions.php cacti-0.8.6h/lib/functions.php
---- cacti-0.8.6h-old/lib/functions.php 2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/lib/functions.php     2006-01-05 23:26:11.000000000 -0600
-@@ -181,19 +181,19 @@
-       return $field_value;
- }
- /* is_error_message - finds whether an error message has been raised and has not been outputted to the
-      user
-    @returns - (bool) whether the messages array contains an error or not */
- function is_error_message() {
--      global $config;
-+      global $config, $messages;
--      include($config["include_path"] . "/config_arrays.php");
-+      include_once($config["include_path"] . "/config_arrays.php");
-       if (isset($_SESSION["sess_messages"])) {
-               if (is_array($_SESSION["sess_messages"])) {
-                       foreach (array_keys($_SESSION["sess_messages"]) as $current_message_id) {
-                               if ($messages[$current_message_id]["type"] == "error") { return true; }
-                       }
-               }
-       }
-@@ -557,16 +557,18 @@
-       if ($issue_log_message) {
-               if ($hosts[$host_id]["status"] == HOST_DOWN) {
-                       cacti_log("Host[$host_id] ERROR: HOST EVENT: Host is DOWN Message: " . $hosts[$host_id]["status_last_error"], $print_data_to_stdout);
-               } else {
-                       cacti_log("Host[$host_id] NOTICE: HOST EVENT: Host Returned from DOWN State: ", $print_data_to_stdout);
-               }
-       }
-+      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"] . "',
-               status_fail_date = '" . $hosts[$host_id]["status_fail_date"] . "',
-               status_rec_date = '" . $hosts[$host_id]["status_rec_date"] . "',
-               status_last_error = '" . $hosts[$host_id]["status_last_error"] . "',
-               min_time = '" . $hosts[$host_id]["min_time"] . "',
-               max_time = '" . $hosts[$host_id]["max_time"] . "',
-@@ -1341,16 +1343,18 @@
-               "user_admin.php:user_realms_edit" => array("title" => "Edit (Realm Permissions)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"),
-               "user_admin.php:graph_settings_edit" => array("title" => "Edit (Graph Settings)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"),
-               "about.php:" => array("title" => "About Cacti", "mapping" => "index.php:", "url" => "about.php", "level" => "1"),
-               "templates_export.php:" => array("title" => "Export Templates", "mapping" => "index.php:", "url" => "templates_export.php", "level" => "1"),
-               "templates_export.php:save" => array("title" => "Export Results", "mapping" => "index.php:,templates_export.php:", "url" => "templates_export.php", "level" => "2"),
-               "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"] : "");
-       /* find the current page in the big array */
-       $current_array = $nav{$current_page . ":" . $current_action};
-       $current_mappings = split(",", $current_array["mapping"]);
-       $current_nav = "";
-diff -Naur -U 8 cacti-0.8.6h-old/lib/html_form.php cacti-0.8.6h/lib/html_form.php
---- cacti-0.8.6h-old/lib/html_form.php 2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/lib/html_form.php     2006-01-05 23:26:14.000000000 -0600
-@@ -429,16 +429,17 @@
- <?php }
- /* form_save_button - draws a (save|create) and cancel button at the bottom of
-      an html edit form
-    @arg $cancel_url - the url to go to when the user clicks 'cancel'
-    @arg $force_type - if specified, will force the 'action' button to be either
-      'save' or 'create'. otherwise this field should be properly auto-detected */
- function form_save_button($cancel_url, $force_type = "", $key_field = "id") {
-+      global $config;
-       if (empty($force_type)) {
-               if (empty($_GET[$key_field])) {
-                       $img = "button_create.gif";
-                       $alt = "Create";
-               }else{
-                       $img = "button_save.gif";
-                       $alt = "Save";
-               }
-@@ -449,18 +450,18 @@
-               $img = "button_create.gif";
-               $alt = "Create";
-       }
-       ?>
-       <table align='center' width='98%' style='background-color: #ffffff; border: 1px solid #bbbbbb;'>
-               <tr>
-                        <td bgcolor="#f5f5f5" align="right">
-                               <input type='hidden' name='action' value='save'>
--                              <a href='<?php print $cancel_url;?>'><img src='images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
--                              <input type='image' src='images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-+                              <a href='<?php print $cancel_url;?>'><img src='<?php echo $config['url_path']; ?>images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-                       </td>
-               </tr>
-       </table>
-       </form>
-       <?php
- }
- ?>
-diff -Naur -U 8 cacti-0.8.6h-old/lib/html.php cacti-0.8.6h/lib/html.php
---- cacti-0.8.6h-old/lib/html.php      2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/lib/html.php  2006-01-05 23:26:10.000000000 -0600
-@@ -83,33 +83,34 @@
-    @arg $graph_array - the array to contains graph information. for each graph in the
-      array, the following two keys must exist
-      $arr[0]["local_graph_id"] // graph id
-      $arr[0]["title_cache"] // graph title
-    @arg $no_graphs_message - display this message if no graphs are found in $graph_array
-    @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 != "") {
-                       print $header;
-               }
-               foreach ($graph_array as $graph) {
-                       ?>
-                       <tr bgcolor='#<?php print ($i % 2 == 0 ? "f9f9f9" : "ffffff");?>'>
-                               <td align='center'>
-                                       <table width='1' cellpadding='0'>
-                                               <tr>
-                                                       <td>
--                                                              <a href='graph.php?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>
-+                                                              <a href='<?php print $config['url_path'] ?>graph.php?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>
-                                                       </td>
-                                                       <td valign='top' style='padding: 3px;'>
--                                                              <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>
-+                                                              <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>
-                                                       </td>
-                                               </tr>
-                                       </table>
-                               </td>
-                       </tr>
-                       <?php
-                       $i++;
-@@ -125,34 +126,35 @@
-    @arg $graph_array - the array to contains graph information. for each graph in the
-      array, the following two keys must exist
-      $arr[0]["local_graph_id"] // graph id
-      $arr[0]["title_cache"] // graph title
-    @arg $no_graphs_message - display this message if no graphs are found in $graph_array
-    @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 != "") {
-                       print $header;
-               }
-               print "<tr>";
-               foreach ($graph_array as $graph) {
-                       ?>
-                       <td align='center' width='<?php print (98 / read_graph_config_option("num_columns"));?>%'>
-                               <table width='1' cellpadding='0'>
-                                       <tr>
-                                               <td>
--                                                      <a href='graph.php?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>
-+                                                      <a href='<?php print $config['url_path'] ?>graph.php?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>
-                                               </td>
-                                               <td valign='top' style='padding: 3px;'>
--                                                      <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>
-+                                                      <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>
-                                               </td>
-                                       </tr>
-                               </table>
-                       </td>
-                       <?php
-                       $i++;
-                       $k++;
-@@ -425,26 +427,28 @@
-                                       /* if the current page exists in the sub-items array, draw each sub-item */
-                                       if (array_key_exists(basename($_SERVER["PHP_SELF"]), $item_title) == true) {
-                                               $draw_sub_items = true;
-                                       }else{
-                                               $draw_sub_items = false;
-                                       }
-                                       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 = "---&nbsp;";
-                                               }else{
-                                                       $prepend_string = "";
-                                               }
-                                               /* 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 = "";
-                                               }
-                                               /* draw all of the sub-items as selected for ui grouping reasons. we can use the 'bold'
-                                               or 'not bold' to distinguish which sub-item is actually selected */
-                                               if ((basename($_SERVER["PHP_SELF"]) == basename($item_sub_url)) || ($draw_sub_items)) {
-                                                       $td_class = "textMenuItemSelected";
-@@ -463,48 +467,50 @@
-                                               }
-                                               $i++;
-                                       }
-                               }
-                       }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 "<tr><td class='textMenuItemSelected' background='images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
-+                                              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";
-                                       }else{
--                                              print "<tr><td class='textMenuItem' background='images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-+                                              print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-                                       }
-                               }
-                       }
-               }
-       }
--      print "<tr><td class='textMenuItem' background='images/menu_line.gif'></td></tr>\n";
-+      print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'></td></tr>\n";
-       print '</table></td></tr>';
- }
- /* draw_actions_dropdown - draws a table the allows the user to select an action to perform
-      on one or more data elements
-    @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;
-       ?>
-       <table align='center' width='98%'>
-               <tr>
-                       <td width='1' valign='top'>
--                              <img src='images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-+                              <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-                       </td>
-                       <td align='right'>
-                               Choose an action:
-                               <?php form_dropdown("drp_action",$actions_array,"","","1","","");?>
-                       </td>
-                       <td width='1' align='right'>
--                              <input type='image' src='images/button_go.gif' alt='Go'>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/button_go.gif' alt='Go'>
-                       </td>
-               </tr>
-       </table>
-       <input type='hidden' name='action' value='actions'>
-       <?php
- }
-@@ -521,9 +527,9 @@
- function form_area($text) { ?>
-       <tr>
-               <td bgcolor="#E1E1E1" class="textArea">
-                       <?php print $text;?>
-               </td>
-       </tr>
- <?php }
--?>
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/plugins/index.php cacti-0.8.6h/plugins/index.php
---- cacti-0.8.6h-old/plugins/index.php 1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.6h/plugins/index.php     2006-01-05 23:26:14.000000000 -0600
-@@ -0,0 +1,5 @@
-+<?php
-+
-+header("Location:../index.php");
-+
-+?>
-diff -Naur -U 8 cacti-0.8.6h-old/poller.php cacti-0.8.6h/poller.php
---- cacti-0.8.6h-old/poller.php        2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/poller.php    2006-01-05 23:25:38.000000000 -0600
-@@ -35,16 +35,18 @@
- /* Start Initialization Section */
- include(dirname(__FILE__) . "/include/config.php");
- include_once($config["base_path"] . "/lib/poller.php");
- include_once($config["base_path"] . "/lib/data_query.php");
- 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;
- /* Get number of polling items from the database */
- $polling_interval = read_config_option("poller_interval");
- if (isset($polling_interval)) {
-@@ -263,9 +265,11 @@
-       if ($method == "cactid") {
-               chdir(read_config_option("path_webroot"));
-       }
- }else{
-       print "There are no items in your poller cache or polling is disabled. Make sure you have at least one data source created. If you do, go to 'Utilities', and select 'Clear Poller Cache'.\n";
- }
- // End Mainline Processing
--?>
-+do_hook("poller_bottom");
-+
-+?>
-\ No newline at end of file
-diff -Naur -U 8 cacti-0.8.6h-old/utilities.php cacti-0.8.6h/utilities.php
---- cacti-0.8.6h-old/utilities.php     2006-01-03 21:08:30.000000000 -0600
-+++ cacti-0.8.6h/utilities.php 2006-01-05 22:32:11.000000000 -0600
-@@ -83,16 +83,19 @@
-               utilities_clear_logfile();
-               #utilities_view_logfile();
-               include_once("./include/bottom_footer.php");
-               break;
-       default:
-+
-+              do_hook_function("utilities_action", $_REQUEST["action"]);
-+
-               include_once("./include/top_header.php");
-               utilities();
-               include_once("./include/bottom_footer.php");
-               break;
- }
-@@ -349,12 +352,14 @@
-                       <p><a href='utilities.php?action=clear_logfile'>Clear Cacti Log File</a></p>
-               </td>
-               <td class="textArea">
-                       <p>This action will reset the Cacti Log File.  Please note that if you are using the Syslog/Eventlog only, this action will have no effect.</p>
-               </td>
-       </tr>
-       <?php
-+      do_hook("utilities_list");
-+
-       html_end_box();
- }
- ?>
diff --git a/cacti-plugin-0.8.6i.diff b/cacti-plugin-0.8.6i.diff
deleted file mode 100644 (file)
index c312922..0000000
+++ /dev/null
@@ -1,1173 +0,0 @@
-diff -Naur cacti-0.8.6i-old/auth_login.php cacti-0.8.6i/auth_login.php
---- cacti-0.8.6i-old/auth_login.php    2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/auth_login.php        2007-01-02 01:32:14.000000000 -0600
-@@ -111,9 +111,16 @@
- 'Location' does not work. This seems to fix the bug for me at least... -->
- <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
-+<?php do_hook("login_before");
-+
-+$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
-+$cacti_logo = do_hook_function('cacti_image', $cacti_logo);
-+
-+?>
-+
- <table align="center">
-       <tr>
--              <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
-+              <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
-       </tr>
-       <?php
-       if ($_REQUEST["action"] == "login") {?>
-@@ -155,6 +162,8 @@
- <input type="hidden" name="action" value="login">
-+<?php do_hook("login_after"); ?>
-+
- </form>
- </body>
-diff -Naur cacti-0.8.6i-old/data_sources.php cacti-0.8.6i/data_sources.php
---- cacti-0.8.6i-old/data_sources.php  2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/data_sources.php      2007-01-23 14:47:07.000000000 -0600
-@@ -1072,18 +1072,25 @@
-               foreach ($data_sources as $data_source) {
-                       $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $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" : "<span style='color: red;'>No</span>");
-+                      $ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
-+                      $ds_table = do_hook_function("data_sources_table", $ds_table);
-+
-                               ?>
-                               <td>
-                                       <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>
-                               </td>
-                               <td>
--                                      <?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>
-+                                      <?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>
-                               </td>
-                               <td>
--                                      <?php print (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");?>
-+                                      <?php print $ds_table['active']; ?>
-                               </td>
-                               <td>
--                                      <?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>
-+                                      <?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>
-                               </td>
-                               <td style="<?php print get_checkbox_style();?>" width="1%" align="right">
-                                       <input type='checkbox' style='margin: 0px;' name='chk_<?php print $data_source["local_data_id"];?>' title="<?php print $data_source["name_cache"];?>">
-diff -Naur cacti-0.8.6i-old/graph_image.php cacti-0.8.6i/graph_image.php
---- cacti-0.8.6i-old/graph_image.php   2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/graph_image.php       2007-01-02 01:32:14.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.6i-old/graph.php cacti-0.8.6i/graph.php
---- cacti-0.8.6i-old/graph.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/graph.php     2007-01-02 01:32:14.000000000 -0600
-@@ -89,11 +89,12 @@
-                               <table width='1' cellpadding='0'>
-                                       <tr>
-                                               <td>
--                                                      <img src='graph_image.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>' border='0' alt='<?php print $graph_title;?>'>
-+                                                      <img src='graph_image.php?action=view&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>' border='0' alt='<?php print $graph_title;?>'>
-                                               </td>
-                                               <td valign='top' style='padding: 3px;' class='noprint'>
-                                                       <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>
-                                                       <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>
-+                                                      <?php do_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $rra["id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                               </td>
-                                       </tr>
-                                       <tr>
-@@ -204,10 +205,11 @@
-                       <table width='1' cellpadding='0'>
-                               <tr>
-                                       <td>
--                                              <img id='zoomGraphImage' src='graph_image.php?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;?>&graph_height=<?php print $graph_height;?>&graph_width=<?php print $graph_width;?>&title_font_size=<?php print $title_font_size ?>' border='0' alt='<?php print $graph_title;?>'>
-+                                              <img id='zoomGraphImage' src='graph_image.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"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>&graph_height=<?php print $graph_height;?>&graph_width=<?php print $graph_width;?>&title_font_size=<?php print $title_font_size ?>' border='0' alt='<?php print $graph_title;?>'>
-                                       </td>
-                                       <td valign='top' style='padding: 3px;' class='noprint'>
--                                              <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>
-+                                              <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><br>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET["local_graph_id"], 'rra' =>  $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-@@ -235,10 +237,11 @@
-                       <table width='1' cellpadding='0'>
-                               <tr>
-                                       <td>
--                                              <img src='graph_image.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&graph_start=<?php print (isset($_GET["graph_start"]) ? $_GET["graph_start"] : 0);?>&graph_end=<?php print (isset($_GET["graph_end"]) ? $_GET["graph_end"] : 0);?>' border='0' alt='<?php print $graph_title;?>'>
-+                                              <img src='graph_image.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&graph_start=<?php print (isset($_GET["graph_start"]) ? $_GET["graph_start"] : 0);?>&graph_end=<?php print (isset($_GET["graph_end"]) ? $_GET["graph_end"] : 0);?>' border='0' alt='<?php print $graph_title;?>'>
-                                       </td>
-                                       <td valign='top' style='padding: 3px;'>
-                                               <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>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET["local_graph_id"], 'rra' =>  $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-@@ -259,4 +262,4 @@
- include_once("./include/bottom_footer.php");
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/graphs_new.php cacti-0.8.6i/graphs_new.php
---- cacti-0.8.6i-old/graphs_new.php    2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/graphs_new.php        2007-01-23 14:47:07.000000000 -0600
-@@ -399,7 +399,8 @@
-                       </td>
-                       <td class="textInfo" rowspan="2" valign="top">
-                               <span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
--                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
-+                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
-+                              <?php do_hook("graphs_new_top_links"); ?>
-                       </td>
-               </tr>
-                       <td>
-diff -Naur cacti-0.8.6i-old/graphs.php cacti-0.8.6i/graphs.php
---- cacti-0.8.6i-old/graphs.php        2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/graphs.php    2007-01-23 14:47:07.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 @@
-                               </td>
-                       </tr>\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)) {
-@@ -930,7 +939,7 @@
-               <table width="98%" align="center">
-                       <tr>
-                               <td align="center" class="textInfo" colspan="2">
--                                      <img src="graph_image.php?local_graph_id=<?php print $_GET["id"];?>&rra_id=<?php print read_graph_config_option("default_rra_id");?>" alt="">
-+                                      <img src="graph_image.php?action=edit&local_graph_id=<?php print $_GET["id"];?>&rra_id=<?php print read_graph_config_option("default_rra_id");?>" alt="">
-                               </td>
-                               <?php
-                               if ((isset($_SESSION["graph_debug_mode"])) && (isset($_GET["id"]))) {
-@@ -1149,4 +1158,4 @@
-       print "</form>\n";
- }
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/host.php cacti-0.8.6i/host.php
---- cacti-0.8.6i-old/host.php  2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/host.php      2007-01-11 22:18:23.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 @@
-                       </tr>\n
-                       <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\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.6i-old/include/auth.php cacti-0.8.6i/include/auth.php
---- cacti-0.8.6i-old/include/auth.php  2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/auth.php      2007-01-02 01:32:14.000000000 -0600
-@@ -77,7 +77,7 @@
-                       <html>
-                       <head>
-                               <title>Cacti</title>
--                              <link href="include/main.css" rel="stylesheet">
-+                              <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-                       </style>
-                       </head>
-@@ -85,7 +85,7 @@
-                       <table width="450" align='center'>
-                               <tr>
--                                      <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
-+                                      <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
-                               </tr>
-                               <tr height='10'><td></td></tr>
-                               <tr>
-@@ -93,7 +93,7 @@
-                                       need access to this particular section, please contact the Cacti administrator.</td>
-                               </tr>
-                               <tr>
--                                      <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='logout.php'>Login</a> )</td>
-+                                      <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>
-                               </tr>
-                       </table>
-diff -Naur cacti-0.8.6i-old/include/config_arrays.php cacti-0.8.6i/include/config_arrays.php
---- cacti-0.8.6i-old/include/config_arrays.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/config_arrays.php     2007-01-02 01:32:14.000000000 -0600
-@@ -24,6 +24,8 @@
-  +-------------------------------------------------------------------------+
- */
-+global $menu;
-+
- $messages = array(
-       1  => array(
-               "message" => 'Save Successful.',
-@@ -451,4 +453,10 @@
-       GDC_SLASH => "/"
-       );
--?>
-+$plugin_architecture = array(
-+      "version" => '1.1'
-+      );
-+
-+do_hook("config_arrays");
-+
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/include/config_form.php cacti-0.8.6i/include/config_form.php
---- cacti-0.8.6i-old/include/config_form.php   2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/config_form.php       2007-01-02 01:32:14.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.6i-old/include/config.php cacti-0.8.6i/include/config.php
---- cacti-0.8.6i-old/include/config.php        2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/config.php    2007-01-02 01:32:14.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 */
-@@ -51,7 +67,7 @@
-       "ss_sql.php"
- );
--$config = array();
-+
- $colors = array();
- /* this should be auto-detected, set it manually if needed */
-@@ -65,6 +81,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";
-@@ -168,4 +191,4 @@
- /* current cacti version */
- $config["cacti_version"] = "0.8.6i";
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/include/config_settings.php cacti-0.8.6i/include/config_settings.php
---- cacti-0.8.6i-old/include/config_settings.php       2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/config_settings.php   2007-01-02 01:32:14.000000000 -0600
-@@ -928,4 +928,6 @@
-               )
-       );
--?>
-+do_hook("config_settings");
-+
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/include/plugins.php cacti-0.8.6i/include/plugins.php
---- cacti-0.8.6i-old/include/plugins.php       1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.6i/include/plugins.php   2007-01-02 01:32:14.000000000 -0600
-@@ -0,0 +1,70 @@
-+<?php
-+
-+/*
-+ * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
-+ * Licensed under the GNU GPL. For full terms see the file COPYING.
-+ */
-+
-+global $plugin_hooks;
-+$plugin_hooks = array();
-+
-+function use_plugin ($name) {
-+    global $config;
-+    if (file_exists($config["base_path"] . "/plugins/$name/setup.php")) {
-+        include_once($config["base_path"] . "/plugins/$name/setup.php");
-+        $function = "plugin_init_$name";
-+        if (function_exists($function)) {
-+            $function();
-+        }
-+    }
-+}
-+
-+/**
-+ * This function executes a hook.
-+ * @param string $name Name of hook to fire
-+ * @return mixed $data
-+ */
-+function do_hook ($name) {
-+    global $plugin_hooks;
-+    $data = func_get_args();
-+    $ret = '';
-+
-+    if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $function($data);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $data;
-+}
-+
-+function do_hook_function($name,$parm=NULL) {
-+    global $plugin_hooks;
-+    $ret = $parm;
-+
-+    if (isset($plugin_hooks[$name])
-+          && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $ret = $function($ret);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $ret;
-+}
-+
-+/* On startup, register all plugins configured for use. */
-+if (isset($plugins) && is_array($plugins)) {
-+    foreach ($plugins as $name) {
-+        use_plugin($name);
-+    }
-+}
-+
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/include/top_graph_header.php cacti-0.8.6i/include/top_graph_header.php
---- cacti-0.8.6i-old/include/top_graph_header.php      2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/top_graph_header.php  2007-01-02 01:32:14.000000000 -0600
-@@ -97,17 +97,18 @@
-               if ($_SESSION["custom"]) {
-                       print "<meta http-equiv=refresh content='99999'>\r\n";
-               }else{
--                      print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
-+                      $refresh = do_hook_function("top_graph_refresh", read_graph_config_option("page_refresh"));
-+                      print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
-               }
-       }
-       ?>
--      <link href="include/main.css" rel="stylesheet">
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/treeview/ua.js"></script>
--      <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
--      <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
-@@ -118,13 +119,14 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td nowrap>
--                                              &nbsp;<?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>&nbsp;
--                                      </td>
-+                                              &nbsp;<?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
-+                                              do_hook("top_graph_header_tabs");
-+                                      ?>&nbsp;                                        </td>
-                                       <td>
--                                              <img src="images/cacti_backdrop2.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
-                                       </td>
-                                       <td align="right" nowrap>
--                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-+                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-                                       </td>
-                               </tr>
-                       </table>
-@@ -132,7 +134,7 @@
-       </tr>
-       <tr height="2" colspan="2" bgcolor="#183c8f" class="noprint">
-               <td colspan="2">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9" class="noprint">
-@@ -144,7 +146,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -152,10 +154,10 @@
-               </td>
-       </tr>
-       <tr class="noprint">
--              <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
--                      <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
-+              <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;">
-+                      <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>
-               </td>
--              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
-+              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
-               </td>
-       </tr>
-@@ -203,4 +205,4 @@
-                       <?php } ?>
-               </td>
-               <?php } ?>
--              <td valign="top">
-+              <td valign="top">
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/include/top_header.php cacti-0.8.6i/include/top_header.php
---- cacti-0.8.6i-old/include/top_header.php    2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/include/top_header.php        2007-01-02 01:32:14.000000000 -0600
-@@ -24,20 +24,20 @@
-  +-------------------------------------------------------------------------+
- */
--global $colors;
-+global $colors, $config;
- ?>
- <html>
- <head>
-       <title>cacti</title>
--      <link href="include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/layout.js"></script>
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
-       <?php if (isset($refresh)) {
-       print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
-       }?>
- </style>
- </head>
--<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
-+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
- <table width="100%" cellspacing="0" cellpadding="0">
-       <tr height="37" bgcolor="#a9a9a9">
-@@ -45,10 +45,11 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td valign="bottom">
--                                              &nbsp;<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>
--                                      </td>
-+                                              &nbsp;<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
-+                                              do_hook("top_header_tabs");
-+                                      ?></td>
-                                       <td align="right">
--                                              <img src="images/cacti_backdrop.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
-                                       </td>
-                               </tr>
-                       </table>
-@@ -56,7 +57,7 @@
-       </tr>
-       <tr height="2" bgcolor="#183c8f">
-               <td colspan="3">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9">
-@@ -68,7 +69,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if (read_config_option("global_auth") == "on") { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -76,10 +77,10 @@
-               </td>
-       </tr>
-       <tr>
--              <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;">
--                      <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
--              </td>
--              <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-+              <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;">
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
-+              </td>
-+              <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-               </td>
-       </tr>
-@@ -89,9 +90,9 @@
-                               <?php draw_menu();?>
-                       </table>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
--                      <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <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>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-               </td>
-               <td></td>
-       </tr>
-diff -Naur cacti-0.8.6i-old/index.php cacti-0.8.6i/index.php
---- cacti-0.8.6i-old/index.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/index.php     2007-01-02 01:32:14.000000000 -0600
-@@ -27,6 +27,8 @@
- include("./include/auth.php");
- include("./include/top_header.php");
-+do_hook("console_before");
-+
- ?>
- <table width="98%" align="center">
-       <tr>
-@@ -44,6 +46,8 @@
- </table>
- <?php
-+do_hook("console_after");
-+
- include("./include/bottom_footer.php");
- ?>
-diff -Naur cacti-0.8.6i-old/lib/api_device.php cacti-0.8.6i/lib/api_device.php
---- cacti-0.8.6i-old/lib/api_device.php        2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/api_device.php    2007-01-02 01:32:14.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.6i-old/lib/functions.php cacti-0.8.6i/lib/functions.php
---- cacti-0.8.6i-old/lib/functions.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/functions.php     2007-01-23 14:47:07.000000000 -0600
-@@ -186,9 +186,9 @@
-      user
-    @returns - (bool) whether the messages array contains an error or not */
- function is_error_message() {
--      global $config;
-+      global $config, $messages;
--      include($config["include_path"] . "/config_arrays.php");
-+      include_once($config["include_path"] . "/config_arrays.php");
-       if (isset($_SESSION["sess_messages"])) {
-               if (is_array($_SESSION["sess_messages"])) {
-@@ -618,6 +618,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"] . "',
-@@ -1321,6 +1323,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(
-@@ -1333,7 +1336,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"),
-@@ -1408,6 +1411,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"] : "");
-@@ -1719,4 +1724,4 @@
-       return $string;
- }
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/lib/html_form.php cacti-0.8.6i/lib/html_form.php
---- cacti-0.8.6i-old/lib/html_form.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/html_form.php     2007-01-02 01:32:14.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;
-+      ?>
-       <tr>
-               <td bgcolor="#E1E1E1">
--                      <a href="<?php print $cancel_url;?>"><img src="images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
--                      <a href="<?php print $action_url . "&confirm=yes";?>"><img src="images/button_delete.gif" border="0" alt="Delete" align="absmiddle"></a>
-+                      <a href="<?php print $cancel_url;?>"><img src="<?php print $config['url_path'] ?>images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
-+                      <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>
-               </td>
-       </tr>
- <?php }
-@@ -434,6 +436,7 @@
-    @arg $force_type - if specified, will force the 'action' button to be either
-      'save' or 'create'. otherwise this field should be properly auto-detected */
- function form_save_button($cancel_url, $force_type = "", $key_field = "id") {
-+      global $config;
-       if (empty($force_type)) {
-               if (empty($_GET[$key_field])) {
-                       $img = "button_create.gif";
-@@ -454,8 +457,8 @@
-               <tr>
-                        <td bgcolor="#f5f5f5" align="right">
-                               <input type='hidden' name='action' value='save'>
--                              <a href='<?php print $cancel_url;?>'><img src='images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
--                              <input type='image' src='images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-+                              <a href='<?php print $cancel_url;?>'><img src='<?php echo $config['url_path']; ?>images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-                       </td>
-               </tr>
-       </table>
-@@ -463,4 +466,4 @@
-       <?php
- }
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/lib/html.php cacti-0.8.6i/lib/html.php
---- cacti-0.8.6i-old/lib/html.php      2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/html.php  2007-01-23 14:47:07.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 @@
-                                       <table width='1' cellpadding='0'>
-                                               <tr>
-                                                       <td>
--                                                              <a href='graph.php?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>
-+                                                              <a href='<?php print $config['url_path']; ?>graph.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img src='<?php print $config['url_path']; ?>graph_image.php?action=view&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>
-                                                       </td>
-                                                       <td valign='top' style='padding: 3px;' class='noprint'>
--                                                              <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>
-+                                                              <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>
-+                                                              <?php do_hook('graph_buttons', array('hook' => 'graphs', 'local_graph_id' => $graph["local_graph_id"], 'rra' =>  0, 'view_type' => '')); ?>
-                                                       </td>
-                                               </tr>
-                                       </table>
-@@ -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 @@
-                               <table width='1' cellpadding='0'>
-                                       <tr>
-                                               <td>
--                                                      <a href='graph.php?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>
-+                                                      <a href='<?php print $config['url_path']; ?>graph.php?rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img src='<?php print $config['url_path']; ?>graph_image.php?action=view&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>
-                                               </td>
-                                               <td valign='top' style='padding: 3px;'>
--                                                      <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>
-+                                                      <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>
-+                                                      <?php do_hook('graph_buttons', array('hook' => 'thumbnails', 'local_graph_id' => $graph["local_graph_id"], 'rra' =>  0, 'view_type' => '')); ?>
-                                               </td>
-                                       </tr>
-                               </table>
-@@ -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 = "---&nbsp;";
-@@ -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 "<tr><td class='textMenuItemSelected' background='images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
-+                                              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";
-                                       }else{
--                                              print "<tr><td class='textMenuItem' background='images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-+                                              print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-                                       }
-                               }
-                       }
-               }
-       }
--      print "<tr><td class='textMenuItem' background='images/menu_line.gif'></td></tr>\n";
-+      print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'></td></tr>\n";
-       print '</table></td></tr>';
- }
-@@ -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;
-       ?>
-       <table align='center' width='98%'>
-               <tr>
-                       <td width='1' valign='top'>
--                              <img src='images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-+                              <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-                       </td>
-                       <td align='right'>
-                               Choose an action:
-                               <?php form_dropdown("drp_action",$actions_array,"","","1","","");?>
-                       </td>
-                       <td width='1' align='right'>
--                              <input type='image' src='images/button_go.gif' alt='Go'>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/button_go.gif' alt='Go'>
-                       </td>
-               </tr>
-       </table>
-@@ -626,4 +634,4 @@
-       </tr>
- <?php }
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/lib/html_tree.php cacti-0.8.6i/lib/html_tree.php
---- cacti-0.8.6i-old/lib/html_tree.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/html_tree.php     2007-01-23 14:47:07.000000000 -0600
-@@ -761,7 +761,7 @@
-       if (read_graph_config_option("thumbnail_section_tree_1") == "on") {
-               if (read_graph_config_option("timespan_sel") == "on") {
-                       print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
-                       /* if we are at the end of a row, start a new one */
-@@ -770,7 +770,7 @@
-                       }
-               }else{
-                       print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
-                       /* if we are at the end of a row, start a new one */
-@@ -780,10 +780,10 @@
-               }
-       }else{
-               if (read_graph_config_option("timespan_sel") == "on") {
--                      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>";
-+                      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>";
-                       print "</tr><tr>\n";
-               }else{
--                      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>";
-+                      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>";
-                       print "</tr><tr>\n";
-               }
-       }
-@@ -853,4 +853,4 @@
-       return $html;
- }
--?>
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/lib/poller.php cacti-0.8.6i/lib/poller.php
---- cacti-0.8.6i-old/lib/poller.php    2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/poller.php        2007-01-23 14:47:07.000000000 -0600
-@@ -213,7 +213,7 @@
- /* process_poller_output - grabs data from the 'poller_output' table and feeds the *completed*
-      results to RRDTool for processing
-    @arg $rrdtool_pipe - the array of pipes containing the file descriptor for rrdtool */
--function process_poller_output($rrdtool_pipe) {
-+function process_poller_output($rrdtool_pipe, $remainder = FALSE) {
-       global $config;
-       include_once($config["library_path"] . "/rrd.php");
-@@ -221,6 +221,12 @@
-       /* let's count the number of rrd files we processed */
-       $rrds_processed = 0;
-+      if ($remainder) {
-+              $limit = "";
-+      }else{
-+              $limit = "LIMIT 10000";
-+      }
-+
-       /* create/update the rrd files */
-       $results = db_fetch_assoc("select
-               poller_output.output,
-@@ -231,7 +237,7 @@
-               poller_item.rrd_num
-               from (poller_output,poller_item)
-               where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name)
--              limit 10000");
-+              $limit");
-       if (sizeof($results) > 0) {
-               /* create an array keyed off of each .rrd file */
-@@ -289,11 +295,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.6i-old/lib/rrd.php cacti-0.8.6i/lib/rrd.php
---- cacti-0.8.6i-old/lib/rrd.php       2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/rrd.php   2007-01-02 01:32:14.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.6i-old/lib/variables.php cacti-0.8.6i/lib/variables.php
---- cacti-0.8.6i-old/lib/variables.php 2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/lib/variables.php     2007-01-02 01:32:14.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.6i-old/plugins/index.php cacti-0.8.6i/plugins/index.php
---- cacti-0.8.6i-old/plugins/index.php 1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.6i/plugins/index.php     2007-01-02 01:32:14.000000000 -0600
-@@ -0,0 +1,5 @@
-+<?php
-+
-+header("Location:../index.php");
-+
-+?>
-diff -Naur cacti-0.8.6i-old/poller.php cacti-0.8.6i/poller.php
---- cacti-0.8.6i-old/poller.php        2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/poller.php    2007-01-23 14:47:07.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;
-@@ -166,7 +168,7 @@
-               $polling_items = db_fetch_assoc("select poller_id,end_time from poller_time where poller_id = 0");
-               if (sizeof($polling_items) == $process_file_number) {
--                      $rrds_processed = $rrds_processed + process_poller_output($rrdtool_pipe);
-+                      $rrds_processed = $rrds_processed + process_poller_output($rrdtool_pipe, TRUE);
-                       /* take time and log performance data */
-                       list($micro,$seconds) = split(" ", microtime());
-@@ -194,7 +196,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 {
-@@ -268,4 +269,6 @@
- }
- // End Mainline Processing
--?>
-+do_hook("poller_bottom");
-+
-+?>
-\ No newline at end of file
-diff -Naur cacti-0.8.6i-old/user_admin.php cacti-0.8.6i/user_admin.php
---- cacti-0.8.6i-old/user_admin.php    2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/user_admin.php        2007-01-23 15:00:42.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 @@
-                               <td <?php print (($_GET["action"] == "graph_settings_edit") ? "bgcolor='silver'" : "bgcolor='#DFDFDF'");?> nowrap='nowrap' width='130' align='center' class='tab'>
-                                       <span class='textHeader'><a href='user_admin.php?action=graph_settings_edit&id=<?php print $_GET["id"];?>'>Graph Settings</a></span>
-                               </td>
-+                              <?php do_hook("user_admin_tab");?>
-                               <td></td>
-                       </tr>
-               </table>
-@@ -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.6i-old/utilities.php cacti-0.8.6i/utilities.php
---- cacti-0.8.6i-old/utilities.php     2007-01-23 21:29:26.000000000 -0600
-+++ cacti-0.8.6i/utilities.php 2007-01-23 14:47:07.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;
- }
-@@ -971,7 +974,9 @@
-       </tr>
-       <?php
-+      do_hook("utilities_list");
-+
-       html_end_box();
- }
--?>
-+?>
-\ No newline at end of file
diff --git a/cacti-plugin-0.8.6j.diff b/cacti-plugin-0.8.6j.diff
deleted file mode 100644 (file)
index 5ad7281..0000000
+++ /dev/null
@@ -1,1108 +0,0 @@
-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... -->
- <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
-+<?php do_hook("login_before");
-+
-+$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
-+$cacti_logo = do_hook_function('cacti_image', $cacti_logo);
-+
-+?>
-+
- <table align="center">
-       <tr>
--              <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
-+              <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
-       </tr>
-       <?php
-       if ($_REQUEST["action"] == "login") {?>
-@@ -155,6 +162,8 @@
- <input type="hidden" name="action" value="login">
-+<?php do_hook("login_after"); ?>
-+
- </form>
- </body>
-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"])) ? "<em>None</em>" : $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" : "<span style='color: red;'>No</span>");
-+                      $ds_table['template_name'] = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
-+                      $ds_table = do_hook_function("data_sources_table", $ds_table);
-+
-                               ?>
-                               <td>
-                                       <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>
-                               </td>
-                               <td>
--                                      <?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>
-+                                      <?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>
-                               </td>
-                               <td>
--                                      <?php print (($data_source["active"] == "on") ? "Yes" : "<span style='color: red;'>No</span>");?>
-+                                      <?php print $ds_table['active']; ?>
-                               </td>
-                               <td>
--                                      <?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>
-+                                      <?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>
-                               </td>
-                               <td style="<?php print get_checkbox_style();?>" width="1%" align="right">
-                                       <input type='checkbox' style='margin: 0px;' name='chk_<?php print $data_source["local_data_id"];?>' title="<?php print $data_source["name_cache"];?>">
-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 @@
-                                               <td valign='top' style='padding: 3px;' class='noprint'>
-                                                       <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>
-                                                       <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>
-+                                                      <?php do_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET["local_graph_id"], 'rra' => $rra["id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                               </td>
-                                       </tr>
-                                       <tr>
-@@ -208,6 +209,7 @@
-                                       </td>
-                                       <td valign='top' style='padding: 3px;' class='noprint'>
-                                               <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>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET["local_graph_id"], 'rra' =>  $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-@@ -239,6 +241,7 @@
-                                       </td>
-                                       <td valign='top' style='padding: 3px;'>
-                                               <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>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET["local_graph_id"], 'rra' =>  $_GET["rra_id"], 'view_type' => $_REQUEST["view_type"])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-@@ -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 @@
-                       </td>
-                       <td class="textInfo" rowspan="2" valign="top">
-                               <span style="color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
--                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
-+                              <span style="color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
-+                              <?php do_hook("graphs_new_top_links"); ?>
-                       </td>
-               </tr>
-                       <td>
-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 @@
-                               </td>
-                       </tr>\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 "</form>\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 @@
-                       </tr>\n
-                       <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\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 @@
-                       <html>
-                       <head>
-                               <title>Cacti</title>
--                              <link href="include/main.css" rel="stylesheet">
-+                              <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-                       </style>
-                       </head>
-@@ -85,7 +85,7 @@
-                       <table width="450" align='center'>
-                               <tr>
--                                      <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
-+                                      <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
-                               </tr>
-                               <tr height='10'><td></td></tr>
-                               <tr>
-@@ -93,7 +93,7 @@
-                                       need access to this particular section, please contact the Cacti administrator.</td>
-                               </tr>
-                               <tr>
--                                      <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='logout.php'>Login</a> )</td>
-+                                      <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>
-                               </tr>
-                       </table>
-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 @@
-+<?php
-+
-+/*
-+ * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
-+ * Licensed under the GNU GPL. For full terms see the file COPYING.
-+ */
-+
-+global $plugin_hooks;
-+$plugin_hooks = array();
-+
-+function use_plugin ($name) {
-+    global $config;
-+    if (file_exists($config["base_path"] . "/plugins/$name/setup.php")) {
-+        include_once($config["base_path"] . "/plugins/$name/setup.php");
-+        $function = "plugin_init_$name";
-+        if (function_exists($function)) {
-+            $function();
-+        }
-+    }
-+}
-+
-+/**
-+ * This function executes a hook.
-+ * @param string $name Name of hook to fire
-+ * @return mixed $data
-+ */
-+function do_hook ($name) {
-+    global $plugin_hooks;
-+    $data = func_get_args();
-+    $ret = '';
-+
-+    if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $function($data);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $data;
-+}
-+
-+function do_hook_function($name,$parm=NULL) {
-+    global $plugin_hooks;
-+    $ret = $parm;
-+
-+    if (isset($plugin_hooks[$name])
-+          && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $ret = $function($ret);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $ret;
-+}
-+
-+/* On startup, register all plugins configured for use. */
-+if (isset($plugins) && is_array($plugins)) {
-+    foreach ($plugins as $name) {
-+        use_plugin($name);
-+    }
-+}
-+
-+?>
-\ 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 "<meta http-equiv=refresh content='99999'>\r\n";
-               }else{
--                      print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
-+                      $refresh = do_hook_function("top_graph_refresh", read_graph_config_option("page_refresh"));
-+                      print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
-               }
-       }
-       ?>
--      <link href="include/main.css" rel="stylesheet">
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/treeview/ua.js"></script>
--      <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
--      <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
-@@ -118,13 +119,14 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td nowrap>
--                                              &nbsp;<?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>&nbsp;
--                                      </td>
-+                                              &nbsp;<?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
-+                                              do_hook("top_graph_header_tabs");
-+                                      ?>&nbsp;                                        </td>
-                                       <td>
--                                              <img src="images/cacti_backdrop2.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
-                                       </td>
-                                       <td align="right" nowrap>
--                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-+                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-                                       </td>
-                               </tr>
-                       </table>
-@@ -132,7 +134,7 @@
-       </tr>
-       <tr height="2" colspan="2" bgcolor="#183c8f" class="noprint">
-               <td colspan="2">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9" class="noprint">
-@@ -144,7 +146,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -152,10 +154,10 @@
-               </td>
-       </tr>
-       <tr class="noprint">
--              <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
--                      <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
-+              <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;">
-+                      <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>
-               </td>
--              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
-+              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
-               </td>
-       </tr>
-@@ -203,4 +205,4 @@
-                       <?php } ?>
-               </td>
-               <?php } ?>
--              <td valign="top">
-+              <td valign="top">
-\ 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;
- ?>
- <html>
- <head>
-       <title>cacti</title>
--      <link href="include/main.css" rel="stylesheet">
--      <script type="text/javascript" src="include/layout.js"></script>
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
-       <?php if (isset($refresh)) {
-       print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
-       }?>
- </style>
- </head>
--<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
-+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
- <table width="100%" cellspacing="0" cellpadding="0">
-       <tr height="37" bgcolor="#a9a9a9">
-@@ -45,10 +45,11 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td valign="bottom">
--                                              &nbsp;<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>
--                                      </td>
-+                                              &nbsp;<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
-+                                              do_hook("top_header_tabs");
-+                                      ?></td>
-                                       <td align="right">
--                                              <img src="images/cacti_backdrop.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
-                                       </td>
-                               </tr>
-                       </table>
-@@ -56,7 +57,7 @@
-       </tr>
-       <tr height="2" bgcolor="#183c8f">
-               <td colspan="3">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9">
-@@ -68,7 +69,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if (read_config_option("global_auth") == "on") { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -76,10 +77,10 @@
-               </td>
-       </tr>
-       <tr>
--              <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;">
--                      <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
--              </td>
--              <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-+              <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;">
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
-+              </td>
-+              <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-               </td>
-       </tr>
-@@ -89,9 +90,9 @@
-                               <?php draw_menu();?>
-                       </table>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
--                      <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <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>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-               </td>
-               <td></td>
-       </tr>
-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");
-+
- ?>
- <table width="98%" align="center">
-       <tr>
-@@ -44,6 +46,8 @@
- </table>
- <?php
-+do_hook("console_after");
-+
- include("./include/bottom_footer.php");
- ?>
-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;
-+      ?>
-       <tr>
-               <td bgcolor="#E1E1E1">
--                      <a href="<?php print $cancel_url;?>"><img src="images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
--                      <a href="<?php print $action_url . "&confirm=yes";?>"><img src="images/button_delete.gif" border="0" alt="Delete" align="absmiddle"></a>
-+                      <a href="<?php print $cancel_url;?>"><img src="<?php print $config['url_path'] ?>images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
-+                      <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>
-               </td>
-       </tr>
- <?php }
-@@ -434,6 +436,7 @@
-    @arg $force_type - if specified, will force the 'action' button to be either
-      'save' or 'create'. otherwise this field should be properly auto-detected */
- function form_save_button($cancel_url, $force_type = "", $key_field = "id") {
-+      global $config;
-       if (empty($force_type)) {
-               if (empty($_GET[$key_field])) {
-                       $img = "button_create.gif";
-@@ -454,8 +457,8 @@
-               <tr>
-                        <td bgcolor="#f5f5f5" align="right">
-                               <input type='hidden' name='action' value='save'>
--                              <a href='<?php print $cancel_url;?>'><img src='images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
--                              <input type='image' src='images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-+                              <a href='<?php print $cancel_url;?>'><img src='<?php echo $config['url_path']; ?>images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-                       </td>
-               </tr>
-       </table>
-@@ -463,4 +466,4 @@
-       <?php
- }
--?>
-+?>
-\ 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 @@
-                                       <table width='1' cellpadding='0'>
-                                               <tr>
-                                                       <td>
--                                                              <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>
-+                                                              <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>
-                                                       </td>
-                                                       <td valign='top' style='padding: 3px;' class='noprint'>
--                                                              <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>
-+                                                              <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>
-+                                                              <?php do_hook('graph_buttons', array('hook' => 'graphs', 'local_graph_id' => $graph["local_graph_id"], 'rra' =>  0, 'view_type' => '')); ?>
-                                                       </td>
-                                               </tr>
-                                       </table>
-@@ -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 @@
-                               <table width='1' cellpadding='0'>
-                                       <tr>
-                                               <td>
--                                                      <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>
-+                                                      <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>
-                                               </td>
-                                               <td valign='top' style='padding: 3px;'>
--                                                      <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>
-+                                                      <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>
-+                                                      <?php do_hook('graph_buttons', array('hook' => 'thumbnails', 'local_graph_id' => $graph["local_graph_id"], 'rra' =>  0, 'view_type' => '')); ?>
-                                               </td>
-                                       </tr>
-                               </table>
-@@ -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 = "---&nbsp;";
-@@ -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 "<tr><td class='textMenuItemSelected' background='images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
-+                                              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";
-                                       }else{
--                                              print "<tr><td class='textMenuItem' background='images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-+                                              print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-                                       }
-                               }
-                       }
-               }
-       }
--      print "<tr><td class='textMenuItem' background='images/menu_line.gif'></td></tr>\n";
-+      print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'></td></tr>\n";
-       print '</table></td></tr>';
- }
-@@ -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;
-       ?>
-       <table align='center' width='98%'>
-               <tr>
-                       <td width='1' valign='top'>
--                              <img src='images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-+                              <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-                       </td>
-                       <td align='right'>
-                               Choose an action:
-                               <?php form_dropdown("drp_action",$actions_array,"","","1","","");?>
-                       </td>
-                       <td width='1' align='right'>
--                              <input type='image' src='images/button_go.gif' alt='Go'>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/button_go.gif' alt='Go'>
-                       </td>
-               </tr>
-       </table>
-@@ -626,4 +634,4 @@
-       </tr>
- <?php }
--?>
-+?>
-\ 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 "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
-                       /* if we are at the end of a row, start a new one */
-@@ -895,7 +895,7 @@
-                       }
-               }else{
-                       print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\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 "<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>";
-+                      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>";
-                       print "</tr><tr>\n";
-               }else{
--                      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>";
-+                      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>";
-                       print "</tr><tr>\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 @@
-+<?php
-+
-+header("Location:../index.php");
-+
-+?>
-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 @@
-                               <td <?php print (($_GET["action"] == "graph_settings_edit") ? "bgcolor='silver'" : "bgcolor='#DFDFDF'");?> nowrap='nowrap' width='130' align='center' class='tab'>
-                                       <span class='textHeader'><a href='user_admin.php?action=graph_settings_edit&id=<?php print $_GET["id"];?>'>Graph Settings</a></span>
-                               </td>
-+                              <?php do_hook("user_admin_tab");?>
-                               <td></td>
-                       </tr>
-               </table>
-@@ -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 @@
-       </tr>
-       <?php
-+      do_hook("utilities_list");
-+
-       html_end_box();
- }
--?>
-+?>
-\ No newline at end of file
diff --git a/cacti-plugin-0.8.7a.diff b/cacti-plugin-0.8.7a.diff
deleted file mode 100644 (file)
index 425865c..0000000
+++ /dev/null
@@ -1,1072 +0,0 @@
-diff -Nuar cacti-0.8.7a-old/auth_changepassword.php cacti-0.8.7a/auth_changepassword.php
---- cacti-0.8.7a-old/auth_changepassword.php   2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/auth_changepassword.php       2007-11-18 09:38:25.000000000 -0600
-@@ -54,6 +54,8 @@
-                                       header("Location: index.php"); break;
-                               case '3': /* default graph page */
-                                       header("Location: graph_view.php"); break;
-+                              default:
-+                                      do_hook_function('login_options_navigate', $user['login_opts']);
-                       }
-               }else{
-                       header("Location: graph_view.php");
-diff -Nuar cacti-0.8.7a-old/auth_login.php cacti-0.8.7a/auth_login.php
---- cacti-0.8.7a-old/auth_login.php    2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/auth_login.php        2007-11-18 09:38:25.000000000 -0600
-@@ -203,6 +203,8 @@
-                               header("Location: index.php"); break;
-                       case '3': /* default graph page */
-                               header("Location: graph_view.php"); break;
-+                      default:
-+                              do_hook_function('login_options_navigate', $user['login_opts']);
-               }
-               exit;
-@@ -253,9 +255,18 @@
- <body bgcolor="#FFFFFF" onload="document.login.login_username.focus()">
-       <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
-       <input type="hidden" name="action" value="login">
-+<?php
-+
-+do_hook("login_before");
-+
-+$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
-+$cacti_logo = do_hook_function('cacti_image', $cacti_logo);
-+
-+?>
-       <table align="center">
-               <tr>
--                      <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
-+                      <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
-+
-               </tr>
-               <?php
-@@ -308,6 +319,7 @@
-                       <td><input type="submit" value="Login"></td>
-               </tr>
-       </table>
-+<?php do_hook('login_after'); ?>
-       </form>
- </body>
- </html>
-diff -Nuar cacti-0.8.7a-old/data_sources.php cacti-0.8.7a/data_sources.php
---- cacti-0.8.7a-old/data_sources.php  2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/data_sources.php      2007-11-18 09:38:25.000000000 -0600
-@@ -1142,6 +1142,7 @@
-       $i = 0;
-       if (sizeof($data_sources) > 0) {
-               foreach ($data_sources as $data_source) {
-+                      $data_source = do_hook_function('data_sources_table', $data_source);
-                       $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
-                       $data_input_name    = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
-                       $poller_interval    = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
-diff -Nuar cacti-0.8.7a-old/graph_image.php cacti-0.8.7a/graph_image.php
---- cacti-0.8.7a-old/graph_image.php   2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/graph_image.php       2007-11-18 09:38:25.000000000 -0600
-@@ -44,6 +44,8 @@
- /* flush the headers now */
- ob_end_clean();
-+do_hook_function('graph_image');
-+
- session_write_close();
- $graph_data_array = array();
-diff -Nuar cacti-0.8.7a-old/graph.php cacti-0.8.7a/graph.php
---- cacti-0.8.7a-old/graph.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/graph.php     2007-11-18 09:39:31.000000000 -0600
-@@ -93,6 +93,7 @@
-                                                       <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>
-                                                       <a href='graph_xport.php?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_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
-                                                       <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>
-+                                                      <?php do_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $rra['id'], 'view_type' => $_REQUEST['view_type'])); ?>
-                                               </td>
-                                       </tr>
-                                       <tr>
-@@ -207,6 +208,7 @@
-                                       <td valign='top' style='padding: 3px;' class='noprint'>
-                                               <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>
-                                               <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $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_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET['local_graph_id'], 'rra' =>  $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-@@ -239,6 +241,7 @@
-                                       <td valign='top' style='padding: 3px;'>
-                                               <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>
-                                               <a href='graph_xport.php?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_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
-+                                              <?php do_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET['local_graph_id'], 'rra' =>  $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
-                                       </td>
-                               </tr>
-                               <tr>
-diff -Nuar cacti-0.8.7a-old/graphs_new.php cacti-0.8.7a/graphs_new.php
---- cacti-0.8.7a-old/graphs_new.php    2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/graphs_new.php        2007-11-18 09:38:25.000000000 -0600
-@@ -473,7 +473,8 @@
-                       </td>
-                       <td nowrap style='white-space: nowrap;' class="textInfo" align="center" valign="top">
-                               <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
--                              <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
-+                              <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
-+                              <?php do_hook('graphs_new_top_links'); ?>
-                       </td>
-               </tr>
-       </table>
-diff -Nuar cacti-0.8.7a-old/graphs.php cacti-0.8.7a/graphs.php
---- cacti-0.8.7a-old/graphs.php        2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/graphs.php    2007-11-18 09:38:25.000000000 -0600
-@@ -45,6 +45,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 @@
-                               </td>
-                       </tr>\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)) {
-diff -Nuar cacti-0.8.7a-old/host.php cacti-0.8.7a/host.php
---- cacti-0.8.7a-old/host.php  2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/host.php      2007-11-18 09:38:25.000000000 -0600
-@@ -44,6 +44,8 @@
-       6 => "Change Availability Options"
-       );
-+$device_actions = do_hook_function('device_action_array', $device_actions);
-+
- /* set default action */
- if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
-@@ -309,6 +311,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");
-@@ -445,6 +449,11 @@
-                       </tr>\n
-                       <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\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 -Nuar cacti-0.8.7a-old/include/auth.php cacti-0.8.7a/include/auth.php
---- cacti-0.8.7a-old/include/auth.php  2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/auth.php      2007-11-18 09:38:25.000000000 -0600
-@@ -75,7 +75,7 @@
-                       <html>
-                       <head>
-                               <title>Cacti</title>
--                              <link href="include/main.css" rel="stylesheet">
-+                              <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-                       </style>
-                       </head>
-@@ -83,7 +83,7 @@
-                       <table width="450" align='center'>
-                               <tr>
--                                      <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
-+                                      <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
-                               </tr>
-                               <tr height='10'><td></td></tr>
-                               <tr>
-@@ -91,7 +91,7 @@
-                                       need access to this particular section, please contact the Cacti administrator.</td>
-                               </tr>
-                               <tr>
--                                      <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='index.php'>Login</a> )</td>
-+                                      <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='<?php echo $config['url_path']; ?>index.php'>Login</a> )</td>
-                               </tr>
-                       </table>
-diff -Nuar cacti-0.8.7a-old/include/global_arrays.php cacti-0.8.7a/include/global_arrays.php
---- cacti-0.8.7a-old/include/global_arrays.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/global_arrays.php     2007-11-18 09:40:22.000000000 -0600
-@@ -22,6 +22,8 @@
-  +-------------------------------------------------------------------------+
- */
-+global $menu;
-+
- $messages = array(
-       1  => array(
-               "message" => 'Save Successful.',
-@@ -595,4 +597,10 @@
-       GDC_SLASH => "/"
-       );
-+$plugin_architecture = array(
-+      'version' => '1.4'
-+      );
-+
-+do_hook('config_arrays');
-+
- ?>
-diff -Nuar cacti-0.8.7a-old/include/global_form.php cacti-0.8.7a/include/global_form.php
---- cacti-0.8.7a-old/include/global_form.php   2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/global_form.php       2007-11-18 09:38:25.000000000 -0600
-@@ -22,8 +22,9 @@
-  +-------------------------------------------------------------------------+
- */
--if (!defined("VALID_HOST_FIELDS")) {
--      define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)");
-+if (!defined('VALID_HOST_FIELDS')) {
-+      $string = do_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)');
-+      define('VALID_HOST_FIELDS', $string);
- }
- /* file: cdef.php, action: edit */
-@@ -1153,4 +1154,6 @@
-               )
-       );
-+do_hook('config_form');
-+
- ?>
-diff -Nuar cacti-0.8.7a-old/include/global.php cacti-0.8.7a/include/global.php
---- cacti-0.8.7a-old/include/global.php        2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/global.php    2007-11-18 09:38:25.000000000 -0600
-@@ -41,6 +41,21 @@
- /* Default session name - Session name must contain alpha characters */
- $cacti_session_name = "Cacti";
-+$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'] = '/';
-+ 
-+
- /* Include configuration */
- include(dirname(__FILE__) . "/config.php");
-@@ -73,7 +88,6 @@
-       "rebuild_poller_cache.php"
- );
--$config = array();
- $colors = array();
- /* this should be auto-detected, set it manually if needed */
-@@ -88,6 +102,13 @@
- $config["include_path"] = dirname(__FILE__);
- $config["rra_path"] = $config["base_path"] . '/rra';
-+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";
-diff -Nuar cacti-0.8.7a-old/include/global_settings.php cacti-0.8.7a/include/global_settings.php
---- cacti-0.8.7a-old/include/global_settings.php       2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/global_settings.php   2007-11-18 09:38:25.000000000 -0600
-@@ -1083,4 +1083,6 @@
-               )
-       );
-+do_hook('config_settings');
-+
- ?>
-diff -Nuar cacti-0.8.7a-old/include/plugins.php cacti-0.8.7a/include/plugins.php
---- cacti-0.8.7a-old/include/plugins.php       1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.7a/include/plugins.php   2007-11-18 09:38:25.000000000 -0600
-@@ -0,0 +1,89 @@
-+<?php
-+
-+/*
-+ * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
-+ * Licensed under the GNU GPL. For full terms see the file COPYING.
-+ */
-+
-+global $plugin_hooks;
-+$plugin_hooks = array();
-+
-+function use_plugin ($name) {
-+    global $config;
-+    if (file_exists($config['base_path'] . "/plugins/$name/setup.php")) {
-+        include_once($config['base_path'] . "/plugins/$name/setup.php");
-+        $function = "plugin_init_$name";
-+        if (function_exists($function)) {
-+            $function();
-+        }
-+    }
-+}
-+
-+/**
-+ * This function executes a hook.
-+ * @param string $name Name of hook to fire
-+ * @return mixed $data
-+ */
-+function do_hook ($name) {
-+    global $plugin_hooks;
-+    $data = func_get_args();
-+    $ret = '';
-+
-+    if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $function($data);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $data;
-+}
-+
-+function do_hook_function($name,$parm=NULL) {
-+    global $plugin_hooks;
-+    $ret = $parm;
-+
-+    if (isset($plugin_hooks[$name])
-+          && is_array($plugin_hooks[$name])) {
-+        foreach ($plugin_hooks[$name] as $function) {
-+            if (function_exists($function)) {
-+                $ret = $function($ret);
-+            }
-+        }
-+    }
-+
-+    /* Variable-length argument lists have a slight problem when */
-+    /* passing values by reference. Pity. This is a workaround.  */
-+    return $ret;
-+}
-+
-+function api_user_realm_auth ($filename = '') {
-+      global $user_realms, $user_auth_realm_filenames, $user_auth_realms;
-+      /* list all realms that this user has access to */
-+
-+      if (!isset($user_realms)) {
-+              if (read_config_option('global_auth') == 'on') {
-+                      $user_realms = db_fetch_assoc('select realm_id from user_auth_realm where user_id=' . $_SESSION['sess_user_id']);
-+                      $user_realms = array_rekey($user_realms, 'realm_id', 'realm_id');
-+              }else{
-+                      $user_realms = $user_auth_realms;
-+              }
-+      }
-+
-+      if ($filename != '') {
-+              if (isset($user_realms[$user_auth_realm_filenames{basename($filename)}]))
-+                      return TRUE;
-+      }
-+      return FALSE;
-+}
-+
-+/* On startup, register all plugins configured for use. */
-+if (isset($plugins) && is_array($plugins)) {
-+    foreach ($plugins as $name) {
-+        use_plugin($name);
-+    }
-+}
-+
-diff -Nuar cacti-0.8.7a-old/include/top_graph_header.php cacti-0.8.7a/include/top_graph_header.php
---- cacti-0.8.7a-old/include/top_graph_header.php      2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/top_graph_header.php  2007-11-18 09:38:25.000000000 -0600
-@@ -92,26 +92,30 @@
-       }
- }
-+$page_title = do_hook_function('page_title', 'Cacti');
-+
- ?>
- <html>
- <head>
--      <title>Cacti</title>
-+      <title><?php echo $page_title; ?></title>
-       <?php if (isset($_SESSION["custom"])) {
-               if ($_SESSION["custom"]) {
-                       print "<meta http-equiv=refresh content='99999'>\r\n";
-               }else{
--                      print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
-+                      $refresh = do_hook_function('top_graph_refresh', read_graph_config_option('page_refresh'));
-+                      print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
-               }
-       }
-       ?>
--      <link href="include/main.css" rel="stylesheet">
--      <link href="images/favicon.ico" rel="shortcut icon"/>
--      <script type="text/javascript" src="include/layout.js"></script>
--      <script type="text/javascript" src="include/treeview/ua.js"></script>
--      <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
--      <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
--      <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-+      <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon"/>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
-+      <?php do_hook('page_head'); ?>
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
-@@ -123,13 +127,15 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td nowrap>
--                                              &nbsp;<?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<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a>&nbsp;
-+                                              &nbsp;<?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<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a><?php
-+                                              do_hook('top_graph_header_tabs');
-+                                      ?>&nbsp;
-                                       </td>
-                                       <td>
--                                              <img src="images/cacti_backdrop2.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif" align="absmiddle">
-                                       </td>
-                                       <td align="right" nowrap>
--                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-+                                              <?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>';}?>&nbsp;&nbsp;<?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 }?>&nbsp;<br>
-                                       </td>
-                               </tr>
-                       </table>
-@@ -137,7 +143,7 @@
-       </tr>
-       <tr height="2" colspan="2" bgcolor="#183c8f" class="noprint">
-               <td colspan="2">
--                      <img src="images/transparent_line.gif" width="170" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="170" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9" class="noprint">
-@@ -149,7 +155,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -157,10 +163,10 @@
-               </td>
-       </tr>
-       <tr class="noprint">
--              <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
--                      <img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
-+              <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;">
-+                      <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>
-               </td>
--              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
-+              <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
-               </td>
-       </tr>
-diff -Nuar cacti-0.8.7a-old/include/top_header.php cacti-0.8.7a/include/top_header.php
---- cacti-0.8.7a-old/include/top_header.php    2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/include/top_header.php        2007-11-18 09:38:25.000000000 -0600
-@@ -22,21 +22,25 @@
-  +-------------------------------------------------------------------------+
- */
--global $colors;
-+global $colors, $config;
-+
-+$page_title = do_hook_function('page_title', 'Cacti');
-+
- ?>
- <html>
- <head>
--      <title>Cacti</title>
--      <link href="include/main.css" rel="stylesheet">
--      <link href="images/favicon.ico" rel="shortcut icon"/>
--      <script type="text/javascript" src="include/layout.js"></script>
-+      <title><?php echo $page_title; ?></title>
-+      <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
-+      <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon"/>
-+      <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
-       <?php if (isset($refresh)) {
-       print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
--      }?>
-+      }
-+      do_hook('page_head'); ?>
- </style>
- </head>
--<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/left_border.gif">
-+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="<?php echo $config['url_path']; ?>images/left_border.gif">
- <table width="100%" cellspacing="0" cellpadding="0">
-       <tr height="37" bgcolor="#a9a9a9">
-@@ -44,10 +48,11 @@
-                       <table width="100%" cellspacing="0" cellpadding="0">
-                               <tr>
-                                       <td valign="bottom">
--                                              &nbsp;<a href="index.php"><img src="images/tab_console_down.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>
--                                      </td>
-+                                              &nbsp;<a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console_down.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="Graphs" align="absmiddle" border="0"></a><?php
-+                                              do_hook('top_header_tabs');
-+                                      ?></td>
-                                       <td align="right">
--                                              <img src="images/cacti_backdrop.gif" align="absmiddle">
-+                                              <img src="<?php echo $config['url_path']; ?>images/cacti_backdrop.gif" align="absmiddle">
-                                       </td>
-                               </tr>
-                       </table>
-@@ -55,7 +60,7 @@
-       </tr>
-       <tr height="2" bgcolor="#183c8f">
-               <td colspan="3">
--                      <img src="images/transparent_line.gif" height="2" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" height="2" border="0"><br>
-               </td>
-       </tr>
-       <tr height="5" bgcolor="#e9e9e9">
-@@ -67,7 +72,7 @@
-                                       </td>
-                                       <td align="right">
-                                               <?php if (read_config_option("auth_method") != 0) { ?>
--                                              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>)&nbsp;
-+                                              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>)&nbsp;
-                                               <?php } ?>
-                                       </td>
-                               </tr>
-@@ -75,10 +80,10 @@
-               </td>
-       </tr>
-       <tr>
--              <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;">
--                      <img src="images/transparent_line.gif" width="135" height="2" border="0"><br>
--              </td>
--              <td colspan="2" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-+              <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;">
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="2" border="0"><br>
-+              </td>
-+              <td colspan="2" height="8" style="background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
-               </td>
-       </tr>
-@@ -88,9 +93,9 @@
-                               <?php draw_menu();?>
-                       </table>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
--                      <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
--                      <img src="images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-+                      <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>
-+                      <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="135" height="5" border="0"><br>
-               </td>
-               <td width="100%" colspan="2" valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;"><?php display_output_messages();?>
-diff -Nuar cacti-0.8.7a-old/index.php cacti-0.8.7a/index.php
---- cacti-0.8.7a-old/index.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/index.php     2007-11-18 09:38:25.000000000 -0600
-@@ -25,6 +25,8 @@
- include("./include/auth.php");
- include("./include/top_header.php");
-+do_hook('console_before');
-+
- ?>
- <table width="100%" align="center">
-       <tr>
-@@ -46,6 +48,8 @@
- <?php
-+do_hook('console_after');
-+
- include("./include/bottom_footer.php");
- ?>
-diff -Nuar cacti-0.8.7a-old/lib/api_device.php cacti-0.8.7a/lib/api_device.php
---- cacti-0.8.7a-old/lib/api_device.php        2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/api_device.php    2007-11-18 09:38:25.000000000 -0600
-@@ -126,6 +126,8 @@
-       $save["ping_retries"]         = form_input_validate($ping_retries, "ping_retries", "^[0-9]+$", true, 3);
-       $save["max_oids"]             = form_input_validate($max_oids, "max_oids", "^[0-9]+$", true, 3);
-+      $save = do_hook_function('api_device_save', $save);
-+
-       $host_id = 0;
-       if (!is_error_message()) {
-diff -Nuar cacti-0.8.7a-old/lib/functions.php cacti-0.8.7a/lib/functions.php
---- cacti-0.8.7a-old/lib/functions.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/functions.php     2007-11-18 09:38:26.000000000 -0600
-@@ -1476,6 +1476,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(
-@@ -1488,7 +1489,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"),
-@@ -1565,6 +1566,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"] : "");
-diff -Nuar cacti-0.8.7a-old/lib/html_form.php cacti-0.8.7a/lib/html_form.php
---- cacti-0.8.7a-old/lib/html_form.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/html_form.php     2007-11-18 09:38:26.000000000 -0600
-@@ -655,11 +655,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;
-+?>
-         <tr>
-                 <td bgcolor="#E1E1E1">
--                        <a href="<?php print $cancel_url;?>"><img src="images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
--                        <a href="<?php print $action_url . "&confirm=yes";?>"><img src="images/button_delete.gif" border="0" alt="Delete" align="absmiddle"></a>
-+                        <a href="<?php print $cancel_url;?>"><img src="<?php print $config['url_path'] ?>images/button_cancel.gif" border="0" alt="Cancel" align="absmiddle"></a>
-+                        <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>
-                 </td>
-         </tr>
- <?php }
-@@ -670,6 +672,7 @@
-    @arg $force_type - if specified, will force the 'action' button to be either
-      'save' or 'create'. otherwise this field should be properly auto-detected */
- function form_save_button($cancel_url, $force_type = "", $key_field = "id") {
-+      global $config;
-         if (empty($force_type)) {
-                 if (empty($_GET[$key_field])) {
-                         $img = "button_create.gif";
-@@ -690,8 +693,8 @@
-                 <tr>
-                          <td bgcolor="#f5f5f5" align="right">
-                                 <input type='hidden' name='action' value='save'>
--                                <a href='<?php print $cancel_url;?>'><img src='images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
--                                <input type='image' src='images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-+                                <a href='<?php print $cancel_url;?>'><img src='<?php echo $config['url_path']; ?>images/button_cancel2.gif' alt='Cancel' align='absmiddle' border='0'></a>
-+                                <input type='image' src='<?php echo $config['url_path']; ?>images/<?php print $img;?>' alt='<?php print $alt;?>' align='absmiddle'>
-                         </td>
-                 </tr>
-         </table>
-diff -Nuar cacti-0.8.7a-old/lib/html.php cacti-0.8.7a/lib/html.php
---- cacti-0.8.7a-old/lib/html.php      2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/html.php  2007-11-18 09:44:04.000000000 -0600
-@@ -86,6 +86,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 != "") {
-@@ -99,12 +100,13 @@
-                                       <table width='1' cellpadding='0'>
-                                               <tr>
-                                                       <td>
--                                                              <a href='graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' 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>
-+                                                              <a href='<?php print $config['url_path']; ?>graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' 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>
-                                                       </td>
-                                                       <td valign='top' style='padding: 3px;' class='noprint'>
--                                                              <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>
--                                                              <a href='graph_xport.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
--                                                              <a href='#page_top'><img src='images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
-+                                                              <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>
-+                                                              <a href='<?php print $config['url_path']; ?>graph_xport.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><<?php print $config['url_path']; ?>img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
-+                                                              <a href='#page_top'><img src='<?php print $config['url_path']; ?>images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
-+                                                              <?php do_hook('graph_buttons', array('hook' => 'graphs', 'local_graph_id' => $graph['local_graph_id'], 'rra' =>  0, 'view_type' => '')); ?>
-                                                       </td>
-                                               </tr>
-                                       </table>
-@@ -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,12 +147,12 @@
-                               <table width='1' cellpadding='0'>
-                                       <tr>
-                                               <td>
--                                                      <a href='graph.php?action=view&rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' 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>
-+                                                      <a href='<?php print $config['url_path']; ?>graph.php?action=view&rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' 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>
-                                               </td>
-                                               <td valign='top' style='padding: 3px;'>
--                                                      <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>
--                                                      <a href='graph_xport.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
--                                                      <a href='#page_top'><img src='images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
-+                                                      <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>
-+                                                      <a href='<?php print $config['url_path']; ?>graph_xport.php?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_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
-+                                                      <a href='#page_top'><img src='<?php print $config['url_path']; ?>images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
-                                               </td>
-                                       </tr>
-                               </table>
-@@ -532,6 +535,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 = "---&nbsp;";
-@@ -541,7 +546,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 = "";
-                                               }
-@@ -570,17 +575,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 "<tr><td class='textMenuItemSelected' background='images/menu_line.gif'><strong><a href='$item_url'>$item_title</a></strong></td></tr>\n";
-+                                              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";
-                                       }else{
--                                              print "<tr><td class='textMenuItem' background='images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-+                                              print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'><a href='$item_url'>$item_title</a></td></tr>\n";
-                                       }
-                               }
-                       }
-               }
-       }
--      print "<tr><td class='textMenuItem' background='images/menu_line.gif'></td></tr>\n";
-+      print "<tr><td class='textMenuItem' background='" . $config['url_path'] . "images/menu_line.gif'></td></tr>\n";
-       print "</table></td></tr>";
- }
-@@ -590,18 +596,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;
-       ?>
-       <table align='center' width='100%'>
-               <tr>
-                       <td width='1' valign='top'>
--                              <img src='images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-+                              <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='absmiddle'>&nbsp;
-                       </td>
-                       <td align='right'>
-                               Choose an action:
-                               <?php form_dropdown("drp_action",$actions_array,"","","1","","");?>
-                       </td>
-                       <td width='1' align='right'>
--                              <input type='image' src='images/button_go.gif' alt='Go'>
-+                              <input type='image' src='<?php echo $config['url_path']; ?>images/button_go.gif' alt='Go'>
-                       </td>
-               </tr>
-       </table>
-diff -Nuar cacti-0.8.7a-old/lib/html_tree.php cacti-0.8.7a/lib/html_tree.php
---- cacti-0.8.7a-old/lib/html_tree.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/html_tree.php     2007-11-18 09:38:26.000000000 -0600
-@@ -890,7 +890,7 @@
-       if (read_graph_config_option("thumbnail_section_tree_1") == "on") {
-               if (read_graph_config_option("timespan_sel") == "on") {
-                       print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title' class='graphimage' id='graph_$local_graph_id'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
-                       /* if we are at the end of a row, start a new one */
-@@ -899,7 +899,7 @@
-                       }
-               }else{
-                       print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img align='middle' alt='$graph_title' class='graphimage' id='graph_$local_graph_id'
--                              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=' .
-+                              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=' .
-                               read_graph_config_option("default_height") . '&graph_width=' . read_graph_config_option("default_width") . "&graph_nolegend=true' border='0'></a></td>\n";
-                       /* if we are at the end of a row, start a new one */
-@@ -909,10 +909,10 @@
-               }
-       }else{
-               if (read_graph_config_option("timespan_sel") == "on") {
--                      print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img class='graphimage' id='graph_$local_graph_id' 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>";
-+                      print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img class='graphimage' id='graph_$local_graph_id' 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>";
-                       print "</tr><tr>\n";
-               }else{
--                      print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img class='graphimage' id='graph_$local_graph_id' src='graph_image.php?local_graph_id=$local_graph_id&rra_id=$rra_id' border='0' alt='$graph_title'></a></td>";
-+                      print "<td><a href='graph.php?local_graph_id=$local_graph_id&rra_id=all'><img class='graphimage' id='graph_$local_graph_id' src='graph_image.php?action=view&local_graph_id=$local_graph_id&rra_id=$rra_id' border='0' alt='$graph_title'></a></td>";
-                       print "</tr><tr>\n";
-               }
-       }
-diff -Nuar cacti-0.8.7a-old/lib/poller.php cacti-0.8.7a/lib/poller.php
---- cacti-0.8.7a-old/lib/poller.php    2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/poller.php        2007-11-18 09:38:26.000000000 -0600
-@@ -320,8 +320,11 @@
-                               }
-                       }
-               }
-+              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;
-diff -Nuar cacti-0.8.7a-old/lib/rrd.php cacti-0.8.7a/lib/rrd.php
---- cacti-0.8.7a-old/lib/rrd.php       2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/rrd.php   2007-11-18 09:38:26.000000000 -0600
-@@ -484,6 +484,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
-@@ -1160,6 +1164,13 @@
-       }
-       }
-+      $graph_array = do_hook_function('rrd_graph_graph_options', array('graph_opts' => $graph_opts, 'graph_defs' => $graph_defs, 'txt_graph_items' => $txt_graph_items, 'graph_id' => $local_graph_id, 'start' => $graph_start, 'end' => $graph_end));
-+      if (!empty($graph_array)) {
-+              $graph_defs = $graph_array['graph_defs'];
-+              $txt_graph_items = $graph_array['txt_graph_items'];
-+              $graph_opts = $graph_array['graph_opts'];
-+      }
-+
-       /* either print out the source or pass the source onto rrdtool to get us a nice PNG */
-       if (isset($graph_data_array["print_source"])) {
-               print "<PRE>" . read_config_option("path_rrdtool") . " graph $graph_opts$graph_defs$txt_graph_items</PRE>";
-@@ -1168,13 +1179,19 @@
-                       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;
-               }
-       }
- }
-diff -Nuar cacti-0.8.7a-old/lib/variables.php cacti-0.8.7a/lib/variables.php
---- cacti-0.8.7a-old/lib/variables.php 2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/lib/variables.php     2007-11-18 09:38:26.000000000 -0600
-@@ -181,6 +181,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;
- }
-diff -Nuar cacti-0.8.7a-old/plugins/index.php cacti-0.8.7a/plugins/index.php
---- cacti-0.8.7a-old/plugins/index.php 1969-12-31 17:00:00.000000000 -0700
-+++ cacti-0.8.7a/plugins/index.php     2007-11-18 09:38:26.000000000 -0600
-@@ -0,0 +1,5 @@
-+<?php
-+
-+header("Location:../index.php");
-+
-+?>
-diff -Nuar cacti-0.8.7a-old/poller.php cacti-0.8.7a/poller.php
---- cacti-0.8.7a-old/poller.php        2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/poller.php    2007-11-18 09:48:01.000000000 -0600
-@@ -73,6 +73,8 @@
- }
- }
-+do_hook('poller_top');
-+
- /* record the start time */
- list($micro,$seconds) = split(" ", microtime());
- $poller_start         = $seconds + $micro;
-@@ -231,6 +233,8 @@
-                       $method         = "cmd.php";
-               }
-+              $extra_args = do_hook_function ('poller_command_args', $extra_args);
-+
-               /* Populate each execution file with appropriate information */
-               foreach ($polling_hosts as $item) {
-                       if ($host_count == 1) {
-@@ -402,9 +406,11 @@
-               /* sleep the appripriate amount of time */
-               if ($poller_runs_completed < $poller_runs) {
-+                      do_hook('poller_bottom');
-                       db_close();
-                       usleep($sleep_time * 1000000);
-                       db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
-+                      do_hook('poller_top');
-               }
-       }else if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_MEDIUM) {
-               cacti_log("WARNING: Cacti Polling Cycle Exceeded Poller Interval by " . $loop_end-$loop_start-$poller_interval . " seconds", TRUE, "POLLER");
-@@ -420,4 +426,6 @@
-       echo "    --debug|-d     Output debug information.  Similar to cacti's DEBUG logging level.\n\n";
- }
-+do_hook('poller_bottom');
-+
- ?>
-diff -Nuar cacti-0.8.7a-old/user_admin.php cacti-0.8.7a/user_admin.php
---- cacti-0.8.7a-old/user_admin.php    2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/user_admin.php        2007-11-18 09:38:26.000000000 -0600
-@@ -72,9 +72,11 @@
-               break;
-       default:
--              include_once("include/top_header.php");
--              user();
--              include_once("include/bottom_footer.php");
-+              if (!do_hook_function('user_admin_action', get_request_var_request("action"))) {
-+                      include_once("include/top_header.php");
-+                      user();
-+                      include_once("include/bottom_footer.php");
-+              }
-               break;
- }
-@@ -407,6 +409,7 @@
-               $save["policy_graph_templates"] = form_input_validate(get_request_var_post("policy_graph_templates", get_request_var_post("_policy_graph_templates")), "policy_graph_templates", "", true, 3);
-               $save["realm"] = get_request_var_post("realm", 0);
-               $save["enabled"] = form_input_validate(get_request_var_post("enabled", ""), "enabled", "", true, 3);
-+              $save = do_hook_function('user_admin_setup_sql_save', $save);
-               if (!is_error_message()) {
-                       $user_id = sql_save($save, "user_auth");
-@@ -449,6 +452,8 @@
-                                       policy_hosts = " . get_request_var_post("policy_hosts") . ",
-                                       policy_graph_templates = " . get_request_var_post("policy_graph_templates") . "
-                                       WHERE id = " . get_request_var_post("id"));
-+                      } else {
-+                              do_hook('user_admin_user_save');
-                       }
-               }
-       }
-@@ -899,6 +904,8 @@
-               $header_label = "[new]";
-       }
-+      do_hook_function('user_admin_edit', (isset($user) ? get_request_var("id") : 0));
-+
-       html_start_box("<strong>User Management</strong> $header_label", "100%", $colors["header"], "3", "center", "");
-       draw_edit_form(array(
-@@ -925,6 +932,7 @@
-                               <td <?php print ((get_request_var("action") == "graph_settings_edit") ? "bgcolor='silver'" : "bgcolor='#DFDFDF'");?> nowrap='nowrap' width='130' align='center' class='tab'>
-                                       <span class='textHeader'><a href='user_admin.php?action=graph_settings_edit&id=<?php print $_GET["id"];?>'>Graph Settings</a></span>
-                               </td>
-+                              <?php do_hook('user_admin_tab');?>
-                               <td></td>
-                       </tr>
-               </table>
-@@ -938,7 +946,9 @@
-       }elseif (get_request_var("action") == "graph_perms_edit") {
-               graph_perms_edit();
-       }else{
--              user_realms_edit();
-+              if (do_hook_function('user_admin_run_action', get_request_var_request("action"))) {
-+                      user_realms_edit();
-+              }
-       }
-       form_save_button("user_admin.php");
-diff -Nuar cacti-0.8.7a-old/utilities.php cacti-0.8.7a/utilities.php
---- cacti-0.8.7a-old/utilities.php     2007-11-17 12:11:52.000000000 -0600
-+++ cacti-0.8.7a/utilities.php 2007-11-18 09:38:26.000000000 -0600
-@@ -129,11 +129,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;
- }
-@@ -1320,6 +1323,8 @@
-       <?php
-+      do_hook('utilities_list');
-+
-       html_end_box();
- }
diff --git a/cacti-upgrade_from_086k_fix.patch b/cacti-upgrade_from_086k_fix.patch
deleted file mode 100644 (file)
index a06e47a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN cacti-0.8.7b.orig/install/index.php cacti-0.8.7b/install/index.php
---- cacti-0.8.7b.orig/install/index.php        2008-02-12 01:57:48.000000000 +0100
-+++ cacti-0.8.7b/install/index.php     2008-02-25 13:25:57.000000000 +0100
-@@ -27,7 +27,7 @@
- /* allow the upgrade script to run for as long as it needs to */
- ini_set("max_execution_time", "0");
--$cacti_versions = array("0.8", "0.8.1", "0.8.2", "0.8.2a", "0.8.3", "0.8.3a", "0.8.4", "0.8.5", "0.8.5a", "0.8.6", "0.8.6a", "0.8.6b", "0.8.6c", "0.8.6d", "0.8.6e", "0.8.6f", "0.8.6g", "0.8.6h", "0.8.6i", "0.8.6j", "0.8.7", "0.8.7a", "0.8.7b");
-+$cacti_versions = array("0.8", "0.8.1", "0.8.2", "0.8.2a", "0.8.3", "0.8.3a", "0.8.4", "0.8.5", "0.8.5a", "0.8.6", "0.8.6a", "0.8.6b", "0.8.6c", "0.8.6d", "0.8.6e", "0.8.6f", "0.8.6g", "0.8.6h", "0.8.6i", "0.8.6j", "0.8.6k", "0.8.7", "0.8.7a", "0.8.7b");
- $old_cacti_version = db_fetch_cell("select cacti from version");
diff --git a/cmd-php-non-unique-hosts.patch b/cmd-php-non-unique-hosts.patch
deleted file mode 100644 (file)
index 01d8a70..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- cacti/cmd.php      2007/11/03 23:03:30     4297
-+++ cacti/cmd.php      2007/11/26 01:34:11     4355
-@@ -201,8 +201,8 @@
-       }
-       foreach ($polling_items as $item) {
--              $data_source = $item["local_data_id"];
--              $current_host = $item["hostname"];
-+              $data_source  = $item["local_data_id"];
-+              $current_host = $item["host_id"];
-               if ($current_host != $last_host) {
-                       $new_host = true;
diff --git a/database_autoincrement_corruption.patch b/database_autoincrement_corruption.patch
deleted file mode 100644 (file)
index c5cd6b2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -ruBbd cacti-0.8.6h/lib/database.php cacti-0.8.6h-patched/lib/database.php
---- cacti-0.8.6h/lib/database.php      2006-04-24 20:07:11.000000000 -0400
-+++ cacti-0.8.6h-patched/lib/database.php      2006-04-24 20:04:26.000000000 -0400
-@@ -214,17 +214,21 @@
-    @arg $table_name - the name of the table to make the replacement in
-    @arg $key_cols - the primary key(s)
-    @returns - the auto incriment id column (if applicable) */
--function sql_save($array_items, $table_name, $key_cols = "id", $autoinc = TRUE) {
-+function sql_save($array_items, $table_name, $key_cols = "id", $autoinc = true) {
-       global $cnn_id;
-       while (list ($key, $value) = each ($array_items)) {
-               $array_items[$key] = "\"" . sql_sanitize($value) . "\"";
-       }
--      if (!$cnn_id->Replace($table_name, $array_items, $key_cols, FALSE, $autoinc)) { return 0; }
-+      $replace_result = $cnn_id->Replace($table_name, $array_items, $key_cols, FALSE, $autoinc);
-+
-+      if ($replace_result == 0) {
-+              return 0;
-+      }
-       /* get the last AUTO_ID and return it */
--      if ($cnn_id->Insert_ID() == "0") {
-+      if (($cnn_id->Insert_ID() == "0") || ($replace_result == 1)) {
-               if (!is_array($key_cols)) {
-                       if (isset($array_items[$key_cols])) {
-                               return str_replace("\"", "", $array_items[$key_cols]);
diff --git a/dec06-vulnerability-poller-0.8.6i.patch b/dec06-vulnerability-poller-0.8.6i.patch
deleted file mode 100644 (file)
index f19c555..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-diff -ruBbd cacti-0.8.6i/cmd.php cacti-0.8.6i-patch/cmd.php
---- cacti-0.8.6i/cmd.php       2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/cmd.php 2007-01-01 12:27:15.328125000 -0500
-@@ -26,7 +26,7 @@
- */
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-@@ -70,6 +71,10 @@
-       $print_data_to_stdout = false;
-       if ($_SERVER["argc"] == "3") {
-               if ($_SERVER["argv"][1] <= $_SERVER["argv"][2]) {
-+                      /* address potential exploits */
-+                      input_validate_input_number($_SERVER["argv"][1]);
-+                      input_validate_input_number($_SERVER["argv"][2]);
-+
-                       $hosts = db_fetch_assoc("select * from host where (disabled = '' and " .
-                                       "id >= " .
-                                       $_SERVER["argv"][1] .
-diff -ruBbd cacti-0.8.6i/copy_cacti_user.php cacti-0.8.6i-patch/copy_cacti_user.php
---- cacti-0.8.6i/copy_cacti_user.php   2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/copy_cacti_user.php     2007-01-01 12:27:15.312500000 -0500
-@@ -25,9 +25,10 @@
- */
- /* do NOT run this script through a web browser */
--if (! isset($_SERVER["argv"][0])) {
--      die("This script is only meant to run at the command line.\n");
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-+
- if (empty($_SERVER["argv"][2])) {
-       die("\nSyntax:\n php copy_cacti_user.php <template user> <new user>\n\n");
- }
-diff -ruBbd cacti-0.8.6i/include/html/inc_timespan_settings.php cacti-0.8.6i-patch/include/html/inc_timespan_settings.php
---- cacti-0.8.6i/include/html/inc_timespan_settings.php        2006-10-09 00:05:58.000000000 -0400
-+++ cacti-0.8.6i-patch/include/html/inc_timespan_settings.php  2007-01-02 11:55:45.953125000 -0500
-@@ -24,6 +24,20 @@
-  +-------------------------------------------------------------------------+
- */
-+/* ================= input validation ================= */
-+input_validate_input_number(get_request_var_request("predefined_timespan"));
-+/* ==================================================== */
-+
-+/* clean up date1 string */
-+if (isset($_REQUEST["date1"])) {
-+      $_REQUEST["date1"] = sanitize_search_string(get_request_var("date1"));
-+}
-+
-+/* clean up date2 string */
-+if (isset($_REQUEST["date2"])) {
-+      $_REQUEST["date2"] = sanitize_search_string(get_request_var("date2"));
-+}
-+
- /* initialize the timespan array */
- $timespan = array();
-diff -ruBbd cacti-0.8.6i/poller.php cacti-0.8.6i-patch/poller.php
---- cacti-0.8.6i/poller.php    2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/poller.php      2007-01-01 12:27:15.328125000 -0500
-@@ -26,7 +26,7 @@
- */
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-diff -ruBbd cacti-0.8.6i/poller_commands.php cacti-0.8.6i-patch/poller_commands.php
---- cacti-0.8.6i/poller_commands.php   2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/poller_commands.php     2007-01-01 12:27:15.328125000 -0500
-@@ -27,7 +27,7 @@
- define("MAX_RECACHE_RUNTIME", 296);
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-diff -ruBbd cacti-0.8.6i/poller_export.php cacti-0.8.6i-patch/poller_export.php
---- cacti-0.8.6i/poller_export.php     2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/poller_export.php       2007-01-01 12:27:15.328125000 -0500
-@@ -25,7 +25,7 @@
- */
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-diff -ruBbd cacti-0.8.6i/poller_reindex_hosts.php cacti-0.8.6i-patch/poller_reindex_hosts.php
---- cacti-0.8.6i/poller_reindex_hosts.php      2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/poller_reindex_hosts.php        2007-01-01 12:27:15.328125000 -0500
-@@ -25,7 +25,7 @@
- */
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-diff -ruBbd cacti-0.8.6i/rebuild_poller_cache.php cacti-0.8.6i-patch/rebuild_poller_cache.php
---- cacti-0.8.6i/rebuild_poller_cache.php      2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/rebuild_poller_cache.php        2007-01-01 12:27:15.312500000 -0500
-@@ -25,7 +25,7 @@
- */
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
- }
-diff -ruBbd cacti-0.8.6i/script_server.php cacti-0.8.6i-patch/script_server.php
---- cacti-0.8.6i/script_server.php     2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/script_server.php       2007-01-01 12:27:15.312500000 -0500
-@@ -26,9 +26,8 @@
- $no_http_headers = true;
- /* do NOT run this script through a web browser */
--if (!isset($_SERVER["argv"][0])) {
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-       die("<br><strong>This script is only meant to run at the command line.</strong>");
--      exit(-1);
- }
- /* define STDOUT/STDIN file descriptors if not running under CLI */
diff --git a/dec06-vulnerability-scripts-0.8.6i.patch b/dec06-vulnerability-scripts-0.8.6i.patch
deleted file mode 100644 (file)
index f59bfa9..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-diff -ruBbd cacti-0.8.6i/scripts/query_host_cpu.php cacti-0.8.6i-patch/scripts/query_host_cpu.php
---- cacti-0.8.6i/scripts/query_host_cpu.php    2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/query_host_cpu.php      2007-01-01 12:50:55.781250000 -0500
-@@ -1,6 +1,12 @@
- <?php
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
-+
- include(dirname(__FILE__) . "/../include/config.php");
- include(dirname(__FILE__) . "/../lib/snmp.php");
-diff -ruBbd cacti-0.8.6i/scripts/query_host_partitions.php cacti-0.8.6i-patch/scripts/query_host_partitions.php
---- cacti-0.8.6i/scripts/query_host_partitions.php     2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/query_host_partitions.php       2007-01-01 12:50:55.781250000 -0500
-@@ -1,6 +1,12 @@
- <?php
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
-+
- include(dirname(__FILE__) . "/../include/config.php");
- include(dirname(__FILE__) . "/../lib/snmp.php");
-diff -ruBbd cacti-0.8.6i/scripts/sql.php cacti-0.8.6i-patch/scripts/sql.php
---- cacti-0.8.6i/scripts/sql.php       2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/sql.php 2007-01-01 12:50:55.781250000 -0500
-@@ -1,6 +1,12 @@
- <?
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
-+
- include(dirname(__FILE__) . "/../include/config.php");
- if ($database_password == "") {
-diff -ruBbd cacti-0.8.6i/scripts/ss_fping.php cacti-0.8.6i-patch/scripts/ss_fping.php
---- cacti-0.8.6i/scripts/ss_fping.php  2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/ss_fping.php    2007-01-01 12:50:55.796875000 -0500
-@@ -1,7 +1,11 @@
- <?php
- #!/usr/bin/php -q
--//STANDARD SCRIPT SERVER HEADER!!!
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
- /* display No errors */
-diff -ruBbd cacti-0.8.6i/scripts/ss_host_cpu.php cacti-0.8.6i-patch/scripts/ss_host_cpu.php
---- cacti-0.8.6i/scripts/ss_host_cpu.php       2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/ss_host_cpu.php 2007-01-01 12:50:55.796875000 -0500
-@@ -1,4 +1,10 @@
- <?php
-+
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
- /* display No errors */
-diff -ruBbd cacti-0.8.6i/scripts/ss_host_disk.php cacti-0.8.6i-patch/scripts/ss_host_disk.php
---- cacti-0.8.6i/scripts/ss_host_disk.php      2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/ss_host_disk.php        2007-01-01 12:50:55.796875000 -0500
-@@ -1,4 +1,10 @@
- <?php
-+
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
- /* display No errors */
-diff -ruBbd cacti-0.8.6i/scripts/ss_sql.php cacti-0.8.6i-patch/scripts/ss_sql.php
---- cacti-0.8.6i/scripts/ss_sql.php    2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/scripts/ss_sql.php      2007-01-01 12:50:55.781250000 -0500
-@@ -1,5 +1,10 @@
- <?php
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+   die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
- $no_http_headers = true;
- /* display ALL errors */
diff --git a/fix_search_session_clear_issue.patch b/fix_search_session_clear_issue.patch
deleted file mode 100644 (file)
index d18759d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- cacti-0.8.6h/host.php      2006-01-03 21:08:30.000000000 -0600
-+++ cacti-fixed/host.php       2006-01-06 22:45:51.630701318 -0600
-@@ -726,18 +726,18 @@
-               unset($_REQUEST["host_status"]);
-       }
--      if (!empty($_SESSION["sess_host_status"])) {
--              if ($_SESSION["sess_host_status"] != $_REQUEST["host_status"]) {
--                      $_REQUEST["page"] = 1;
--              }
--      }
--
-       /* remember these search fields in session vars so we don't have to keep passing them around */
-       load_current_session_value("page", "sess_device_current_page", "1");
-       load_current_session_value("filter", "sess_device_filter", "");
-       load_current_session_value("host_template_id", "sess_device_host_template_id", "-1");
-       load_current_session_value("host_status", "sess_host_status", "-1");
-+      if (!empty($_SESSION["sess_host_status"])) {
-+              if ($_SESSION["sess_host_status"] != $_REQUEST["host_status"]) {
-+                      $_REQUEST["page"] = 1;
-+              }
-+      }
-+
-       html_start_box("<strong>Devices</strong>", "98%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . $_REQUEST["host_template_id"] . "&host_status=" . $_REQUEST["host_status"]);
-       include("./include/html/inc_device_filter_table.php");
diff --git a/fix_sql_syntax_related_to_default_rra_id.patch b/fix_sql_syntax_related_to_default_rra_id.patch
deleted file mode 100644 (file)
index e7ea792..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- cacti-0.8.6h/graph.php     2006-01-03 21:08:30.000000000 -0600
-+++ cacti-fixed/graph.php      2006-01-06 22:40:29.643671752 -0600
-@@ -130,13 +130,13 @@
-       $timespan = -($rra["timespan"]);
-       /* find the step and how often this graph is updated with new data */
--      $ds_step = db_fetch_cell("select
-+      $ds_step = db_fetch_cell("SELECT
-               data_template_data.rrd_step
--              from (data_template_data,data_template_rrd,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 graph_templates_item.local_graph_id=" . $_GET["local_graph_id"] .
--              "limit 0,1");
-+              FROM (data_template_data,data_template_rrd,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 graph_templates_item.local_graph_id=" . $_GET["local_graph_id"] .
-+              " LIMIT 0,1");
-       $ds_step = empty($ds_step) ? 300 : $ds_step;
-       $seconds_between_graph_updates = ($ds_step * $rra["steps"]);
diff --git a/graph-issue-wrra-specs.patch b/graph-issue-wrra-specs.patch
deleted file mode 100644 (file)
index 902d1ab..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
---- cacti/lib/functions.php    2007/11/16 03:33:22     4350
-+++ cacti/lib/functions.php    2007/11/19 02:21:59     4351
-@@ -1077,27 +1077,19 @@
-     @returns - the best cf to use */
- function generate_graph_best_cf($local_data_id, $requested_cf) {
-       if ($local_data_id > 0) {
--              $avail_cf_functions = db_fetch_assoc("SELECT DISTINCT
--                      rra_cf.consolidation_function_id AS rra_cf
--                      FROM (data_template_data
--                      INNER JOIN data_template_data_rra ON data_template_data.id=data_template_data_rra.data_template_data_id)
--                      INNER JOIN (rra INNER JOIN rra_cf ON rra.id=rra_cf.rra_id) ON data_template_data_rra.rra_id=rra.id
--                      WHERE data_template_data.local_data_id=$local_data_id
--                      ORDER BY rra_cf ASC");
-+              $avail_cf_functions = get_rrd_cfs($local_data_id);
-               /* workaround until we hae RRA presets in 0.8.8 */
--              if ($requested_cf != 4) {
--                      if (sizeof($avail_cf_functions)) {
--                              /* check through the cf's and get the best */
--                              foreach($avail_cf_functions as $cf) {
--                                      if ($cf["rra_cf"] == $requested_cf) {
--                                              return $requested_cf;
--                                      }
-+              if (sizeof($avail_cf_functions)) {
-+                      /* check through the cf's and get the best */
-+                      foreach($avail_cf_functions as $cf) {
-+                              if ($cf["rra_cf"] == $requested_cf) {
-+                                      return $requested_cf;
-                               }
--
--                              /* if none was found, take the first */
--                              return $avail_cf_functions[0]["rra_cf"];
-                       }
-+
-+                      /* if none was found, take the first */
-+                      return $avail_cf_functions[0]["rra_cf"];
-               }
-       }
-@@ -1105,6 +1097,66 @@
-       return "1";
- }
-+/* get_rrd_cfs - reads the RRDfile and get's the RRA's stored in it.
-+    @arg $local_data_id
-+    @returns - array of the CF functions */
-+function get_rrd_cfs($local_data_id) {
-+      global $rrd_cfs;
-+
-+      $rrdfile = get_data_source_path($local_data_id, TRUE);
-+
-+      if (!isset($rrd_cfs)) {
-+              $rrd_cfs = array();
-+      }else if (array_key_exists($local_data_id, $rrd_cfs)) {
-+              return $rrd_cfs[$local_data_id];
-+      }
-+
-+      $cfs = array();
-+
-+      $output = rrdtool_execute("info $rrdfile", FALSE, RRDTOOL_OUTPUT_STDOUT);
-+
-+      if (strlen($output)) {
-+              $output = explode("\n", $output);
-+
-+              if (sizeof($output)) {
-+              foreach($output as $line) {
-+                      if (substr_count($line, ".cf")) {
-+                              $values = explode("=",$line);
-+
-+                              if (!in_array(trim($values[1]), $cfs)) {
-+                                      $cfs[] = trim($values[1]);
-+                              }
-+                      }
-+              }
-+              }
-+      }
-+
-+      $new_cfs = array();
-+
-+      if (sizeof($cfs)) {
-+      foreach($cfs as $cf) {
-+              switch($cf) {
-+              case "AVG":
-+                      $new_cfs[] = 1;
-+                      break;
-+              case "MIN":
-+                      $new_cfs[] = 2;
-+                      break;
-+              case "MAX":
-+                      $new_cfs[] = 3;
-+                      break;
-+              case "LAST":
-+                      $new_cfs[] = 3;
-+                      break;
-+              }
-+      }
-+      }
-+
-+      $rrd_cfs[$local_data_id] = $new_cfs;
-+
-+      return $new_cfs;
-+}
-+
- /* generate_graph_def_name - takes a number and turns each digit into its letter-based
-      counterpart for RRDTool DEF names (ex 1 -> a, 2 -> b, etc)
-    @arg $graph_item_id - (int) the ID to generate a letter-based representation of
diff --git a/import_template_argument_space_removal.patch b/import_template_argument_space_removal.patch
deleted file mode 100644 (file)
index 776c1be..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- cacti-0.8.6i/lib/import.php        2006-10-09 00:06:00.000000000 -0400
-+++ cacti-0.8.6i-patch/lib/import.php  2007-01-02 08:17:09.593750000 -0500
-@@ -687,6 +687,11 @@
-       while (list($field_name, $field_array) = each($fields_data_input_edit)) {
-               /* make sure this field exists in the xml array first */
-               if (isset($xml_array[$field_name])) {
-+                      /* fix issue with data input method importing and white spaces */
-+                      if ($field_name == "input_string") {
-+                              $xml_array[$field_name] = str_replace("><", "> <", $xml_array[$field_name]);
-+                      }
-+
-                       $save[$field_name] = addslashes(xml_character_decode($xml_array[$field_name]));
-               }
-       }
diff --git a/mysql_5x_strict.patch b/mysql_5x_strict.patch
deleted file mode 100644 (file)
index 444f1ba..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-diff -ruBbd cacti-0.8.6h/cacti.sql cacti-0.8.6h-patched/cacti.sql
---- cacti-0.8.6h/cacti.sql     2006-01-03 22:08:30.000000000 -0500
-+++ cacti-0.8.6h-patched/cacti.sql     2006-01-25 00:16:43.000000000 -0500
-@@ -1846,7 +1846,7 @@
-   avg_time decimal(10,5) default '0.00000',
-   total_polls int(12) unsigned default '0',
-   failed_polls int(12) unsigned default '0',
--  availability decimal(7,5) NOT NULL default '100.00000',
-+  availability decimal(8,5) NOT NULL default '100.00000',
-   PRIMARY KEY  (id)
- ) TYPE=MyISAM;
-diff -ruBbd cacti-0.8.6h/lib/auth.php cacti-0.8.6h-patched/lib/auth.php
---- cacti-0.8.6h/lib/auth.php  2006-01-03 22:08:30.000000000 -0500
-+++ cacti-0.8.6h-patched/lib/auth.php  2006-01-25 00:20:48.000000000 -0500
-@@ -40,25 +40,25 @@
-       $user_auth_perms = db_fetch_assoc("select * from user_auth_perms where user_id = '$old_id'");
-       foreach ($user_auth_perms as $row) {
-               $row['user_id'] = $new_id;
--              sql_save($row, 'user_auth_perms', array('user_id', 'item_id', 'type'));
-+              sql_save($row, 'user_auth_perms', array('user_id', 'item_id', 'type'), false);
-       }
-       $user_auth_realm = db_fetch_assoc("select * from user_auth_realm where user_id = '$old_id'");
-       foreach ($user_auth_realm as $row) {
-               $row['user_id'] = $new_id;
--              sql_save($row, 'user_auth_realm', array('realm_id', 'user_id'));
-+              sql_save($row, 'user_auth_realm', array('realm_id', 'user_id'), false);
-       }
-       $settings_graphs = db_fetch_assoc("select * from settings_graphs where user_id = '$old_id'");
-       foreach ($settings_graphs as $row) {
-               $row['user_id'] = $new_id;
--              sql_save($row, 'settings_graphs', array('user_id', 'name'));
-+              sql_save($row, 'settings_graphs', array('user_id', 'name'), false);
-       }
-       $settings_tree = db_fetch_assoc("select * from settings_tree where user_id = '$old_id'");
-       foreach ($settings_tree as $row) {
-               $row['user_id'] = $new_id;
--              sql_save($row, 'settings_tree', array('user_id', 'graph_tree_item_id'));
-+              sql_save($row, 'settings_tree', array('user_id', 'graph_tree_item_id'), false);
-       }
- }
-diff -ruBbd cacti-0.8.6h/lib/database.php cacti-0.8.6h-patched/lib/database.php
---- cacti-0.8.6h/lib/database.php      2006-01-03 22:08:30.000000000 -0500
-+++ cacti-0.8.6h-patched/lib/database.php      2006-01-25 00:16:43.000000000 -0500
-@@ -214,14 +214,14 @@
-    @arg $table_name - the name of the table to make the replacement in
-    @arg $key_cols - the primary key(s)
-    @returns - the auto incriment id column (if applicable) */
--function sql_save($array_items, $table_name, $key_cols = "id") {
-+function sql_save($array_items, $table_name, $key_cols = "id", $autoinc = TRUE) {
-       global $cnn_id;
-       while (list ($key, $value) = each ($array_items)) {
-               $array_items[$key] = "\"" . sql_sanitize($value) . "\"";
-       }
--      if (!$cnn_id->Replace($table_name, $array_items, $key_cols, false)) { return 0; }
-+      if (!$cnn_id->Replace($table_name, $array_items, $key_cols, FALSE, $autoinc)) { return 0; }
-       /* get the last AUTO_ID and return it */
-       if ($cnn_id->Insert_ID() == "0") {
-diff -ruBbd cacti-0.8.6h/lib/import.php cacti-0.8.6h-patched/lib/import.php
---- cacti-0.8.6h/lib/import.php        2006-01-03 22:08:30.000000000 -0500
-+++ cacti-0.8.6h-patched/lib/import.php        2006-01-25 00:21:16.000000000 -0500
-@@ -341,7 +341,7 @@
-                       $save["t_value"] = $item_array["t_value"];
-                       $save["value"] = addslashes(xml_character_decode($item_array["value"]));
--                      sql_save($save, "data_input_data", array("data_template_data_id", "data_input_field_id"));
-+                      sql_save($save, "data_input_data", array("data_template_data_id", "data_input_field_id"), false);
-               }
-       }
-@@ -419,7 +419,7 @@
-                                       $save["data_template_rrd_id"] = resolve_hash_to_id($sub_item_array["data_template_rrd_id"], $hash_cache);
-                                       $save["snmp_field_name"] = $sub_item_array["snmp_field_name"];
--                                      sql_save($save, "snmp_query_graph_rrd", array("snmp_query_graph_id", "data_template_id", "data_template_rrd_id"));
-+                                      sql_save($save, "snmp_query_graph_rrd", array("snmp_query_graph_id", "data_template_id", "data_template_rrd_id"), false);
-                               }
-                       }
-diff -ruBbd cacti-0.8.6h/lib/template.php cacti-0.8.6h-patched/lib/template.php
---- cacti-0.8.6h/lib/template.php      2006-01-03 22:08:30.000000000 -0500
-+++ cacti-0.8.6h-patched/lib/template.php      2006-01-25 00:16:43.000000000 -0500
-@@ -643,10 +643,16 @@
-                                       /* if there are no '|' characters, all of the substitutions were successful */
-                                       if (!strstr($subs_string, "|query")) {
-+                                              if (sizeof(db_fetch_row("show columns from data_template_data like '" . $suggested_value["field_name"] . "'"))) {
-                                               db_execute("update data_template_data set " . $suggested_value["field_name"] . "='" . addslashes($suggested_value["text"]) . "' where local_data_id=" . $cache_array["local_data_id"]{$data_template["id"]});
-+                                              }
-                                               /* once we find a working value, stop */
-                                               $suggested_values_ds{$data_template["id"]}{$suggested_value["field_name"]} = true;
-+
-+                                              if (sizeof(db_fetch_row("show columns from data_template_rrd like '" . $suggested_value["field_name"] . "'"))) {
-+                                                      db_execute("update data_template_rrd set " . $suggested_value["field_name"] . "='" . $subs_string . "' where local_data_id=" . $cache_array["local_data_id"]{$data_template["id"]});
-+                                              }
-                                       }
-                               }
-                       }
diff --git a/nth_percentile_empty_return_set_issue.patch b/nth_percentile_empty_return_set_issue.patch
deleted file mode 100644 (file)
index dbce46e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
---- cacti-0.8.6h/lib/graph_variables.php       2006-01-03 21:08:30.000000000 -0600
-+++ cacti-fixed/lib/graph_variables.php        2006-01-06 22:40:31.032460462 -0600
-@@ -302,27 +302,34 @@
-       /* format the output according to args passed to the variable */
-       if ($regexp_match_array[4] == "current") {
-+              if (! empty($nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]})) {
-               $nth = $nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]};
-               $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
-               $nth /= pow(10,intval($regexp_match_array[3]));
-+              }
-       }elseif ($regexp_match_array[4] == "total") {
-               for ($t=0;($t<count($graph_items));$t++) {
-                       if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
-+                              if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
-                               $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
-                               $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                               $local_nth /= pow(10,intval($regexp_match_array[3]));
-                               $nth += $local_nth;
-+                              }
-                       }
-               }
-       }elseif ($regexp_match_array[4] == "max") {
-+              if (! empty($nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"])) {
-               $nth = $nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"];
-               $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
-               $nth /= pow(10,intval($regexp_match_array[3]));
-+              }
-       }elseif ($regexp_match_array[4] == "total_peak") {
-               for ($t=0;($t<count($graph_items));$t++) {
-                       if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
-+                              if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
-                               $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
-                               $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                               $local_nth /= pow(10,intval($regexp_match_array[3]));
-@@ -330,9 +337,11 @@
-                               $nth += $local_nth;
-                       }
-               }
-+              }
-       }elseif ($regexp_match_array[4] == "all_max_current") {
-               for ($t=0;($t<count($graph_items));$t++) {
-                       if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
-+                              if (! empty($ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
-                               $local_nth = $ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
-                               $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                               $local_nth /= pow(10,intval($regexp_match_array[3]));
-@@ -342,9 +351,11 @@
-                               }
-                       }
-               }
-+              }
-       }elseif ($regexp_match_array[4] == "all_max_peak") {
-               for ($t=0;($t<count($graph_items));$t++) {
-                       if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
-+                              if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
-                               $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
-                               $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                               $local_nth /= pow(10,intval($regexp_match_array[3]));
-@@ -354,28 +365,23 @@
-                               }
-                       }
-               }
-+              }
-       }elseif ($regexp_match_array[4] == "aggregate") {
--              if (empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
--                      $nth = 0;
--              }else{
-+              if (! empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
-                       $local_nth = $nth_cache{0}["nth_percentile_aggregate_total"];
-                       $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                       $local_nth /= pow(10,intval($regexp_match_array[3]));
-                       $nth = $local_nth;
-               }
-       }elseif ($regexp_match_array[4] == "aggregate_max") {
--              if (empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
--                      $nth = 0;
--              }else{
-+              if (! empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
-                       $local_nth = $nth_cache{0}["nth_percentile_aggregate_max"];
-                       $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                       $local_nth /= pow(10,intval($regexp_match_array[3]));
-                       $nth = $local_nth;
-               }
-       }elseif ($regexp_match_array[4] == "aggregate_sum") {
--              if (empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
--                      $nth = 0;
--              }else{
-+              if (! empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
-                       $local_nth = $nth_cache{0}["nth_percentile_aggregate_sum"];
-                       $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
-                       $local_nth /= pow(10,intval($regexp_match_array[3]));
diff --git a/poller_output_remainder.patch b/poller_output_remainder.patch
deleted file mode 100644 (file)
index 5edcf15..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -ruBbd cacti-0.8.6i/lib/poller.php cacti-0.8.6i-patched/lib/poller.php
---- cacti-0.8.6i/lib/poller.php        2006-10-08 23:06:01.000000000 -0400
-+++ cacti-0.8.6i-patched/lib/poller.php        2006-11-21 23:41:02.000000000 -0500
-@@ -213,7 +213,7 @@
- /* process_poller_output - grabs data from the 'poller_output' table and feeds the *completed*
-      results to RRDTool for processing
-    @arg $rrdtool_pipe - the array of pipes containing the file descriptor for rrdtool */
--function process_poller_output($rrdtool_pipe) {
-+function process_poller_output($rrdtool_pipe, $remainder = FALSE) {
-       global $config;
-       include_once($config["library_path"] . "/rrd.php");
-@@ -221,6 +221,12 @@
-       /* let's count the number of rrd files we processed */
-       $rrds_processed = 0;
-+      if ($remainder) {
-+              $limit = "";
-+      }else{
-+              $limit = "LIMIT 10000";
-+      }
-+
-       /* create/update the rrd files */
-       $results = db_fetch_assoc("select
-               poller_output.output,
-@@ -231,7 +237,7 @@
-               poller_item.rrd_num
-               from (poller_output,poller_item)
-               where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name)
--              limit 10000");
-+              $limit");
-       if (sizeof($results) > 0) {
-               /* create an array keyed off of each .rrd file */
-diff -ruBbd cacti-0.8.6i/poller.php cacti-0.8.6i-patched/poller.php
---- cacti-0.8.6i/poller.php    2006-10-08 23:06:01.000000000 -0400
-+++ cacti-0.8.6i-patched/poller.php    2006-11-12 11:49:05.000000000 -0500
-@@ -166,7 +166,7 @@
-               $polling_items = db_fetch_assoc("select poller_id,end_time from poller_time where poller_id = 0");
-               if (sizeof($polling_items) == $process_file_number) {
--                      $rrds_processed = $rrds_processed + process_poller_output($rrdtool_pipe);
-+                      $rrds_processed = $rrds_processed + process_poller_output($rrdtool_pipe, TRUE);
-                       /* take time and log performance data */
-                       list($micro,$seconds) = split(" ", microtime());
This page took 0.464351 seconds and 4 git commands to generate.