]> git.pld-linux.org Git - packages/cacti.git/commitdiff
- patch add plugins architecture to cacti 0.8.6h
authorMichał 'Wolvverine' Panasiewicz <wolvverine@pld-linux.org>
Thu, 12 Jan 2006 02:14:59 +0000 (02:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cacti-plugin-0.8.6g.diff -> 1.1
    cacti-plugin-0.8.6h.diff -> 1.1

cacti-plugin-0.8.6g.diff [new file with mode: 0644]
cacti-plugin-0.8.6h.diff [new file with mode: 0644]

diff --git a/cacti-plugin-0.8.6g.diff b/cacti-plugin-0.8.6g.diff
new file mode 100644 (file)
index 0000000..6da4604
--- /dev/null
@@ -0,0 +1,832 @@
+diff -Nar -U 8 cacti-0.8.6g/data_sources.php cacti-0.8.6g-new/data_sources.php
+--- cacti-0.8.6g/data_sources.php      2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/data_sources.php  2005-09-12 10:59:25.000000000 -0500
+@@ -1038,28 +1038,36 @@
+       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 -Nar -U 8 cacti-0.8.6g/graphs_new.php cacti-0.8.6g-new/graphs_new.php
+--- cacti-0.8.6g/graphs_new.php        2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/graphs_new.php    2005-09-12 10:49:29.000000000 -0500
+@@ -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 -Nar -U 8 cacti-0.8.6g/include/config_arrays.php cacti-0.8.6g-new/include/config_arrays.php
+--- cacti-0.8.6g/include/config_arrays.php     2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/config_arrays.php 2005-09-12 13:17:45.000000000 -0500
+@@ -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(
+@@ -423,9 +425,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 -Nar -U 8 cacti-0.8.6g/include/config_form.php cacti-0.8.6g-new/include/config_form.php
+--- cacti-0.8.6g/include/config_form.php       2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/config_form.php   2005-09-12 10:49:29.000000000 -0500
+@@ -994,9 +994,11 @@
+               "value" => "|arg1:policy_graph_templates|"
+               ),
+       "save_component_user" => array(
+               "method" => "hidden",
+               "value" => "1"
+               )
+       );
++do_hook("config_form");
++
+ ?>
+diff -Nar -U 8 cacti-0.8.6g/include/config.php cacti-0.8.6g-new/include/config.php
+--- cacti-0.8.6g/include/config.php    2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/config.php        2005-09-12 10:51:51.000000000 -0500
+@@ -26,44 +26,62 @@
+ /* 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";
++
++$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",
+       "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";
+@@ -157,9 +175,9 @@
+ include_once($config["library_path"] . "/html_utility.php");
+ include_once($config["library_path"] . "/html_validate.php");
+ include_once($config["library_path"] . "/variables.php");
+ include_once($config["library_path"] . "/auth.php");
+ /* current cacti version */
+ $config["cacti_version"] = "0.8.6g";
+-?>
++?>
+\ No newline at end of file
+diff -Nar -U 8 cacti-0.8.6g/include/config_settings.php cacti-0.8.6g-new/include/config_settings.php
+--- cacti-0.8.6g/include/config_settings.php   2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/config_settings.php       2005-09-12 13:16:53.000000000 -0500
+@@ -816,9 +816,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 -Nar -U 8 cacti-0.8.6g/include/plugins.php cacti-0.8.6g-new/include/plugins.php
+--- cacti-0.8.6g/include/plugins.php   1969-12-31 17:00:00.000000000 -0700
++++ cacti-0.8.6g-new/include/plugins.php       2005-09-12 10:49:29.000000000 -0500
+@@ -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 -Nar -U 8 cacti-0.8.6g/include/top_graph_header.php cacti-0.8.6g-new/include/top_graph_header.php
+--- cacti-0.8.6g/include/top_graph_header.php  2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/top_graph_header.php      2005-09-12 10:49:29.000000000 -0500
+@@ -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="170" 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="170" 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 -Nar -U 8 cacti-0.8.6g/include/top_header.php cacti-0.8.6g-new/include/top_header.php
+--- cacti-0.8.6g/include/top_header.php        2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/include/top_header.php    2005-09-12 10:56:22.000000000 -0500
+@@ -19,79 +19,79 @@
+  | 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 -Nar -U 8 cacti-0.8.6g/lib/api_device.php cacti-0.8.6g-new/lib/api_device.php
+--- cacti-0.8.6g/lib/api_device.php    2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/lib/api_device.php        2005-09-12 10:49:29.000000000 -0500
+@@ -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 -Nar -U 8 cacti-0.8.6g/lib/functions.php cacti-0.8.6g-new/lib/functions.php
+--- cacti-0.8.6g/lib/functions.php     2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/lib/functions.php 2005-09-12 10:49:29.000000000 -0500
+@@ -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"] . "',
+@@ -1345,16 +1347,18 @@
+               "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"),
+               "smtp_servers.php:" => array("title" => "Coming Soon", "mapping" => "index.php:", "url" => "smtp_servers.php", "level" => "1"),
+               "email_templates.php:" => array("title" => "Coming Soon", "mapping" => "index.php:", "url" => "email_templates.php", "level" => "1"),
+               "event_queue.php:" => array("title" => "Coming Soon", "mapping" => "index.php:", "url" => "event_queue.php", "level" => "1"),
+               "smtp_queue.php:" => array("title" => "Coming Soon", "mapping" => "index.php:", "url" => "smtp_queue.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 -Nar -U 8 cacti-0.8.6g/lib/html_form.php cacti-0.8.6g-new/lib/html_form.php
+--- cacti-0.8.6g/lib/html_form.php     2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/lib/html_form.php 2005-09-12 10:49:29.000000000 -0500
+@@ -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 = "") {
++      global $config;
+       if (empty($force_type)) {
+               if (empty($_GET["id"])) {
+                       $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 -Nar -U 8 cacti-0.8.6g/lib/html.php cacti-0.8.6g-new/lib/html.php
+--- cacti-0.8.6g/lib/html.php  2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/lib/html.php      2005-09-12 10:49:29.000000000 -0500
+@@ -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='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='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 -Nar -U 8 cacti-0.8.6g/plugins/index.php cacti-0.8.6g-new/plugins/index.php
+--- cacti-0.8.6g/plugins/index.php     1969-12-31 17:00:00.000000000 -0700
++++ cacti-0.8.6g-new/plugins/index.php 2005-09-12 10:49:29.000000000 -0500
+@@ -0,0 +1,5 @@
++<?php
++
++header("Location:../index.php");
++
++?>
+diff -Nar -U 8 cacti-0.8.6g/poller.php cacti-0.8.6g-new/poller.php
+--- cacti-0.8.6g/poller.php    2005-09-08 18:56:24.000000000 -0500
++++ cacti-0.8.6g-new/poller.php        2005-09-16 09:49:28.000000000 -0500
+@@ -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;
+ /* Let PHP Run Just as Long as It Has To */
+ ini_set("max_execution_time", "0");
+ /* Disable Mib File Loading */
+@@ -232,9 +234,11 @@
+       }
+       db_execute("truncate table poller_output");
+ }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 --git a/cacti-plugin-0.8.6h.diff b/cacti-plugin-0.8.6h.diff
new file mode 100644 (file)
index 0000000..b1a4391
--- /dev/null
@@ -0,0 +1,861 @@
+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();
+ }
+ ?>
This page took 0.119021 seconds and 4 git commands to generate.