packages: cacti/cacti.spec, cacti/cacti-plugin-0.8.7e-PA-v2.5.diff (NEW), c...
glen
glen at pld-linux.org
Thu Jul 16 10:47:48 CEST 2009
Author: glen Date: Thu Jul 16 08:47:48 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- up to 0.8.7e by Eero Hänninen
---- Files affected:
packages/cacti:
cacti.spec (1.110 -> 1.111) , cacti-plugin-0.8.7e-PA-v2.5.diff (NONE -> 1.1) (NEW), cacti-plugin-0.8.7d-PA-v2.4.diff (1.1 -> NONE) (REMOVED), graph_search.patch (1.1 -> NONE) (REMOVED), ping_timeout.patch (1.1 -> NONE) (REMOVED), snmp_string_issue_with_rrdtool_creation.patch (1.1 -> NONE) (REMOVED)
---- Diffs:
================================================================
Index: packages/cacti/cacti.spec
diff -u packages/cacti/cacti.spec:1.110 packages/cacti/cacti.spec:1.111
--- packages/cacti/cacti.spec:1.110 Fri May 15 11:36:11 2009
+++ packages/cacti/cacti.spec Thu Jul 16 10:47:42 2009
@@ -3,19 +3,19 @@
Summary: Cacti is a PHP frontend for rrdtool
Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
Name: cacti
-Version: 0.8.7d
-Release: 3
+Version: 0.8.7e
+Release: 1
License: GPL
Group: Applications/WWW
Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
-# Source0-md5: 0822068bfa547278e94d3143ef9279e0
+# Source0-md5: 7563a58a57d2c6cc0da28cc341a30969
Source1: %{name}.cfg.php
Source2: %{name}.crontab
Source3: %{name}-apache.conf
Source4: %{name}-lighttpd.conf
Source5: %{name}-rrdpath.sql
Source6: %{name}-pa.sql
-Patch0: cacti-plugin-%{version}-PA-v2.4.diff
+Patch0: %{name}-plugin-%{version}-PA-v2.5.diff
Patch1: %{name}-config.patch
Patch2: %{name}-adodb.patch
Patch3: %{name}-ioerror.patch
@@ -24,11 +24,6 @@
Patch6: %{name}-log-verbosity.patch
Patch7: %{name}-ss_disk-array-indices.patch
Patch8: %{name}-rrdresourcecheck.patch
-Patch100: http://www.cacti.net/downloads/patches/0.8.7d/ping_timeout.patch
-Patch101: http://www.cacti.net/downloads/patches/0.8.7d/graph_search.patch
-Patch102: %{name}-page_length_graph_view.patch
-# http://www.cacti.net/downloads/patches/0.8.7d/page_length_graph_view.patch
-Patch103: http://www.cacti.net/downloads/patches/0.8.7d/snmp_string_issue_with_rrdtool_creation.patch
URL: http://www.cacti.net/
BuildRequires: rpm-perlprov
BuildRequires: sed >= 4.0
@@ -122,10 +117,6 @@
%patch6 -p1
%patch7 -p1
%patch8 -p1
-%patch100 -p1
-%patch101 -p1
-%patch102 -p1
-%patch103 -p1
mkdir -p sql
mv *.sql sql
@@ -147,6 +138,8 @@
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+rm log/.placeholder
+
# make sure cacti runs out of the box
sed -e "s,new_install,%{version}," -i sql/cacti.sql
@@ -212,7 +205,7 @@
%files
%defattr(644,root,root,755)
-%doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt
+%doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
%dir %attr(750,root,http) %{_sysconfdir}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
@@ -256,6 +249,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.111 2009/07/16 08:47:42 glen
+- up to 0.8.7e by Eero Hänninen
+
Revision 1.110 2009/05/15 09:36:11 mmazur
- rel 3; stbr
- some sql magic, to make sure the thing works out of the box
================================================================
Index: packages/cacti/cacti-plugin-0.8.7e-PA-v2.5.diff
diff -u /dev/null packages/cacti/cacti-plugin-0.8.7e-PA-v2.5.diff:1.1
--- /dev/null Thu Jul 16 10:47:48 2009
+++ packages/cacti/cacti-plugin-0.8.7e-PA-v2.5.diff Thu Jul 16 10:47:42 2009
@@ -0,0 +1,2036 @@
+diff -Naur cacti-0.8.7e-old/auth_changepassword.php cacti-0.8.7e/auth_changepassword.php
+--- cacti-0.8.7e-old/auth_changepassword.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/auth_changepassword.php 2009-06-28 22:51:07.000000000 -0500
+@@ -59,6 +59,8 @@
+ header("Location: index.php"); break;
+ case '3': /* default graph page */
+ header("Location: graph_view.php"); break;
++ default:
++ api_plugin_hook_function('login_options_navigate', $user['login_opts']);
+ }
+ }else{
+ header("Location: graph_view.php");
+diff -Naur cacti-0.8.7e-old/auth_login.php cacti-0.8.7e/auth_login.php
+--- cacti-0.8.7e-old/auth_login.php 2009-06-28 11:07:28.000000000 -0500
++++ cacti-0.8.7e/auth_login.php 2009-06-28 22:51:07.000000000 -0500
+@@ -212,6 +212,8 @@
+ header("Location: index.php"); break;
+ case '3': /* default graph page */
+ header("Location: graph_view.php"); break;
++ default:
++ api_plugin_hook_function('login_options_navigate', $user['login_opts']);
+ }
+ exit;
+
+@@ -262,9 +264,17 @@
+ <body bgcolor="#FFFFFF" onload="document.login.login_username.focus()">
+ <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
+ <input type="hidden" name="action" value="login">
++<?php
++
++api_plugin_hook("login_before");
++
++$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
++$cacti_logo = api_plugin_hook_function('cacti_image', $cacti_logo);
++
++?>
+ <table align="center">
+ <tr>
+- <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
++ <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
+ </tr>
+ <?php
+
+@@ -317,6 +327,7 @@
+ <td><input type="submit" value="Login"></td>
+ </tr>
+ </table>
++<?php api_plugin_hook('login_after'); ?>
+ </form>
+ </body>
+ </html>
+diff -Naur cacti-0.8.7e-old/data_sources.php cacti-0.8.7e/data_sources.php
+--- cacti-0.8.7e-old/data_sources.php 2009-06-28 11:07:28.000000000 -0500
++++ cacti-0.8.7e/data_sources.php 2009-06-28 22:51:07.000000000 -0500
+@@ -44,6 +44,8 @@
+ 7 => "Disable"
+ );
+
++$ds_actions = api_plugin_hook_function('data_source_action_array', $ds_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+
+@@ -402,7 +404,10 @@
+ api_reapply_suggested_data_source_title($selected_items[$i]);
+ update_data_source_title_cache($selected_items[$i]);
+ }
++ } else {
++ api_plugin_hook_function('data_source_action_execute', $_POST['drp_action']);
+ }
++
+ header("Location: data_sources.php");
+ exit;
+ }
+@@ -533,7 +538,12 @@
+ <p>$ds_list</p>
+ </td>
+ </tr>\n
+- ";
++ ";
++ } else {
++ $save['drp_action'] = $_POST['drp_action'];
++ $save['ds_list'] = $ds_list;
++ $save['ds_array'] = (isset($ds_array)? $ds_array : array());
++ api_plugin_hook_function('data_source_action_prepare', $save);
+ }
+
+ if (!isset($ds_array)) {
+@@ -675,6 +685,8 @@
+ input_validate_input_number(get_request_var("id"));
+ /* ==================================================== */
+
++ api_plugin_hook('data_source_edit_top');
++
+ $use_data_template = true;
+ $host_id = 0;
+
+@@ -967,8 +979,9 @@
+
+ form_save_button("data_sources.php");
+
+- include_once("./include/bottom_footer.php");
++ api_plugin_hook('data_source_edit_bottom');
+
++ include_once("./include/bottom_footer.php");
+ }
+
+ function get_poller_interval($seconds) {
+@@ -1300,6 +1313,7 @@
+ $i = 0;
+ if (sizeof($data_sources) > 0) {
+ foreach ($data_sources as $data_source) {
++ $data_source = api_plugin_hook_function('data_sources_table', $data_source);
+ $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
+ $data_input_name = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
+ $poller_interval = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
+@@ -1328,4 +1342,3 @@
+ print "</form>\n";
+ }
+ ?>
+-
+diff -Naur cacti-0.8.7e-old/graph_image.php cacti-0.8.7e/graph_image.php
+--- cacti-0.8.7e-old/graph_image.php 2009-06-28 11:07:28.000000000 -0500
++++ cacti-0.8.7e/graph_image.php 2009-06-28 22:51:07.000000000 -0500
+@@ -44,6 +44,8 @@
+ /* flush the headers now */
+ ob_end_clean();
+
++api_plugin_hook_function('graph_image');
++
+ session_write_close();
+
+ $graph_data_array = array();
+diff -Naur cacti-0.8.7e-old/graph.php cacti-0.8.7e/graph.php
+--- cacti-0.8.7e-old/graph.php 2009-06-28 11:07:28.000000000 -0500
++++ cacti-0.8.7e/graph.php 2009-06-28 22:03:15.000000000 -0500
+@@ -98,6 +98,7 @@
+ <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
+ <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $rra['id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+@@ -212,6 +213,7 @@
+ <td valign='top' style='padding: 3px;' class='noprint'>
+ <a href='graph.php?action=properties&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>&graph_start=<?php print $graph_start;?>&graph_end=<?php print $graph_end;?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'zoom', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+@@ -244,6 +246,7 @@
+ <td valign='top' style='padding: 3px;'>
+ <a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
+ <a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $_GET["rra_id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
++ <?php api_plugin_hook('graph_buttons', array('hook' => 'properties', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
+ </td>
+ </tr>
+ <tr>
+diff -Naur cacti-0.8.7e-old/graphs_new.php cacti-0.8.7e/graphs_new.php
+--- cacti-0.8.7e-old/graphs_new.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/graphs_new.php 2009-06-28 22:51:07.000000000 -0500
+@@ -479,7 +479,8 @@
+ </td>
+ <td nowrap style='white-space: nowrap;' class="textInfo" align="center" valign="top">
+ <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit&id=<?php print $_REQUEST["host_id"];?>">Edit this Host</a><br>
+- <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a>
++ <span style="white-space: nowrap; color: #c16921;">*</span><a href="host.php?action=edit">Create New Host</a><br>
++ <?php api_plugin_hook('graphs_new_top_links'); ?>
+ </td>
+ </tr>
+ </table>
+diff -Naur cacti-0.8.7e-old/graphs.php cacti-0.8.7e/graphs.php
+--- cacti-0.8.7e-old/graphs.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/graphs.php 2009-06-28 22:51:07.000000000 -0500
+@@ -45,6 +45,8 @@
+ 4 => "Convert to Graph Template"
+ );
+
++$graph_actions = api_plugin_hook_function('graphs_action_array', $graph_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+
+@@ -360,8 +362,10 @@
+ input_validate_input_number($selected_items[$i]);
+ /* ==================================================== */
+
+- api_resize_graphs($selected_items[$i], $_POST["graph_width"], $_POST["graph_height"]);
++ api_resize_graphs($selected_items[$i], $_POST['graph_width'], $_POST['graph_height']);
+ }
++ } else {
++ api_plugin_hook_function('graphs_action_execute', $_POST['drp_action']);
+ }
+
+ header("Location: graphs.php");
+@@ -502,6 +506,11 @@
+ </td>
+ </tr>\n
+ ";
++ } else {
++ $save['drp_action'] = $_POST['drp_action'];
++ $save['graph_list'] = $graph_list;
++ $save['graph_array'] = (isset($graph_array) ? $graph_array : array());
++ api_plugin_hook_function('graphs_action_prepare', $save);
+ }
+
+ if (!isset($graph_array)) {
+diff -Naur cacti-0.8.7e-old/host.php cacti-0.8.7e/host.php
+--- cacti-0.8.7e-old/host.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/host.php 2009-06-28 22:51:07.000000000 -0500
+@@ -44,6 +44,8 @@
+ 6 => "Change Availability Options"
+ );
+
++$device_actions = api_plugin_hook_function('device_action_array', $device_actions);
++
+ /* set default action */
+ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
+
+@@ -309,6 +311,8 @@
+
+ api_tree_item_save(0, $_POST["tree_id"], TREE_ITEM_TYPE_HOST, $_POST["tree_item_id"], "", 0, read_graph_config_option("default_rra_id"), $selected_items[$i], 1, 1, false);
+ }
++ } else {
++ api_plugin_hook_function('device_action_execute', $_POST['drp_action']);
+ }
+
+ header("Location: host.php");
+@@ -445,6 +449,11 @@
+ </tr>\n
+ <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\n
+ ";
++ } else {
++ $save['drp_action'] = $_POST['drp_action'];
++ $save['host_list'] = $host_list;
++ $save['host_array'] = (isset($host_array)? $host_array : array());
++ api_plugin_hook_function('device_action_prepare', $save);
+ }
+
+ if (!isset($host_array)) {
+@@ -533,6 +542,8 @@
+
+ display_output_messages();
+
++ api_plugin_hook('host_edit_top');
++
+ if (!empty($_GET["id"])) {
+ $host = db_fetch_row("select * from host where id=" . $_GET["id"]);
+ $header_label = "[edit: " . $host["description"] . "]";
+@@ -643,7 +654,8 @@
+ <td class="textInfo" valign="top">
+ <span style="color: #c16921;">*</span><a href="graphs_new.php?host_id=<?php print $host["id"];?>">Create Graphs for this Host</a><br>
+ <span style="color: #c16921;">*</span><a href="data_sources.php?host_id=<?php print $host["id"];?>&ds_rows=30&filter=&template_id=-1&method_id=-1&page=1">Data Source List</a><br>
+- <span style="color: #c16921;">*</span><a href="graphs.php?host_id=<?php print $host["id"];?>&graph_rows=30&filter=&template_id=-1&page=1">Graph List</a>
++ <span style="color: #c16921;">*</span><a href="graphs.php?host_id=<?php print $host["id"];?>&graph_rows=30&filter=&template_id=-1&page=1">Graph List</a><br>
++ <?php api_plugin_hook('device_edit_top_links'); ?>
+ </td>
+ </tr>
+ </table>
+@@ -1104,6 +1116,8 @@
+ }
+
+ form_save_button("host.php");
++
++ api_plugin_hook('host_edit_bottom');
+ }
+
+ function host() {
+diff -Naur cacti-0.8.7e-old/include/auth.php cacti-0.8.7e/include/auth.php
+--- cacti-0.8.7e-old/include/auth.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/auth.php 2009-06-28 22:51:07.000000000 -0500
+@@ -31,6 +31,9 @@
+ }
+
+ if (read_config_option("auth_method") != 0) {
++ /* handle alternate authentication realms */
++ api_plugin_hook_function('auth_alternate_realms');
++
+ /* handle change password dialog */
+ if ((isset($_SESSION['sess_change_password'])) && (read_config_option("webbasic_enabled") != "on")) {
+ header ("Location: auth_changepassword.php?ref=" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
+@@ -75,7 +78,7 @@
+ <html>
+ <head>
+ <title>Cacti</title>
+- <link href="include/main.css" rel="stylesheet">
++ <link href="<?php echo $config['url_path']; ?>include/main.css" rel="stylesheet">
+ </style>
+ </head>
+
+@@ -83,7 +86,7 @@
+
+ <table width="450" align='center'>
+ <tr>
+- <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
++ <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
+ </tr>
+ <tr height='10'><td></td></tr>
+ <tr>
+@@ -91,7 +94,7 @@
+ need access to this particular section, please contact the Cacti administrator.</td>
+ </tr>
+ <tr>
+- <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='index.php'>Login</a> )</td>
++ <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='<?php echo $config['url_path']; ?>index.php'>Login</a> )</td>
+ </tr>
+ </table>
+
+diff -Naur cacti-0.8.7e-old/include/bottom_footer.php cacti-0.8.7e/include/bottom_footer.php
+--- cacti-0.8.7e-old/include/bottom_footer.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/bottom_footer.php 2009-06-28 22:51:07.000000000 -0500
+@@ -21,6 +21,10 @@
+ | http://www.cacti.net/ |
+ +-------------------------------------------------------------------------+
+ */
++
++$oper_mode = api_plugin_hook_function('top_header', OPER_MODE_NATIVE);
++if (($oper_mode == OPER_MODE_NATIVE) || ($oper_mode == OPER_MODE_IFRAME_NONAV)) {
++
+ ?>
+ <br>
+ </td>
+@@ -31,6 +35,9 @@
+ </html>
+
+ <?php
++
++}
++
+ /* we use this session var to store field values for when a save fails,
+ this way we can restore the field's previous values. we reset it here, because
+ they only need to be stored for a single page */
+diff -Naur cacti-0.8.7e-old/include/global_arrays.php cacti-0.8.7e/include/global_arrays.php
+--- cacti-0.8.7e-old/include/global_arrays.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/global_arrays.php 2009-06-28 22:51:07.000000000 -0500
+@@ -22,6 +22,8 @@
+ +-------------------------------------------------------------------------+
+ */
+
++global $menu;
++
+ $messages = array(
+ 1 => array(
+ "message" => 'Save Successful.',
+@@ -641,4 +643,10 @@
+ GDC_SLASH => "/"
+ );
+
++$plugin_architecture = array(
++ 'version' => '2.5'
++ );
++
++api_plugin_hook('config_arrays');
++
+ ?>
+diff -Naur cacti-0.8.7e-old/include/global_constants.php cacti-0.8.7e/include/global_constants.php
+--- cacti-0.8.7e-old/include/global_constants.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/global_constants.php 2009-06-28 22:51:07.000000000 -0500
+@@ -175,4 +175,8 @@
+ define("SNMP_CMDPHP", 1);
+ define("SNMP_WEBUI", 2);
+
++define('OPER_MODE_NATIVE', 0);
++define('OPER_MODE_RESKIN', 1);
++define('OPER_MODE_IFRAME_NONAV', 2);
++
+ ?>
+diff -Naur cacti-0.8.7e-old/include/global_form.php cacti-0.8.7e/include/global_form.php
+--- cacti-0.8.7e-old/include/global_form.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/global_form.php 2009-06-28 22:51:07.000000000 -0500
+@@ -22,8 +22,9 @@
+ +-------------------------------------------------------------------------+
+ */
+
+-if (!defined("VALID_HOST_FIELDS")) {
+- define("VALID_HOST_FIELDS", "(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)");
++if (!defined('VALID_HOST_FIELDS')) {
++ $string = api_plugin_hook_function('valid_host_fields', '(hostname|snmp_community|snmp_username|snmp_password|snmp_auth_protocol|snmp_priv_passphrase|snmp_priv_protocol|snmp_context|snmp_version|snmp_port|snmp_timeout)');
++ define('VALID_HOST_FIELDS', $string);
+ }
+
+ /* file: cdef.php, action: edit */
+@@ -1184,4 +1185,7 @@
+ "dropdown_sql" => "select id,name from snmp_query order by name"
+ )
+ );
+-?>
++
++
++api_plugin_hook('config_form');
++
+diff -Naur cacti-0.8.7e-old/include/global.php cacti-0.8.7e/include/global.php
+--- cacti-0.8.7e-old/include/global.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/global.php 2009-06-28 22:51:07.000000000 -0500
+@@ -41,6 +41,22 @@
+ /* Default session name - Session name must contain alpha characters */
+ $cacti_session_name = "Cacti";
+
++$plugins = array();
++//$plugins[] = 'thold';
++
++/* Do not edit this line */
++$config = array();
++
++/*
++ Edit this to point to the default URL of your Cacti install
++ ex: if your cacti install as at http://serverip/cacti/ this
++ would be set to /cacti/
++*/
++
++$config['url_path'] = '/';
++
++define('URL_PATH', $config['url_path']);
++
+ /* Include configuration */
+ include(dirname(__FILE__) . "/config.php");
+
+@@ -76,7 +92,6 @@
+ "structure_rra_paths.php"
+ );
+
+-$config = array();
+ $colors = array();
+
+ /* this should be auto-detected, set it manually if needed */
+@@ -180,18 +195,23 @@
+ /* display ALL errors */
+ error_reporting(E_ALL);
+
++/* current cacti version */
++$config["cacti_version"] = "0.8.7c";
++
+ /* include base modules */
+ include($config["library_path"] . "/adodb/adodb.inc.php");
+ include($config["library_path"] . "/database.php");
+-include_once($config["library_path"] . "/functions.php");
+-include_once($config["include_path"] . "/global_constants.php");
+-include_once($config["include_path"] . "/global_arrays.php");
+-include_once($config["include_path"] . "/global_settings.php");
+
+ /* connect to the database server */
+ db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
+
+ /* include additional modules */
++include_once($config["library_path"] . "/functions.php");
++include_once($config["include_path"] . "/global_constants.php");
++include_once($config["library_path"] . "/plugins.php");
++include_once($config["include_path"] . "/plugins.php");
++include_once($config["include_path"] . "/global_arrays.php");
++include_once($config["include_path"] . "/global_settings.php");
+ include_once($config["include_path"] . "/global_form.php");
+ include_once($config["library_path"] . "/html.php");
+ include_once($config["library_path"] . "/html_form.php");
+@@ -200,6 +220,8 @@
+ include_once($config["library_path"] . "/variables.php");
+ include_once($config["library_path"] . "/auth.php");
+
++api_plugin_hook("config_insert");
++
+ /* current cacti version */
+ $config["cacti_version"] = "0.8.7e";
+
+diff -Naur cacti-0.8.7e-old/include/global_settings.php cacti-0.8.7e/include/global_settings.php
+--- cacti-0.8.7e-old/include/global_settings.php 2009-06-28 11:07:26.000000000 -0500
++++ cacti-0.8.7e/include/global_settings.php 2009-06-28 22:51:07.000000000 -0500
+@@ -1185,4 +1185,6 @@
+ )
+ );
+
++api_plugin_hook('config_settings');
++
+ ?>
+diff -Naur cacti-0.8.7e-old/include/plugins.php cacti-0.8.7e/include/plugins.php
+--- cacti-0.8.7e-old/include/plugins.php 1969-12-31 17:00:00.000000000 -0700
++++ cacti-0.8.7e/include/plugins.php 2009-06-28 22:51:07.000000000 -0500
+@@ -0,0 +1,36 @@
++<?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
++ */
++
++/* On startup, register all plugins configured for use. */
++if (isset($plugins) && is_array($plugins)) {
++ foreach ($plugins as $name) {
++ use_plugin($name);
++ }
++}
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cacti/cacti.spec?r1=1.110&r2=1.111&f=u
More information about the pld-cvs-commit
mailing list