1 diff -Naur cacti-0.8.7g-old/auth_changepassword.php cacti-0.8.7g/auth_changepassword.php
2 --- cacti-0.8.7g-old/auth_changepassword.php 2010-07-09 18:33:46.000000000 -0400
3 +++ cacti-0.8.7g/auth_changepassword.php 2010-07-09 18:34:11.000000000 -0400
5 header("Location: index.php"); break;
6 case '3': /* default graph page */
7 header("Location: graph_view.php"); break;
9 + api_plugin_hook_function('login_options_navigate', $user['login_opts']);
12 header("Location: graph_view.php");
13 diff -Naur cacti-0.8.7g-old/auth_login.php cacti-0.8.7g/auth_login.php
14 --- cacti-0.8.7g-old/auth_login.php 2010-07-09 18:33:46.000000000 -0400
15 +++ cacti-0.8.7g/auth_login.php 2010-07-09 18:34:11.000000000 -0400
21 - if ((!$user_auth) && (!$ldap_error)) {
22 - /* if auth has not occured process for builtin - AKA Ldap fall through */
23 - $user = db_fetch_row("SELECT * FROM user_auth WHERE username = '" . $username . "' AND password = '" . md5(get_request_var_post("login_password")) . "' AND realm = 0");
24 + if (!api_plugin_hook_function('login_process', false)) {
26 + if ((!$user_auth) && (!$ldap_error)) {
27 + /* if auth has not occured process for builtin - AKA Ldap fall through */
28 + $user = db_fetch_row("SELECT * FROM user_auth WHERE username = '" . $username . "' AND password = '" . md5(get_request_var_post("login_password")) . "' AND realm = 0");
34 decide what to do next */
35 switch ($user["login_opts"]) {
36 case '1': /* referer */
37 - if (sizeof(db_fetch_assoc("SELECT realm_id FROM user_auth_realm WHERE realm_id = 8 AND user_id = " . $_SESSION["sess_user_id"])) == 0) {
38 - header("Location: graph_view.php");
40 - if (isset($_SERVER["HTTP_REFERER"])) {
41 - $referer = $_SERVER["HTTP_REFERER"];
42 - if (basename($referer) == "logout.php") {
43 - $referer = "index.php";
45 - } else if (isset($_SERVER["REQUEST_URI"])) {
46 - $referer = $_SERVER["REQUEST_URI"];
47 - if (basename($referer) == "logout.php") {
48 - $referer = "index.php";
51 - $referer = "index.php";
52 + /* because we use plugins, we can't redirect back to graph_view.php if they don't
53 + * have console access
55 + if (isset($_SERVER["HTTP_REFERER"])) {
56 + $referer = $_SERVER["HTTP_REFERER"];
57 + if (basename($referer) == "logout.php") {
58 + $referer = $config['url_path'] . "index.php";
60 + } else if (isset($_SERVER["REQUEST_URI"])) {
61 + $referer = $_SERVER["REQUEST_URI"];
62 + if (basename($referer) == "logout.php") {
63 + $referer = $config['url_path'] . "index.php";
66 + $referer = $config['url_path'] . "index.php";
69 + if (substr_count($referer, "plugins")) {
70 header("Location: " . $referer);
71 + } elseif (sizeof(db_fetch_assoc("SELECT realm_id FROM user_auth_realm WHERE realm_id = 8 AND user_id = " . $_SESSION["sess_user_id"])) == 0) {
72 + header("Location: graph_view.php");
74 + header("Location: $referer");
78 case '2': /* default console page */
79 - header("Location: index.php"); break;
80 + header("Location: " . $config['url_path'] . "index.php");
83 case '3': /* default graph page */
84 - header("Location: graph_view.php"); break;
85 + header("Location: " . $config['url_path'] . "graph_view.php");
89 + api_plugin_hook_function('login_options_navigate', $user['login_opts']);
94 <body bgcolor="#FFFFFF" onload="document.login.login_username.focus()">
95 <form name="login" method="post" action="<?php print basename($_SERVER["PHP_SELF"]);?>">
96 <input type="hidden" name="action" value="login">
99 +api_plugin_hook("login_before");
101 +$cacti_logo = $config['url_path'] . 'images/auth_login.gif';
102 +$cacti_logo = api_plugin_hook_function('cacti_image', $cacti_logo);
105 <table align="center">
107 - <td colspan="2"><img src="images/auth_login.gif" border="0" alt=""></td>
108 + <td colspan="2"><center><?php if ($cacti_logo != '') { ?><img src="<?php echo $cacti_logo; ?>" border="0" alt=""><?php } ?></center></td>
112 @@ -303,22 +326,29 @@
113 <td><input type="password" name="login_password" size="40" style="width: 295px;"></td>
116 - if (read_config_option("auth_method") == "3") {?>
117 + if (read_config_option("auth_method") == "3" || api_plugin_hook_function('login_realms_exist')) {
118 + $realms = api_plugin_hook_function('login_realms', array("local" => array("name" => "Local", "selected" => false), "ldap" => array("name" => "LDAP", "selected" => true)));
123 - <select name="realm" style="width: 295px;">
124 - <option value="local">Local</option>
125 - <option value="ldap" selected>LDAP</option>
126 + <select name="realm" style="width: 295px;"><?php
127 + if (sizeof($realms)) {
128 + foreach($realms as $name => $realm) {
129 + print "\t\t\t\t\t<option value='" . $name . "'" . ($realm["selected"] ? " selected":"") . ">" . htmlspecialchars($realm["name"]) . "</option>\n";
138 <tr style="height:10px;"><td></td></tr>
140 <td><input type="submit" value="Login"></td>
143 +<?php api_plugin_hook('login_after'); ?>
147 diff -Naur cacti-0.8.7g-old/data_sources.php cacti-0.8.7g/data_sources.php
148 --- cacti-0.8.7g-old/data_sources.php 2010-07-09 18:33:46.000000000 -0400
149 +++ cacti-0.8.7g/data_sources.php 2010-07-09 18:34:11.000000000 -0400
154 +$ds_actions = api_plugin_hook_function('data_source_action_array', $ds_actions);
156 /* set default action */
157 if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
160 api_reapply_suggested_data_source_title($selected_items[$i]);
161 update_data_source_title_cache($selected_items[$i]);
164 + api_plugin_hook_function('data_source_action_execute', $_POST['drp_action']);
166 header("Location: data_sources.php");
171 $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue' title='Reapply Suggested Naming to Data Source(s)'>";
173 + $save['drp_action'] = $_POST['drp_action'];
174 + $save['ds_list'] = $ds_list;
175 + $save['ds_array'] = (isset($ds_array)? $ds_array : array());
176 + api_plugin_hook_function('data_source_action_prepare', $save);
177 + $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue'>";
180 print "<tr><td bgcolor='#" . $colors["form_alternate1"]. "'><span class='textError'>You must select at least one data source.</span></td></tr>\n";
182 input_validate_input_number(get_request_var("host_id"));
183 /* ==================================================== */
185 + api_plugin_hook('data_source_edit_top');
187 $use_data_template = true;
192 form_save_button("data_sources.php");
194 - include_once("./include/bottom_footer.php");
195 + api_plugin_hook('data_source_edit_bottom');
197 + include_once("./include/bottom_footer.php");
200 function get_poller_interval($seconds) {
201 @@ -1310,6 +1323,7 @@
203 if (sizeof($data_sources) > 0) {
204 foreach ($data_sources as $data_source) {
205 + $data_source = api_plugin_hook_function('data_sources_table', $data_source);
206 $data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
207 $data_input_name = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
208 $poller_interval = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
209 diff -Naur cacti-0.8.7g-old/graph_image.php cacti-0.8.7g/graph_image.php
210 --- cacti-0.8.7g-old/graph_image.php 2010-07-09 18:33:46.000000000 -0400
211 +++ cacti-0.8.7g/graph_image.php 2010-07-09 18:34:11.000000000 -0400
213 /* flush the headers now */
216 +api_plugin_hook_function('graph_image');
218 session_write_close();
220 $graph_data_array = array();
221 diff -Naur cacti-0.8.7g-old/graph.php cacti-0.8.7g/graph.php
222 --- cacti-0.8.7g-old/graph.php 2010-07-09 18:33:46.000000000 -0400
223 +++ cacti-0.8.7g/graph.php 2010-07-09 18:34:11.000000000 -0400
225 include_once("./lib/html_tree.php");
226 include_once("./include/top_graph_header.php");
228 +api_plugin_hook_function('graph');
230 /* ================= input validation ================= */
231 input_validate_input_regex(get_request_var("rra_id"), "^([0-9]+|all)$");
232 input_validate_input_number(get_request_var("local_graph_id"));
234 <table width='1' cellpadding='0'>
237 - <img class='graphimage' id='graph_<?php print $_GET["local_graph_id"] ?>' src='<?php print htmlspecialchars("graph_image.php?action=view&local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $rra["id"]);?>' border='0' alt='<?php print htmlspecialchars($graph_title);?>'>
238 + <img class='graphimage' id='graph_<?php print $_GET["local_graph_id"] ?>' src='<?php print htmlspecialchars("graph_image.php?action=view&local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $rra["id"]);?>' border='0' alt='<?php print htmlspecialchars($graph_title);?>'>
240 <td valign='top' style='padding: 3px;' class='noprint'>
241 <a href='<?php print htmlspecialchars("graph.php?action=zoom&local_graph_id=" . $_GET["local_graph_id"]. "&rra_id=" . $rra["id"] . "&view_type=" . $_REQUEST["view_type"]);?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
242 <a href='<?php print htmlspecialchars("graph_xport.php?local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $rra["id"] . "&view_type=" . $_REQUEST["view_type"]);?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
243 <a href='<?php print htmlspecialchars("graph.php?action=properties&local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $rra["id"] . "&view_type=" . $_REQUEST["view_type"]);?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
244 + <?php api_plugin_hook('graph_buttons', array('hook' => 'view', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $rra['id'], 'view_type' => $_REQUEST['view_type'])); ?>
248 <td colspan='2' align='center'>
249 - <strong><?php print htmlspecialchars($rra["name"]);?></strong>
250 + <strong><?php print htmlspecialchars($rra["name"]);?></strong>
255 <td valign='top' style='padding: 3px;' class='noprint'>
256 <a href='<?php print htmlspecialchars("graph.php?action=properties&local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $_GET["rra_id"] . "&view_type=" . $_REQUEST["view_type"] . "&graph_start=" . $graph_start . "&graph_end=" . $graph_end);?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a>
257 <a href='<?php print htmlspecialchars("graph_xport.php?local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $_GET["rra_id"] . "&view_type=" . $_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>
258 + <?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'])); ?>
263 <td valign='top' style='padding: 3px;'>
264 <a href='<?php print htmlspecialchars("graph.php?action=zoom&local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $_GET["rra_id"] . "&view_type=" . $_REQUEST["view_type"]);?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
265 <a href='<?php print htmlspecialchars("graph_xport.php?local_graph_id=" . $_GET["local_graph_id"] . "&rra_id=" . $_GET["rra_id"] . "&view_type=" . $_REQUEST["view_type"]);?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
266 + <?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'])); ?>
270 diff -Naur cacti-0.8.7g-old/graphs_new.php cacti-0.8.7g/graphs_new.php
271 --- cacti-0.8.7g-old/graphs_new.php 2010-07-09 18:33:46.000000000 -0400
272 +++ cacti-0.8.7g/graphs_new.php 2010-07-09 18:34:11.000000000 -0400
275 <td nowrap style='white-space: nowrap;' class="textInfo" align="center" valign="top">
276 <span style="white-space: nowrap; color: #c16921;">*</span><a href="<?php print htmlspecialchars("host.php?action=edit&id=" . $_REQUEST["host_id"]);?>">Edit this Host</a><br>
277 - <span style="white-space: nowrap; color: #c16921;">*</span><a href="<?php print htmlspecialchars("host.php?action=edit");?>">Create New Host</a>
278 + <span style="white-space: nowrap; color: #c16921;">*</span><a href="<?php print htmlspecialchars("host.php?action=edit");?>">Create New Host</a><br>
279 + <?php api_plugin_hook('graphs_new_top_links'); ?>
283 diff -Naur cacti-0.8.7g-old/graphs.php cacti-0.8.7g/graphs.php
284 --- cacti-0.8.7g-old/graphs.php 2010-07-09 18:33:46.000000000 -0400
285 +++ cacti-0.8.7g/graphs.php 2010-07-09 18:34:11.000000000 -0400
287 4 => "Convert to Graph Template"
290 +$graph_actions = api_plugin_hook_function('graphs_action_array', $graph_actions);
292 /* set default action */
293 if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
297 api_resize_graphs($selected_items[$i], $_POST["graph_width"], $_POST["graph_height"]);
300 + api_plugin_hook_function('graphs_action_execute', $_POST['drp_action']);
303 header("Location: graphs.php");
307 $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue' title='Resize Selected Graph(s)'>";
309 + $save['drp_action'] = $_POST['drp_action'];
310 + $save['graph_list'] = $graph_list;
311 + $save['graph_array'] = (isset($graph_array) ? $graph_array : array());
312 + api_plugin_hook_function('graphs_action_prepare', $save);
313 + $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue'>";
316 print "<tr><td bgcolor='#" . $colors["form_alternate1"]. "'><span class='textError'>You must select at least one graph.</span></td></tr>\n";
317 diff -Naur cacti-0.8.7g-old/host.php cacti-0.8.7g/host.php
318 --- cacti-0.8.7g-old/host.php 2010-07-09 18:33:46.000000000 -0400
319 +++ cacti-0.8.7g/host.php 2010-07-09 18:34:11.000000000 -0400
321 6 => "Change Availability Options"
324 +$device_actions = api_plugin_hook_function('device_action_array', $device_actions);
326 /* set default action */
327 if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
331 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);
334 + api_plugin_hook_function('device_action_execute', $_POST['drp_action']);
337 header("Location: host.php");
339 <input type='hidden' name='tree_id' value='" . $matches[1] . "'>\n
341 $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue' title='Place Device(s) on Tree'>";
343 + $save['drp_action'] = $_POST['drp_action'];
344 + $save['host_list'] = $host_list;
345 + $save['host_array'] = (isset($host_array)? $host_array : array());
346 + api_plugin_hook_function('device_action_prepare', $save);
347 + $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'> <input type='submit' value='Continue'>";
350 print "<tr><td bgcolor='#" . $colors["form_alternate1"]. "'><span class='textError'>You must select at least one device.</span></td></tr>\n";
352 input_validate_input_number(get_request_var("id"));
353 /* ==================================================== */
355 + api_plugin_hook('host_edit_top');
357 if (!empty($_GET["id"])) {
358 $host = db_fetch_row("select * from host where id=" . $_GET["id"]);
359 $header_label = "[edit: " . htmlspecialchars($host["description"]) . "]";
361 <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs_new.php?host_id=" . $host["id"]);?>">Create Graphs for this Host</a><br>
362 <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("data_sources.php?host_id=" . $host["id"] . "&ds_rows=30&filter=&template_id=-1&method_id=-1&page=1");?>">Data Source List</a><br>
363 <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs.php?host_id=" . $host["id"] . "&graph_rows=30&filter=&template_id=-1&page=1");?>">Graph List</a>
364 + <?php api_plugin_hook('device_edit_top_links'); ?>
368 @@ -1107,6 +1120,8 @@
371 form_save_button("host.php", "return");
373 + api_plugin_hook('host_edit_bottom');
377 diff -Naur cacti-0.8.7g-old/images/disable_icon.png cacti-0.8.7g/images/disable_icon.png
378 --- cacti-0.8.7g-old/images/disable_icon.png 1969-12-31 19:00:00.000000000 -0500
379 +++ cacti-0.8.7g/images/disable_icon.png 2010-07-09 18:34:11.000000000 -0400
384 IHDR
\0\0\0\10\0\0\0\10\b\ 3\0\0\0(-
\ fS
\0\0\ 3\0PLTE
\80\80\80¾/
\aµ0
\ f·9
\1a¸6
\16¹9
\17º9
\19½B#À,
\ 2À2
385 +Á3
\vÂ8
\12À<
\18×2
\ 1Ô8
\11à9
\ 4á>
\bÙD
\1fÞA
\19ØG#ßH"ÞN%ÛQ,ÚQ/ÜP*ÜS0àB
386 éH
\ eàG
\15àK
\1câN&äP$áP,èV$é],âT1ãZ8ã];ã`?èc7äaBåeFågHælOçoSçpTèuZèv[èy^è}cÑ
\90\7fê
\81gî
\87eé
\83kê
\85kì
\8dvì
\90yð
\8dkñ
\92qµ&
\0Ü
\96\85Þ
\9b\8aí
\97\80î
\9d\89ï
\8cð¨
\95ñ®
\9dö±
\98ò²¢ô½°ô¿²õ·õÆ»øǶûäÜûèâüðîÿÿÿ
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Úú
387 ¤
\0\0\0\ 1tRNS
\0@æØf
\0\0\0\ 1bKGD
\0\88\ 5\1dH
\0\0\0 pHYs
\0\0\ eÄ
\0\0\ eÄ
\ 1\95+
\ e\e\0\0\0ÇIDATx
\9ceÏ[o
\82@
\14\ 4`¯
\15ã¦!Ù
\8a¶T6
\9a\ 3h¤!»à
\ 5EK´
\94ùÿ
\7fÇ
\ 3öÍyü
\92\99djµ§d:\¯<Ï¥
\85tÞ
\ e\fú|
\8at
\18\ 4¬$^
\18Ô)Qi
\ 1\14Ç
\85¬`
\13é
\1fdJeHÅ{
\87ÁW)"
\97¤ E ^P\}
\17°?²¼
\ 2Z#©à3
\84YnH
\1f\89û
\ f³>
\83ã=*ó¯ß|Úc
\10tDB´
\9co
\11Oº
\f¦¤3nq|ÃÅz5
\18ƶCÑ
\1f\90o-kTÂp,Ê
\98³éd4Ø1ì
\e\8df³Ýjwë
\86±û~>
\7f\a®
\82"X_
\1e#À
\0\0\0\0IEND®B`
\82
388 \ No newline at end of file
389 diff -Naur cacti-0.8.7g-old/images/enable_icon_disabled.png cacti-0.8.7g/images/enable_icon_disabled.png
390 --- cacti-0.8.7g-old/images/enable_icon_disabled.png 1969-12-31 19:00:00.000000000 -0500
391 +++ cacti-0.8.7g/images/enable_icon_disabled.png 2010-07-09 18:34:11.000000000 -0400
396 IHDR
\0\0\0\10\0\0\0\10\b\ 3\0\0\0(-
\ fS
\0\0\ 3\0PLTE
\80\80\80PPPUUUWWWXXXYYYZZZ[[[\\\^^^```bbbiiijjjssstttuuuvvvwwwxxx|||}}}~~~
\7f\7f\7fKKK
\81\81\81\82\82\82\85\85\85\86\86\86\87\87\87\8a\8a\8a\8b\8b\8b\8c\8c\8c\8d\8d\8d\8e\8e\8e\92\92\92\96\96\96\97\97\97\9a\9a\9a\9b\9b\9b\9d\9d\9d £££¤¤¤¦¦¦«««³³³´´´¾¾¾ÅÅÅËËËÿÿÿ
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15øÝ2
\0\0\0\ 1bKGD
\0\88\ 5\1dH
\0\0\0 pHYs
\0\0\ eÄ
\0\0\ eÄ
\ 1\95+
\ e\e\0\0\0ªIDATxÚ]ÎÍJBQ
\18@Ñ¥|WiRrA'M:
\b\8e\ 5ßÿ
\11\9c\ 659D3
\83\ 6Â%åüØ(¨ö
\v¬
\1d\a\7f\v·Km
\9d̦
\96§E¸,
\86¢¶nò¼
\ fuèU{
\98}
\9a\98 ÐúÌ
\98)K¡Wç|
\90^
\87á,Ð '»\
\by»b
\ 4)
\7f \9bþï£:&ÓÉ
\81\8c`J²4ò
\1e\95 N'iäht
\13®ËÊ´
\9a\1f7j!\çÃXê
\9b±
\96¡¯
\85ÝËúã
\87Xß
\vw{
\8f¿Øo"ÍH
\93ì>]î
\0\0\0\0IEND®B`
\82
397 \ No newline at end of file
398 diff -Naur cacti-0.8.7g-old/images/enable_icon.png cacti-0.8.7g/images/enable_icon.png
399 --- cacti-0.8.7g-old/images/enable_icon.png 1969-12-31 19:00:00.000000000 -0500
400 +++ cacti-0.8.7g/images/enable_icon.png 2010-07-09 18:34:11.000000000 -0400
405 IHDR
\0\0\0\10\0\0\0\10\b\ 3\0\0\0(-
\ fS
\0\0\ 3\0PLTE
\80\80\80\ fo
\ f\ 5~
\ 5\16t
\16\17y
\17\19w
\19\1ez
\1e#}#
\v\80\v\ 1\91\ 1\12\82\12\19\8d\19\1f\8c\1f\1f\9e\1f\b£
\b\ f£
\ f
408 +
\15¤
\15\14¯
\14\18¢
\18\19¬
\19#
\8c#%
\9a%)
\97).
\94.0
\9500
\9801
\981;
\9e;$¯$!µ!? ?8ª8B
\9fBB BA¨AO§OR¦RT©T[[a¯ag³gkµkv»v
\7f°
\7fy¼y
\0o
\0\85·
\85\8a»
\8a\80À
\80\8cÆ
\8c\9dÏ
\9d£Ö£±Ø±ÿÿÿ
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0×
\1fX4
\0\0\0\ 1tRNS
\0@æØf
\0\0\0\ 1bKGD
\0\88\ 5\1dH
\0\0\0 pHYs
\0\0\ eÄ
\0\0\ eÄ
\ 1\95+
\ e\e\0\0\0®IDATx
\9ceÏÛ
\ e\820
\f\ 6`ä Ó`2
\ 4%3
\9b £c
\1c\ 4\15eïÿfv
\98è
\ 5½û¿¦ië8
\8b\9aºFW
\0 sÁO
\ f\84î5ö]SkTÉ
\ 2\84v|¶
\8d\9e\f\80\10l
\8d û®ÖÊ
\18sæ
\9cm
\10*ì+(P
\18\9b\ 1\1aU!8J:
\8fHm~
\95Z
\10Õ
\1fö;
\ 4\ eJ
\81,¯
\98\ f\89\ 5VØ«JÌqL
\89\ 5.å
\9c³,¢.B
\88\92ços9F_ !îgi
\9a$
\94n
\a\84ûÊó
\ 2Ï÷ qÝá¶|þ
\ 3@{
\1aIÇ=
\1eþ
\0\0\0\0IEND®B`
\82
409 \ No newline at end of file
410 diff -Naur cacti-0.8.7g-old/images/install_icon_disabled.png cacti-0.8.7g/images/install_icon_disabled.png
411 --- cacti-0.8.7g-old/images/install_icon_disabled.png 1969-12-31 19:00:00.000000000 -0500
412 +++ cacti-0.8.7g/images/install_icon_disabled.png 2010-07-09 18:34:11.000000000 -0400
417 IHDR
\0\0\0\10\0\0\0\10\b\ 3\0\0\0(-
\ fS
\0\0\ 3\0PLTE
\80\80\80dddfffgggnnnrrrxxx}}}```
\8b\8b\8b\95\95\95\9c\9c\9c¢¢¢©©©µµµ¹¹¹ºººÁÁÁÈÈÈÏÏÏÛÛÛéééíííñññýýýþýý
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0g
\ 6Óö
\0\0\0\ 1tRNS
\0@æØf
\0\0\0\ 1bKGD
\0\88\ 5\1dH
\0\0\0 pHYs
\0\0\ eÄ
\0\0\ eÄ
\ 1\95+
\ e\e\0\0\0\81IDATx
\9cmÎÁ
418 +
\ 41
\b\ 3Ð"+RK T
\8aôÿ
\7ft
\9dé
\ eìarË;D[{Í
\94JØ_uÒ
\8b\9eî«
\92\89#)
\1e\13±
\18\e\92\ 5\10\ 2È
421 t
\1cе
\99ɽ¬ß ZRÉ~
\0êÚóê:
\94÷Yà
\1eí8g
\e?
\9c\01ùù½J
\193búóz MÕÈö
\96/
\9b¶
\bÆ'¸ãï
\0\0\0\0IEND®B`
\82
422 \ No newline at end of file
423 diff -Naur cacti-0.8.7g-old/images/install_icon.png cacti-0.8.7g/images/install_icon.png
424 --- cacti-0.8.7g-old/images/install_icon.png 1969-12-31 19:00:00.000000000 -0500
425 +++ cacti-0.8.7g/images/install_icon.png 2010-07-09 18:34:11.000000000 -0400
430 IHDR
\0\0\0\10\0\0\0\10\b\ 3\0\0\0(-
\ fS
\0\0\ 3\0PLTE
\80\80\80\1a2
\9b\ f+¦
\1c;¢",
\91$,
\90&6
\99+6
\99&D%U¼2[º)JÃ)NÉ#TÛ1UÊ2gÆ4kÐ;vÝ*
\7fÿ/yÿ>
\7fðFU¤NV§RU£Z]¨LdµN}ÏAyä0
\83ÿ5
\82ÿ;
\85ÿ?
\93ÿ^
\86ÒB
\84ûM
\85ÿO
\8aÿN
\92ûR
\88ÿW
\91úV
\98ü^
\9dõZ¤ÿa
\93ÿg
\97ÿ`
\98ÿk
\9aÿr
\97ót
\98ðu
\9bõr
\9fÿc£öd«ÿh¨ûi±ÿhµÿ}¦ÿ{¼ý~Äÿ
\11&
\9a\95\98Ä
\91 Ò
\85«ÿ
\8a¯ÿ
\8d±ÿ
\92¿ÿ
\97¹ÿ
\9b»ÿ«¬Ð¥²Ú¦¶ß±²Ó¹ºØ¡·ãª»ã
\87Ìÿ
\89Èÿ
\8dÉÿ
\93ÑÿºÆå³Ëþ¸×ÿºÕÿÅÅÝÅÖþÇÛÿËÝûÉÞÿÃáÿÏâÿÖãÿÙæüßëüßîÿÜòÿêí÷îîõèïÿæúÿìòÿõõùòÿÿÿÿÿ
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\bÜ`á
\0\0\0\ 1tRNS
\0@æØf
\0\0\0\ 1bKGD
\0\88\ 5\1dH
\0\0\0 pHYs
\0\0\ eÄ
\0\0\ eÄ
\ 1\95+
\ e\e\0\0\0ÍIDATx
\9cc`À
431 +Ü%XXÄÝàÜ vn
\ 3''=
\1e\16w(ßÊ61:4$"\
\9b ¬(
\99Í6%Ø)4ØÞ)PÛ*
\1e(àÌ
\17ëïd
\97\9adnkïÈk
432 \14\103
\b4×6LNÒÕÖ¶U
\14\ 5
433 +0
\9a\e:Ú©&%(99é*1
\ 3\ 5\98u
\94#S
\1d\93\12\9cRC
\14\858
\80\ 2\92j2j
\91©@
\10ª($'
\14p
\956
\16R
\8fNM
\8dR
\91Ñ
\14±
\ 1YËef&o
\12\15m$olÆ ²
\96ÁOÀÒËÌÂÂÌËKÐ
\15âT?~
434 o__o#~W
\98g
\92<
\15¤¤
\14<â
\19°
\ 1\0ëz%àÝÔ
\1c²
\0\0\0\0IEND®B`
\82
435 \ No newline at end of file
436 diff -Naur cacti-0.8.7g-old/images/uninstall_icon.gif cacti-0.8.7g/images/uninstall_icon.gif
437 --- cacti-0.8.7g-old/images/uninstall_icon.gif 1969-12-31 19:00:00.000000000 -0500
438 +++ cacti-0.8.7g/images/uninstall_icon.gif 2010-07-09 18:34:11.000000000 -0400
440 +GIF89a
\10\0\10\0÷N
\0\0\0\0\ 1\ 1\ 1\ 2\ 2\ 2\ 3\ 3\ 3\ 4\ 4\ 4\ 5\ 5\ 5\ 6\ 6\ 6\a\a\a\b\b\b
444 \ e\ e\ e\ f\ f\ f\10\10\10\11\11\11\12\12\12\13\13\13\14\14\14\15\15\15\16\16\16\17\17\17\18\18\18\19\19\19\1a\1a\1a\e\e\e\1c\1c\1c\1d\1d\1d\1e\1e\1e\1f\1f\1f !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???A??C??D??F@@H??J>>M<<N::O99O88P88P77P77P77Q66Q66P66P66P77O77O77X99c==m??xBB
\82EE
\8aGG
\8eJJ
\93LL
\99NN
\9ePP SS
\9fVV XX YY
\9fZZ
\9b\\
\9f]]¦``±cc½ggÄiiÈooÎvvÐzzÑ}}Ò
\7f\7fÓ
\81\81Ó
\82\82Ô
\82\82Ô
\84\84Õ
\86\86Õ
\87\87Õ
\88\88Ö
\8a\8aÖ
\8a\8aÖ
\8b\8bÖ
\8b\8bÖ
\8c\8cÖ
\8d\8dÖ
\8d\8dÒ
\8c\8cÌ
\8b\8bÃ
\8a\8a¸
\89\89©
\87\87\9e\85\85\94\84\84\8b\82\82\83\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\80\7f\7f\81\7f\7f\82\7f\7f\83~~
\86~~
\8a}}
\90{{
\96zz
\9dxx¦uu¯ss¸qq»ppºpp»uu¼yy»~~»
\83\83¿
\8c\8cÂ
\93\93Æ
\99\99É
\9e\9eÌ¡¡Ï££Ñ¥¥Ó¥¥Õ¥¥Ö¥¥Ö¥¥×¤¤×££×¢¢× ×
\9f\9fÖ
\9e\9eÖ
\9e\9eÖ
\9d\9dÖ
\9d\9dÖ
\9e\9e×
\9f\9f× ×¡¡Ø££Ú§§ÛªªÛÜ°°Þ´´ß¶¶ß¸¸àººá»»á¼¼â½½ã¿¿äÁÁåÃÃæÅÅçÈÈèÉÉèÊÊéËËéÌÌéÍÍêÎÎëÐÐìÒÒíÓÓîÔÔîÕÕïÖÖïØØðÚÚñÝÝòááóååôèèôêêôêêôêêôêêôëëõëëõììõííõîîõïïõððöññ÷òòøóóùôôúööûøøüùùüûûýüüýüüþýýþýýþýý!ù
\ 4 \0\0\88\0,
\0\0\0\0\10\0\10\0\0\bÅ
\0\11 \1cH°`AyÇÔ
\84 £&
\99<
\83\88\92}±ÃL
\9a4fq¾H+(ñX³_Æ
\8cýjvLã@w]~ýbcÇ
\9d¹=lTvy
\88èW
\1a;iØ
\98û÷Ï
\1c\9b4{Â$
\13\b&
\8dÑp<yúÌIF
\92£ÿ
\8e¹swì_85l
\9c\bt¢&αci¦ªùu,Î
\1e
\88Ȥù
\15\87M
\1cwòìı£-NÓ
\9a^
\8eýÚ³GÞ?²ÒÜy
\19\8aH
\9e\938Ú
\98
446 Lv8
\9cåppÏZ+ÈÌI
\17¯e» Ù
\f1
\19\99'OÈl
\84Ⱥ`@
\0;
447 \ No newline at end of file
448 diff -Naur cacti-0.8.7g-old/images/view_none.gif cacti-0.8.7g/images/view_none.gif
449 --- cacti-0.8.7g-old/images/view_none.gif 1969-12-31 19:00:00.000000000 -0500
450 +++ cacti-0.8.7g/images/view_none.gif 2010-07-09 18:34:11.000000000 -0400
452 +GIF89a
\10\0\10\0÷
\0\0\0\0\0\ 1\ 1\ 1\ 2\ 2\ 2\ 3\ 3\ 3\ 4\ 4\ 4\ 5\ 5\ 5\ 6\ 6\ 6\a\a\a\b\b\b
456 \ e\ e\ e\ f\ f\ f\10\10\10\11\11\11\12\12\12\13\13\13\14\14\14\15\15\15\16\16\16\17\17\17\18\18\18\19\19\19\1a\1a\1a\e\e\e\1c\1c\1c\1d\1d\1d\1e\1e\1e\1f\1f\1f !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```dddhhhnnntttyyy}}}~~~
\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\80\81\81\81\82\82\82\86\86\86\8b\8b\8b\91\91\91\97\97\97\9b\9b\9b ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ù
\ 4 \0\0\8c\0,
\0\0\0\0\10\0\10\0\0\b\1d\0\19 \1cH° Á
\83\b\13*\È°¡Ã
\87\10#J
\9cH±¢Å
\81\ 1\ 1\0;
457 \ No newline at end of file
458 diff -Naur cacti-0.8.7g-old/include/auth.php cacti-0.8.7g/include/auth.php
459 --- cacti-0.8.7g-old/include/auth.php 2010-07-09 18:33:46.000000000 -0400
460 +++ cacti-0.8.7g/include/auth.php 2010-07-09 18:34:11.000000000 -0400
464 if (read_config_option("auth_method") != 0) {
465 + /* handle alternate authentication realms */
466 + api_plugin_hook_function('auth_alternate_realms');
468 /* handle change password dialog */
469 if ((isset($_SESSION['sess_change_password'])) && (read_config_option("webbasic_enabled") != "on")) {
470 header ("Location: auth_changepassword.php?ref=" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
472 and user_auth_realm.realm_id='$realm_id'")) || (empty($realm_id)))) {
474 if (isset($_SERVER["HTTP_REFERER"])) {
475 - $goBack = "<td class='textArea' colspan='2' align='center'>( <a href='" . htmlspecialchars($_SERVER["HTTP_REFERER"]) . "'>Return</a> | <a href='logout.php'>Login Again</a> )</td>";
476 + $goBack = "<td class='textArea' colspan='2' align='center'>( <a href='" . htmlspecialchars($_SERVER["HTTP_REFERER"]) . "'>Return</a> | <a href='" . $config['url_path'] . "logout.php'>Login Again</a> )</td>";
478 - $goBack = "<td class='textArea' colspan='2' align='center'>( <a href='logout.php'>Login Again</a> )</td>";
479 + $goBack = "<td class='textArea' colspan='2' align='center'>( <a href='" . $config['url_path'] . "logout.php'>Login Again</a> )</td>";
486 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
487 - <link href="include/main.css" type="text/css" rel="stylesheet">
488 + <link href="<?php echo $config['url_path']; ?>include/main.css" type="text/css" rel="stylesheet">
493 <table width="450" align='center'>
495 - <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
496 + <td colspan='2'><img src='<?php echo $config['url_path']; ?>images/auth_deny.gif' border='0' alt='Access Denied'></td>
498 <tr style='height:10px;'><td></td></tr>
500 diff -Naur cacti-0.8.7g-old/include/bottom_footer.php cacti-0.8.7g/include/bottom_footer.php
501 --- cacti-0.8.7g-old/include/bottom_footer.php 2010-07-09 18:33:46.000000000 -0400
502 +++ cacti-0.8.7g/include/bottom_footer.php 2010-07-09 18:34:11.000000000 -0400
504 | http://www.cacti.net/ |
505 +-------------------------------------------------------------------------+
508 +$oper_mode = api_plugin_hook_function('top_header', OPER_MODE_NATIVE);
509 +if (($oper_mode == OPER_MODE_NATIVE) || ($oper_mode == OPER_MODE_IFRAME_NONAV)) {
521 /* we use this session var to store field values for when a save fails,
522 this way we can restore the field's previous values. we reset it here, because
523 they only need to be stored for a single page */
524 diff -Naur cacti-0.8.7g-old/include/config.php cacti-0.8.7g/include/config.php
525 --- cacti-0.8.7g-old/include/config.php 2010-07-09 18:33:46.000000000 -0400
526 +++ cacti-0.8.7g/include/config.php 2010-07-09 18:34:11.000000000 -0400
528 $database_password = "cactiuser";
529 $database_port = "3306";
531 +/* load up old style plugins here */
533 +//$plugins[] = 'thold';
536 + Edit this to point to the default URL of your Cacti install
537 + ex: if your cacti install as at http://serverip/cacti/ this
538 + would be set to /cacti/
542 /* Default session name - Session name must contain alpha characters */
543 #$cacti_session_name = "Cacti";
545 diff -Naur cacti-0.8.7g-old/include/global_arrays.php cacti-0.8.7g/include/global_arrays.php
546 --- cacti-0.8.7g-old/include/global_arrays.php 2010-07-09 18:33:46.000000000 -0400
547 +++ cacti-0.8.7g/include/global_arrays.php 2010-07-09 18:34:11.000000000 -0400
549 +-------------------------------------------------------------------------+
556 "message" => 'Save Successful.',
561 +$plugin_architecture = array(
565 +api_plugin_hook('config_arrays');
568 diff -Naur cacti-0.8.7g-old/include/global_constants.php cacti-0.8.7g/include/global_constants.php
569 --- cacti-0.8.7g-old/include/global_constants.php 2010-07-09 18:33:46.000000000 -0400
570 +++ cacti-0.8.7g/include/global_constants.php 2010-07-09 18:34:11.000000000 -0400
572 define("SNMP_CMDPHP", 1);
573 define("SNMP_WEBUI", 2);
576 +define('OPER_MODE_NATIVE', 0);
577 +define('OPER_MODE_RESKIN', 1);
578 +define('OPER_MODE_IFRAME_NONAV', 2);
581 \ No newline at end of file
582 diff -Naur cacti-0.8.7g-old/include/global_form.php cacti-0.8.7g/include/global_form.php
583 --- cacti-0.8.7g-old/include/global_form.php 2010-07-09 18:33:46.000000000 -0400
584 +++ cacti-0.8.7g/include/global_form.php 2010-07-09 18:34:11.000000000 -0400
586 +-------------------------------------------------------------------------+
589 -if (!defined("VALID_HOST_FIELDS")) {
590 - 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)");
591 +if (!defined('VALID_HOST_FIELDS')) {
592 + $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)');
593 + define('VALID_HOST_FIELDS', $string);
596 /* file: cdef.php, action: edit */
597 @@ -1190,4 +1191,7 @@
598 "dropdown_sql" => "select id,name from snmp_query order by name"
604 +api_plugin_hook('config_form');
606 diff -Naur cacti-0.8.7g-old/include/global.php cacti-0.8.7g/include/global.php
607 --- cacti-0.8.7g-old/include/global.php 2010-07-09 18:33:46.000000000 -0400
608 +++ cacti-0.8.7g/include/global.php 2010-07-09 18:34:11.000000000 -0400
610 /* built-in snmp support */
611 $config["php_snmp_support"] = function_exists("snmpget");
614 +if (! isset($url_path)) {
617 +$config['url_path'] = $url_path;
618 +define('URL_PATH', $url_path);
620 /* used for includes */
621 $config["base_path"] = strtr(ereg_replace("(.*)[\\\/]include", "\\1", dirname(__FILE__)), "\\", "/");
622 $config["library_path"] = ereg_replace("(.*[\\\/])include", "\\1lib", dirname(__FILE__));
623 @@ -188,15 +195,17 @@
624 /* include base modules */
625 include($config["library_path"] . "/adodb/adodb.inc.php");
626 include($config["library_path"] . "/database.php");
627 -include_once($config["library_path"] . "/functions.php");
628 -include_once($config["include_path"] . "/global_constants.php");
629 -include_once($config["include_path"] . "/global_arrays.php");
630 -include_once($config["include_path"] . "/global_settings.php");
632 /* connect to the database server */
633 db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
635 /* include additional modules */
636 +include_once($config["library_path"] . "/functions.php");
637 +include_once($config["include_path"] . "/global_constants.php");
638 +include_once($config["library_path"] . "/plugins.php");
639 +include_once($config["include_path"] . "/plugins.php");
640 +include_once($config["include_path"] . "/global_arrays.php");
641 +include_once($config["include_path"] . "/global_settings.php");
642 include_once($config["include_path"] . "/global_form.php");
643 include_once($config["library_path"] . "/html.php");
644 include_once($config["library_path"] . "/html_form.php");
646 include_once($config["library_path"] . "/variables.php");
647 include_once($config["library_path"] . "/auth.php");
649 +api_plugin_hook("config_insert");
651 /* current cacti version */
652 $config["cacti_version"] = "0.8.7g";
654 diff -Naur cacti-0.8.7g-old/include/global_settings.php cacti-0.8.7g/include/global_settings.php
655 --- cacti-0.8.7g-old/include/global_settings.php 2010-07-09 18:33:46.000000000 -0400
656 +++ cacti-0.8.7g/include/global_settings.php 2010-07-09 18:34:11.000000000 -0400
657 @@ -1190,4 +1190,6 @@
661 +api_plugin_hook('config_settings');
664 diff -Naur cacti-0.8.7g-old/include/plugins.php cacti-0.8.7g/include/plugins.php
665 --- cacti-0.8.7g-old/include/plugins.php 1969-12-31 19:00:00.000000000 -0500
666 +++ cacti-0.8.7g/include/plugins.php 2010-07-09 18:34:11.000000000 -0400
671 + * Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
672 + * Licensed under the GNU GPL. For full terms see the file COPYING.
675 +global $plugin_hooks, $plugins_system;
676 +$plugin_hooks = array();
677 +$plugins_system = array('settings', 'boost', 'dsstats');
679 +function use_plugin ($name) {
681 + if (file_exists($config['base_path'] . "/plugins/$name/setup.php")) {
682 + include_once($config['base_path'] . "/plugins/$name/setup.php");
683 + $function = "plugin_init_$name";
684 + if (function_exists($function)) {
691 + * This function executes a hook.
692 + * @param string $name Name of hook to fire
693 + * @return mixed $data
696 +$oldplugins = read_config_option('oldplugins');
697 +$oldplugins = explode(',', $oldplugins);
698 +$plugins = array_merge($plugins, $oldplugins);
700 +/* On startup, register all plugins configured for use. */
701 +if (isset($plugins) && is_array($plugins)) {
702 + foreach ($plugins as $name) {
706 diff -Naur cacti-0.8.7g-old/include/top_graph_header.php cacti-0.8.7g/include/top_graph_header.php
707 --- cacti-0.8.7g-old/include/top_graph_header.php 2010-07-09 18:33:46.000000000 -0400
708 +++ cacti-0.8.7g/include/top_graph_header.php 2010-07-09 18:34:11.000000000 -0400
710 $using_guest_account = false;
711 $show_console_tab = true;
713 +$oper_mode = api_plugin_hook_function('top_header', OPER_MODE_NATIVE);
714 +if ($oper_mode == OPER_MODE_RESKIN) {
718 /* ================= input validation ================= */
719 input_validate_input_number(get_request_var_request("local_graph_id"));
720 input_validate_input_number(get_request_var_request("graph_start"));
722 $_SESSION["sess_nav_level_cache"][2]["url"] = "graph.php?local_graph_id=" . $_REQUEST["local_graph_id"] . "&rra_id=all";
725 +$page_title = api_plugin_hook_function('page_title', draw_navigation_text("title"));
728 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
731 - <title><?php echo draw_navigation_text("title");?></title>
732 + <title><?php echo $page_title; ?></title>
734 if (isset($_SESSION["custom"]) && $_SESSION["custom"] == true) {
735 print "<meta http-equiv=refresh content='99999'>\r\n";
737 - print "<meta http-equiv=refresh content='" . htmlspecialchars(read_graph_config_option("page_refresh"),ENT_QUOTES) . "'>\r\n";
738 + $refresh = api_plugin_hook_function('top_graph_refresh', htmlspecialchars(read_graph_config_option("page_refresh"),ENT_QUOTES));
739 + print "<meta http-equiv=refresh content='" . $refresh . "'>\r\n";
742 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
743 - <link href="include/main.css" type="text/css" rel="stylesheet">
744 - <link href="images/favicon.ico" rel="shortcut icon"/>
745 - <script type="text/javascript" src="include/layout.js"></script>
746 - <script type="text/javascript" src="include/treeview/ua.js"></script>
747 - <script type="text/javascript" src="include/treeview/ftiens4.js"></script>
748 - <script type="text/javascript" src="include/jscalendar/calendar.js"></script>
749 - <script type="text/javascript" src="include/jscalendar/lang/calendar-en.js"></script>
750 - <script type="text/javascript" src="include/jscalendar/calendar-setup.js"></script>
751 + <link href="<?php echo $config['url_path']; ?>include/main.css" type="text/css" rel="stylesheet">
752 + <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon"/>
753 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
754 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ua.js"></script>
755 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/treeview/ftiens4.js"></script>
756 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar.js"></script>
757 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/lang/calendar-en.js"></script>
758 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/jscalendar/calendar-setup.js"></script>
759 + <?php api_plugin_hook('page_head'); ?>
763 +<?php if ($oper_mode == OPER_MODE_NATIVE) {?>
764 +<body <?php print api_plugin_hook_function("body_style", "");?>>
765 <a name='page_top'></a>
767 +<body <?php print api_plugin_hook_function("body_style", "");?>>
770 <table style="width:100%;height:100%;" cellspacing="0" cellpadding="0">
771 +<?php if ($oper_mode == OPER_MODE_NATIVE) { ;?>
772 <tr style="height:25px;" bgcolor="#a9a9a9" class="noprint">
773 <td colspan="2" valign="bottom" nowrap>
774 <table width="100%" cellspacing="0" cellpadding="0">
775 - <tr style="background: transparent url('images/cacti_backdrop2.gif') no-repeat center right;">
776 + <tr style="background: transparent url('<?php echo $config['url_path']; ?>images/cacti_backdrop2.gif') no-repeat center right;">
777 <td id="tabs" nowrap>
778 - <?php if ($show_console_tab == true) {?><a href="index.php"><img src="images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="graph_view.php"><img src="images/tab_graphs<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a>
779 + <?php if ($show_console_tab == true) {?><a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console.gif" alt="Console" align="absmiddle" border="0"></a><?php }?><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs<?php if ((substr(basename($_SERVER["PHP_SELF"]),0,5) == "graph") || (basename($_SERVER["PHP_SELF"]) == "graph_settings.php")) { print "_down"; } print ".gif";?>" alt="Graphs" align="absmiddle" border="0"></a><?php
780 + api_plugin_hook('top_graph_header_tabs');
783 <td id="gtabs" align="right" nowrap>
784 - <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="graph_settings.php"><img src="images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php print htmlspecialchars("graph_view.php?action=tree");?>"><img src="images/tab_mode_tree<?php if (isset($_REQUEST["action"]) && $_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 (isset($_REQUEST["action"]) && $_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 (isset($_REQUEST["action"]) && $_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
785 + <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="' . $config['url_path'] . 'graph_settings.php"><img src="' . $config['url_path'] . 'images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php print htmlspecialchars($config['url_path'] . "graph_view.php?action=tree");?>"><img src="<?php echo $config['url_path']; ?>images/tab_mode_tree<?php if (isset($_REQUEST["action"]) && $_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 print htmlspecialchars($config['url_path'] . "graph_view.php?action=list");?>"><img src="<?php echo $config['url_path']; ?>images/tab_mode_list<?php if (isset($_REQUEST["action"]) && $_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 print htmlspecialchars($config['url_path'] . "graph_view.php?action=preview");?>"><img src="<?php echo $config['url_path']; ?>images/tab_mode_preview<?php if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?> <br>
791 <tr style="height:2px;" bgcolor="#183c8f" class="noprint">
793 - <img src="images/transparent_line.gif" style="height:2px;width:170px;" border="0"><br>
794 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" style="height:2px;width:170px;" border="0"><br>
797 <tr style="height:5px;" bgcolor="#e9e9e9" class="noprint">
801 <?php if ((isset($_SESSION["sess_user_id"])) && ($using_guest_account == false)) { ?>
802 - 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>)
803 + 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>)
807 @@ -114,10 +131,10 @@
811 - <td bgcolor="#efefef" colspan="1" style="height:8px;background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
812 - <img src="images/transparent_line.gif" width="<?php print htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>" style="height:2px;" border="0"><br>
813 + <td bgcolor="#efefef" colspan="1" style="height:8px;background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
814 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" width="<?php print htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>" style="height:2px;" border="0"><br>
816 - <td bgcolor="#ffffff" colspan="1" style="height:8px;background-image: url(images/shadow.gif); background-repeat: repeat-x;">
817 + <td bgcolor="#ffffff" colspan="1" style="height:8px;background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;">
826 + global $graph_views;
827 load_current_session_value("action", "sess_cacti_graph_action", $graph_views[read_graph_config_option("default_tree_view_mode")]);
830 diff -Naur cacti-0.8.7g-old/include/top_header.php cacti-0.8.7g/include/top_header.php
831 --- cacti-0.8.7g-old/include/top_header.php 2010-07-09 18:33:46.000000000 -0400
832 +++ cacti-0.8.7g/include/top_header.php 2010-07-09 18:34:11.000000000 -0400
834 +-------------------------------------------------------------------------+
838 +global $colors, $config;
840 +$oper_mode = api_plugin_hook_function('top_header', OPER_MODE_NATIVE);
841 +if ($oper_mode == OPER_MODE_RESKIN) {
845 +$page_title = api_plugin_hook_function('page_title', draw_navigation_text("title"));
848 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
851 - <title><?php echo draw_navigation_text("title");?></title>
852 - <link href="include/main.css" type="text/css" rel="stylesheet">
853 - <link href="images/favicon.ico" rel="shortcut icon"/>
854 + <title><?php echo $page_title; ?></title>
855 + <link href="<?php echo $config['url_path']; ?>include/main.css" type="text/css" rel="stylesheet">
856 + <link href="<?php echo $config['url_path']; ?>images/favicon.ico" rel="shortcut icon">
857 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
858 - <script type="text/javascript" src="include/layout.js"></script>
859 + <script type="text/javascript" src="<?php echo $config['url_path']; ?>include/layout.js"></script>
860 <?php if (isset($refresh)) {
861 print "<meta http-equiv=refresh content=\"" . $refresh["seconds"] . "; url='" . $refresh["page"] . "'\">";
864 + api_plugin_hook('page_head'); ?>
867 -<body style="background-image:url('images/left_border.gif');background-repeat:repeat-y;">
868 +<?php if ($oper_mode == OPER_MODE_NATIVE) {?>
869 +<body style="background-image:url('<?php print $config['url_path'];?>images/left_border.gif');background-repeat:repeat-y;" <?php print api_plugin_hook_function("body_style", "");?>>
871 +<body style="background-image:url('<?php print $config['url_path'];?>images/left_border.gif');background-repeat:repeat-y;" <?php print api_plugin_hook_function("body_style", "");?>>
874 <table width="100%" cellspacing="0" cellpadding="0">
875 +<?php if ($oper_mode == OPER_MODE_NATIVE) { ;?>
876 <tr style="height:1px;" bgcolor="#a9a9a9">
877 <td valign="bottom" colspan="3" nowrap>
878 <table width="100%" cellspacing="0" cellpadding="0">
879 - <tr style="background: transparent url('images/cacti_backdrop.gif') no-repeat center right;">
880 + <tr style="background: transparent url('<?php echo $config['url_path']; ?>images/cacti_backdrop.gif') no-repeat center right;">
881 <td id="tabs" valign="bottom">
882 - <a href="index.php"><img src="images/tab_console_down.gif" alt="Console" align="absmiddle" border="0"></a><a href="graph_view.php"><img src="images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a>
884 + <a href="<?php echo $config['url_path']; ?>index.php"><img src="<?php echo $config['url_path']; ?>images/tab_console_down.gif" alt="Console" align="absmiddle" border="0"></a><a href="<?php echo $config['url_path']; ?>graph_view.php"><img src="<?php echo $config['url_path']; ?>images/tab_graphs.gif" alt="Graphs" align="absmiddle" border="0"></a><?php
885 + api_plugin_hook('top_header_tabs');
891 <tr style="height:2px;" bgcolor="#183c8f">
893 - <img src="images/transparent_line.gif" style="height:2px;" border="0"><br>
894 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" style="height:2px;" border="0"><br>
897 <tr style="height:5px;" bgcolor="#e9e9e9">
901 <?php if (read_config_option("auth_method") != 0) { ?>
902 - 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>)
903 + 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>)
911 - <td bgcolor="#f5f5f5" colspan="1" style="height:8px;width:135px;background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
912 - <img src="images/transparent_line.gif" style="height:2px;width:135px;" border="0"><br>
913 + <td bgcolor="#f5f5f5" colspan="1" style="height:8px;width:135px;background-image: url(<?php echo $config['url_path']; ?>images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
914 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" style="height:2px;width:135px;" border="0"><br>
916 - <td colspan="2" style="height:8px;background-image: url(images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
917 + <td colspan="2" style="height:8px;background-image: url(<?php echo $config['url_path']; ?>images/shadow.gif); background-repeat: repeat-x;" bgcolor="#ffffff">
925 - <img src="images/transparent_line.gif" style="height:5px;width:135px;" border="0"><br>
926 - <p align="center"><a href='about.php'><img src="images/cacti_logo.gif" border="0"></a></p>
927 - <img src="images/transparent_line.gif" style="height:5px;width:135px;" border="0"><br>
928 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" style="height:5px;width:135px;" border="0"><br>
929 + <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>
930 + <img src="<?php echo $config['url_path']; ?>images/transparent_line.gif" style="height:5px;width:135px;" border="0"><br>
932 <td width="100%" colspan="2" valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;"><?php display_output_messages();?><div style='position:relative;' id='main'>
936 + <td width="100%" valign="top"><?php display_output_messages();?>
938 diff -Naur cacti-0.8.7g-old/index.php cacti-0.8.7g/index.php
939 --- cacti-0.8.7g-old/index.php 2010-07-09 18:33:46.000000000 -0400
940 +++ cacti-0.8.7g/index.php 2010-07-09 18:34:11.000000000 -0400
942 include("./include/auth.php");
943 include("./include/top_header.php");
945 +api_plugin_hook('console_before');
948 <table width="100%" align="center">
954 +api_plugin_hook('console_after');
956 include("./include/bottom_footer.php");
959 diff -Naur cacti-0.8.7g-old/lib/api_device.php cacti-0.8.7g/lib/api_device.php
960 --- cacti-0.8.7g-old/lib/api_device.php 2010-07-09 18:33:46.000000000 -0400
961 +++ cacti-0.8.7g/lib/api_device.php 2010-07-09 18:34:11.000000000 -0400
963 $save["ping_retries"] = form_input_validate($ping_retries, "ping_retries", "^[0-9]+$", true, 3);
964 $save["max_oids"] = form_input_validate($max_oids, "max_oids", "^[0-9]+$", true, 3);
966 + $save = api_plugin_hook_function('api_device_save', $save);
970 if (!is_error_message()) {
971 diff -Naur cacti-0.8.7g-old/lib/auth.php cacti-0.8.7g/lib/auth.php
972 --- cacti-0.8.7g-old/lib/auth.php 2010-07-09 18:33:46.000000000 -0400
973 +++ cacti-0.8.7g/lib/auth.php 2010-07-09 18:34:11.000000000 -0400
979 + api_plugin_hook_function('copy_user', array('template_id' => $template_id, 'new_id' => $new_id));
986 db_execute("delete from settings_graphs where user_id=" . $user_id);
987 db_execute("delete from settings_tree where user_id=" . $user_id);
989 + api_plugin_hook_function('user_remove', $user_id);
992 /* user_disable - disable a user account
993 diff -Naur cacti-0.8.7g-old/lib/functions.php cacti-0.8.7g/lib/functions.php
994 --- cacti-0.8.7g-old/lib/functions.php 2010-07-09 18:33:46.000000000 -0400
995 +++ cacti-0.8.7g/lib/functions.php 2010-07-09 18:34:11.000000000 -0400
996 @@ -1689,6 +1689,8 @@
997 @arg $type - (string) Either 'url' or 'title'
998 @returns (string> Either the navigation text or title */
999 function draw_navigation_text($type = "url") {
1002 $nav_level_cache = (isset($_SESSION["sess_nav_level_cache"]) ? $_SESSION["sess_nav_level_cache"] : array());
1005 @@ -1701,8 +1703,8 @@
1006 "graph.php:zoom" => array("title" => "Zoom", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"),
1007 "graph.php:properties" => array("title" => "Properties", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"),
1008 "graph_settings.php:" => array("title" => "Settings", "mapping" => "graph_view.php:", "url" => "graph_settings.php", "level" => "1"),
1009 - "index.php:" => array("title" => "Console", "mapping" => "", "url" => "index.php", "level" => "0"),
1010 - "index.php:login" => array("title" => "Console", "mapping" => "", "url" => "index.php", "level" => "0"),
1011 + "index.php:" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"),
1012 + "index.php:login" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"),
1013 "graphs.php:" => array("title" => "Graph Management", "mapping" => "index.php:", "url" => "graphs.php", "level" => "1"),
1014 "graphs.php:graph_edit" => array("title" => "(Edit)", "mapping" => "index.php:,graphs.php:", "url" => "", "level" => "2"),
1015 "graphs.php:graph_diff" => array("title" => "Change Graph Template", "mapping" => "index.php:,graphs.php:,graphs.php:graph_edit", "url" => "", "level" => "3"),
1016 @@ -1780,6 +1782,8 @@
1017 "templates_import.php:" => array("title" => "Import Templates", "mapping" => "index.php:", "url" => "templates_import.php", "level" => "1"),
1020 + $nav = api_plugin_hook_function('draw_navigation_text', $nav);
1022 $current_page = basename($_SERVER["PHP_SELF"]);
1024 input_validate_input_regex(get_request_var_request("action"), "^([a-zA-Z0-9_-]+)$");
1025 diff -Naur cacti-0.8.7g-old/lib/html_form.php cacti-0.8.7g/lib/html_form.php
1026 --- cacti-0.8.7g-old/lib/html_form.php 2010-07-09 18:33:46.000000000 -0400
1027 +++ cacti-0.8.7g/lib/html_form.php 2010-07-09 18:34:11.000000000 -0400
1028 @@ -722,11 +722,13 @@
1029 on a confirmation form
1030 @arg $cancel_url - the url to go to when the user clicks 'cancel'
1031 @arg $action_url - the url to go to when the user clicks 'delete' */
1032 -function form_confirm_buttons($action_url, $cancel_url) { ?>
1033 +function form_confirm_buttons($action_url, $cancel_url) {
1037 <td bgcolor="#E1E1E1">
1038 - <input type='button' onClick='cactiReturnTo("<?php print $cancel_url;?>")' value='Cancel'>
1039 - <input type='submit' onClick='cactiReturnTo("<?php print $action_url;?>&confirm=true")' value='Delete'>
1040 + <input type='button' onClick='cactiReturnTo("<?php print $config['url_path'] . $cancel_url;?>")' value='Cancel'>
1041 + <input type='submit' onClick='cactiReturnTo("<?php print $config['url_path'] . $action_url;?>&confirm=true")' value='Delete'>
1045 diff -Naur cacti-0.8.7g-old/lib/html.php cacti-0.8.7g/lib/html.php
1046 --- cacti-0.8.7g-old/lib/html.php 2010-07-09 18:33:46.000000000 -0400
1047 +++ cacti-0.8.7g/lib/html.php 2010-07-09 18:34:11.000000000 -0400
1048 @@ -144,14 +144,15 @@
1049 <table align='center' cellpadding='0'>
1052 - <div style="min-height: <?php echo (1.6 * $graph["height"]) . "px"?>;"><a href='<?php print htmlspecialchars("graph.php?action=view&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all");?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print htmlspecialchars("graph_image.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0" . (($extra_url_args == "") ? "" : "&$extra_url_args"));?>' border='0' alt='<?php print htmlspecialchars($graph["title_cache"]);?>'></a></div>
1053 + <div style="min-height: <?php echo (1.6 * $graph["height"]) . "px"?>;"><a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=view&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all");?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print htmlspecialchars($config['url_path'] . "graph_image.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0" . (($extra_url_args == "") ? "" : "&$extra_url_args"));?>' border='0' alt='<?php print htmlspecialchars($graph["title_cache"]);?>'></a></div>
1054 <?php print (read_graph_config_option("show_graph_title") == "on" ? "<p style='font-size: 10;' align='center'><strong>" . htmlspecialchars($graph["title_cache"]) . "</strong></p>" : "");?>
1056 <td valign='top' style='align: left; padding: 3px;' class='noprint'>
1057 - <a href='<?php print htmlspecialchars("graph.php?action=zoom&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&". $extra_url_args);?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
1058 - <a href='<?php print htmlspecialchars("graph_xport.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
1059 - <a href='<?php print htmlspecialchars("graph.php?action=properties&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a><br>
1060 - <a href='#page_top'><img src='images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
1061 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=zoom&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&". $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>
1062 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph_xport.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='<?php print $config['url_path'];?>images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
1063 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=properties&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='<?php print $config['url_path'];?>images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a><br>
1064 + <?php api_plugin_hook('graph_buttons', array('hook' => 'graphs_thumbnails', 'local_graph_id' => $graph['local_graph_id'], 'rra' => 0, 'view_type' => 'view')); ?>
1065 + <a href='#page_top'><img src='<?php print $config['url_path']; ?>images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
1070 @arg $extra_url_args - extra arguments to append to the url
1071 @arg $header - html to use as a header */
1072 function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") {
1074 $i = 0; $k = 0; $j = 0;
1076 $num_graphs = sizeof($graph_array);
1077 @@ -268,14 +270,15 @@
1078 <table align='center' cellpadding='0'>
1081 - <div style="min-height: <?php echo (1.6 * read_graph_config_option("default_height")) . "px"?>;"><a href='<?php print htmlspecialchars("graph.php?action=view&rra_id=all&local_graph_id=" . $graph["local_graph_id"]);?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print htmlspecialchars("graph_image.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&graph_height=" . read_graph_config_option("default_height") . "&graph_width=" . read_graph_config_option("default_width") . "&graph_nolegend=true" . (($extra_url_args == "") ? "" : "&$extra_url_args"));?>' border='0' alt='<?php print htmlspecialchars($graph["title_cache"]);?>'></a></div>
1082 + <div style="min-height: <?php echo (1.6 * read_graph_config_option("default_height")) . "px"?>;"><a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=view&rra_id=all&local_graph_id=" . $graph["local_graph_id"]);?>'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print htmlspecialchars($config["url_path"] . "graph_image.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&graph_height=" . read_graph_config_option("default_height") . "&graph_width=" . read_graph_config_option("default_width") . "&graph_nolegend=true" . (($extra_url_args == "") ? "" : "&$extra_url_args"));?>' border='0' alt='<?php print htmlspecialchars($graph["title_cache"]);?>'></a></div>
1083 <?php print (read_graph_config_option("show_graph_title") == "on" ? "<p style='font-size: 10;' align='center'><strong>" . htmlspecialchars($graph["title_cache"]) . "</strong></p>" : "");?>
1085 <td valign='top' style='align: left; padding: 3px;'>
1086 - <a href='<?php print htmlspecialchars("graph.php?action=zoom&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
1087 - <a href='<?php print htmlspecialchars("graph_xport.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
1088 - <a href='<?php print htmlspecialchars("graph.php?action=properties&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a><br>
1089 - <a href='#page_top'><img src='images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
1090 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=zoom&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $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>
1091 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph_xport.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='<?php print $config['url_path'];?>images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>
1092 + <a href='<?php print htmlspecialchars($config['url_path'] . "graph.php?action=properties&local_graph_id=" . $graph["local_graph_id"] . "&rra_id=0&" . $extra_url_args);?>'><img src='<?php print $config['url_path'];?>images/graph_properties.gif' border='0' alt='Graph Source/Properties' title='Graph Source/Properties' style='padding: 3px;'></a><br>
1093 + <?php api_plugin_hook('graph_buttons_thumbnails', array('hook' => 'graphs_thumbnails', 'local_graph_id' => $graph['local_graph_id'], 'rra' => 0, 'view_type' => '')); ?>
1094 + <a href='#page_top'><img src='<?php print $config['url_path'] . "images/graph_page_top.gif";?>' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'></a><br>
1099 print "<td style='$this_row_style'>" . $item["hex"] . "</td>\n";
1101 if ($disable_controls == false) {
1102 - print "<td><a href='" . htmlspecialchars("$filename?action=item_movedown&id=" . $item["id"] . "&$url_data") . "'><img src='images/move_down.gif' border='0' alt='Move Down'></a>
1103 - <a href='" . htmlspecialchars("$filename?action=item_moveup&id=" . $item["id"] . "&$url_data") . "'><img src='images/move_up.gif' border='0' alt='Move Up'></a></td>\n";
1104 - print "<td align='right'><a href='" . htmlspecialchars("$filename?action=item_remove&id=" . $item["id"] . "&$url_data") . "'><img src='images/delete_icon.gif' style='height:10px;width:10px;' border='0' alt='Delete'></a></td>\n";
1105 + print "<td><a href='" . htmlspecialchars("$filename?action=item_movedown&id=" . $item["id"] . "&$url_data") . "'><img src='" . $config['url_path'] . "images/move_down.gif' border='0' alt='Move Down'></a>
1106 + <a href='" . htmlspecialchars("$filename?action=item_moveup&id=" . $item["id"] . "&$url_data") . "'><img src='" . $config['url_path'] . "images/move_up.gif' border='0' alt='Move Up'></a></td>\n";
1107 + print "<td align='right'><a href='" . htmlspecialchars("$filename?action=item_remove&id=" . $item["id"] . "&$url_data") . "'><img src='" . $config['url_path'] . "images/delete_icon.gif' style='height:10px;width:10px;' border='0' alt='Delete'></a></td>\n";
1114 while (list($item_sub_url, $item_sub_title) = each($item_title)) {
1115 + $item_sub_url = $config['url_path'] . $item_sub_url;
1117 /* indent sub-items */
1119 $prepend_string = "--- ";
1122 /* do not put a line between each sub-item */
1123 if (($i == 0) || ($draw_sub_items == false)) {
1124 - $background = "images/menu_line.gif";
1125 + $background = $config['url_path'] . "images/menu_line.gif";
1129 @@ -744,17 +749,18 @@
1131 if ($current_realm_id == -1 || (isset($user_realms[$current_realm_id])) || (!isset($user_auth_realm_filenames{basename($item_url)}))) {
1132 /* draw normal (non sub-item) menu item */
1133 + $item_url = $config['url_path'] . $item_url;
1134 if (basename($_SERVER["PHP_SELF"]) == basename($item_url)) {
1135 - print "<tr><td class='textMenuItemSelected' style='background-image:url(\"images/menu_line.gif\");'><strong><a href='" . htmlspecialchars($item_url) . "'>$item_title</a></strong></td></tr>\n";
1136 + print "<tr><td class='textMenuItemSelected' style='background-image:url(\"" . $config['url_path'] . "images/menu_line.gif\");'><strong><a href='" . htmlspecialchars($item_url) . "'>$item_title</a></strong></td></tr>\n";
1138 - print "<tr><td class='textMenuItem' style='background-image:url(\"images/menu_line.gif\");'><a href='" . htmlspecialchars($item_url) . "'>$item_title</a></td></tr>\n";
1139 + print "<tr><td class='textMenuItem' style='background-image:url(\"" . $config['url_path'] . "images/menu_line.gif\");'><a href='" . htmlspecialchars($item_url) . "'>$item_title</a></td></tr>\n";
1146 - print "<tr><td class='textMenuItem' style='background-image:url(\"images/menu_line.gif\");'></td></tr>\n";
1147 + print "<tr><td class='textMenuItem' style='background-image:url(\"" . $config['url_path'] . "images/menu_line.gif\");'></td></tr>\n";
1149 print "</table></td></tr>";
1151 @@ -764,11 +770,12 @@
1152 @arg $actions_array - an array that contains a list of possible actions. this array should
1153 be compatible with the form_dropdown() function */
1154 function draw_actions_dropdown($actions_array) {
1157 <table align='center' width='100%'>
1159 <td width='1' valign='top'>
1160 - <img src='images/arrow.gif' alt=''>
1161 + <img src='<?php echo $config['url_path']; ?>images/arrow.gif' alt='' align='middle'>
1165 diff -Naur cacti-0.8.7g-old/lib/plugins.php cacti-0.8.7g/lib/plugins.php
1166 --- cacti-0.8.7g-old/lib/plugins.php 1969-12-31 19:00:00.000000000 -0500
1167 +++ cacti-0.8.7g/lib/plugins.php 2010-07-09 18:34:11.000000000 -0400
1173 +function do_hook ($name) {
1174 + $data = func_get_args();
1175 + $data = api_plugin_hook ($name, $data);
1179 +function do_hook_function($name,$parm=NULL) {
1180 + return api_plugin_hook_function ($name, $parm);
1183 +function api_user_realm_auth ($filename = '') {
1184 + return api_plugin_user_realm_auth ($filename);
1188 + * This function executes a hook.
1189 + * @param string $name Name of hook to fire
1190 + * @return mixed $data
1192 +function api_plugin_hook ($name) {
1193 + global $config, $plugin_hooks, $plugins_system;
1194 + $data = func_get_args();
1199 + if (sizeof($plugins_system)) {
1200 + foreach($plugins_system as $plugin) {
1201 + $ps_where .= (strlen($ps_where) ? "', '":"('") . $plugin;
1203 + $ps_where .= "')";
1206 + /* order the plugin functions by system first, then followed by order */
1207 + $result = db_fetch_assoc("SELECT 1 AS id, ph.name, ph.file, ph.function
1208 + FROM plugin_hooks AS ph
1209 + LEFT JOIN plugin_config AS pc
1210 + ON pc.directory=ph.name
1211 + WHERE ph.status = 1 AND hook = '$name'
1212 + AND ph.name IN $ps_where
1214 + SELECT pc.id, ph.name, ph.file, ph.function
1215 + FROM plugin_hooks AS ph
1216 + LEFT JOIN plugin_config AS pc
1217 + ON pc.directory=ph.name
1218 + WHERE ph.status = 1 AND hook = '$name'
1219 + AND ph.name NOT IN $ps_where
1220 + ORDER BY id ASC", true);
1222 + if (count($result)) {
1223 + foreach ($result as $hdata) {
1224 + $p[] = $hdata['name'];
1225 + if (file_exists($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file'])) {
1226 + include_once($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file']);
1228 + $function = $hdata['function'];
1229 + if (function_exists($function)) {
1235 + if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
1236 + foreach ($plugin_hooks[$name] as $pname => $function) {
1237 + if (function_exists($function) && !function_exists('plugin_' . $pname . '_install') && !in_array($pname, $p)) {
1243 + /* Variable-length argument lists have a slight problem when */
1244 + /* passing values by reference. Pity. This is a workaround. */
1248 +function api_plugin_hook_function ($name, $parm=NULL) {
1249 + global $config, $plugin_hooks, $plugins_system;
1254 + if (sizeof($plugins_system)) {
1255 + foreach($plugins_system as $plugin) {
1256 + $ps_where .= (strlen($ps_where) ? "', '":"('") . $plugin;
1258 + $ps_where .= "')";
1261 + /* order the plugin functions by system first, then followed by order */
1262 + $result = db_fetch_assoc("SELECT 1 AS id, ph.name, ph.file, ph.function
1263 + FROM plugin_hooks AS ph
1264 + LEFT JOIN plugin_config AS pc
1265 + ON pc.directory=ph.name
1266 + WHERE ph.status = 1 AND hook = '$name'
1267 + AND ph.name IN $ps_where
1269 + SELECT pc.id, ph.name, ph.file, ph.function
1270 + FROM plugin_hooks AS ph
1271 + LEFT JOIN plugin_config AS pc
1272 + ON pc.directory=ph.name
1273 + WHERE ph.status = 1 AND hook = '$name'
1274 + AND ph.name NOT IN $ps_where
1275 + ORDER BY id ASC", true);
1277 + if (count($result)) {
1278 + foreach ($result as $hdata) {
1279 + $p[] = $hdata['name'];
1280 + if (file_exists($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file'])) {
1281 + include_once($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file']);
1283 + $function = $hdata['function'];
1284 + if (function_exists($function)) {
1285 + $ret = $function($ret);
1290 + if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
1291 + foreach ($plugin_hooks[$name] as $pname => $function) {
1292 + if (function_exists($function) && !function_exists('plugin_' . $pname . '_install') && !in_array($pname, $p)) {
1293 + $ret = $function($ret);
1298 + /* Variable-length argument lists have a slight problem when */
1299 + /* passing values by reference. Pity. This is a workaround. */
1303 +function api_plugin_db_table_create ($plugin, $table, $data) {
1304 + global $config, $database_default;
1305 + include_once($config["library_path"] . "/database.php");
1307 + $result = db_fetch_assoc("show tables from `" . $database_default . "`") or die (mysql_error());
1308 + $tables = array();
1309 + foreach($result as $index => $arr) {
1310 + foreach ($arr as $t) {
1314 + if (!in_array($table, $tables)) {
1316 + $sql = 'CREATE TABLE `' . $table . "` (\n";
1317 + foreach ($data['columns'] as $column) {
1318 + if (isset($column['name'])) {
1321 + $sql .= '`' . $column['name'] . '`';
1322 + if (isset($column['type']))
1323 + $sql .= ' ' . $column['type'];
1324 + if (isset($column['unsigned']))
1325 + $sql .= ' unsigned';
1326 + if (isset($column['NULL']) && $column['NULL'] == false)
1327 + $sql .= ' NOT NULL';
1328 + if (isset($column['NULL']) && $column['NULL'] == true && !isset($column['default']))
1329 + $sql .= ' default NULL';
1330 + if (isset($column['default']))
1331 + $sql .= ' default ' . (is_numeric($column['default']) ? $column['default'] : "'" . $column['default'] . "'");
1332 + if (isset($column['auto_increment']))
1333 + $sql .= ' auto_increment';
1338 + if (isset($data['primary'])) {
1339 + $sql .= ",\n PRIMARY KEY (`" . $data['primary'] . '`)';
1342 + foreach ($data['keys'] as $key) {
1343 + if (isset($key['name'])) {
1344 + $sql .= ",\n KEY `" . $key['name'] . '` (`' . $key['columns'] . '`)';
1347 + $sql .= ') TYPE = ' . $data['type'];
1349 + if (isset($data['comment'])) {
1350 + $sql .= " COMMENT = '" . $data['comment'] . "'";
1352 + if (db_execute($sql)) {
1353 + db_execute("INSERT INTO plugin_db_changes (plugin, `table`, method) VALUES ('$plugin', '$table', 'create')");
1356 + db_execute("INSERT INTO plugin_db_changes (plugin, `table`, method) VALUES ('$plugin', '$table', 'create')");
1360 +function api_plugin_db_changes_remove ($plugin) {
1361 + // Example: api_plugin_db_changes_remove ('thold');
1363 + $tables = db_fetch_assoc("SELECT `table` FROM plugin_db_changes WHERE plugin = '$plugin' AND method ='create'", false);
1364 + if (count($tables)) {
1365 + foreach ($tables as $table) {
1366 + db_execute("DROP TABLE IF EXISTS `" . $table['table'] . "`;");
1368 + db_execute("DELETE FROM plugin_db_changes where plugin = '$plugin' AND method ='create'", false);
1370 + $columns = db_fetch_assoc("SELECT `table`, `column` FROM plugin_db_changes WHERE plugin = '$plugin' AND method ='addcolumn'", false);
1371 + if (count($columns)) {
1372 + foreach ($columns as $column) {
1373 + db_execute('ALTER TABLE `' . $column['table'] . '` DROP `' . $column['column'] . '`');
1375 + db_execute("DELETE FROM plugin_db_changes where plugin = '$plugin' AND method = 'addcolumn'", false);
1379 +function api_plugin_db_add_column ($plugin, $table, $column) {
1380 + // Example: api_plugin_db_add_column ('thold', 'plugin_config', array('name' => 'test' . rand(1, 200), 'type' => 'varchar (255)', 'NULL' => false));
1382 + global $config, $database_default;
1383 + include_once($config['library_path'] . '/database.php');
1385 + $result = db_fetch_assoc('show columns from `' . $table . '`') or die (mysql_error());
1386 + $columns = array();
1387 + foreach($result as $index => $arr) {
1388 + foreach ($arr as $t) {
1392 + if (isset($column['name']) && !in_array($column['name'], $columns)) {
1393 + $sql = 'ALTER TABLE `' . $table . '` ADD `' . $column['name'] . '`';
1394 + if (isset($column['type']))
1395 + $sql .= ' ' . $column['type'];
1396 + if (isset($column['unsigned']))
1397 + $sql .= ' unsigned';
1398 + if (isset($column['NULL']) && $column['NULL'] == false)
1399 + $sql .= ' NOT NULL';
1400 + if (isset($column['NULL']) && $column['NULL'] == true && !isset($column['default']))
1401 + $sql .= ' default NULL';
1402 + if (isset($column['default']))
1403 + $sql .= ' default ' . (is_numeric($column['default']) ? $column['default'] : "'" . $column['default'] . "'");
1404 + if (isset($column['auto_increment']))
1405 + $sql .= ' auto_increment';
1406 + if (isset($column['after']))
1407 + $sql .= ' AFTER ' . $column['after'];
1409 + if (db_execute($sql)) {
1410 + db_execute("INSERT INTO plugin_db_changes (plugin, `table`, `column`, `method`) VALUES ('$plugin', '$table', '" . $column['name'] . "', 'addcolumn')");
1415 +function api_plugin_install ($plugin) {
1417 + include_once($config['base_path'] . "/plugins/$plugin/setup.php");
1419 + $exists = db_fetch_assoc("SELECT id FROM plugin_config WHERE directory = '$plugin'", false);
1420 + if (sizeof($exists)) {
1421 + db_execute("DELETE FROM plugin_config WHERE directory = '$plugin'");
1424 + $name = $author = $webpage = $version = '';
1425 + $function = 'plugin_' . $plugin . '_version';
1426 + if (function_exists($function)){
1427 + $info = $function();
1428 + $name = $info['longname'];
1429 + if (isset($info['homepage'])) {
1430 + $webpage = $info['homepage'];
1431 + }elseif (isset($info['webpage'])) {
1432 + $webpage = $info['webpage'];
1434 + $webpage = "Not Stated";
1436 + $author = $info['author'];
1437 + $version = $info['version'];
1440 + db_execute("INSERT INTO plugin_config (directory, name, author, webpage, version) VALUES ('$plugin', '$name', '$author', '$webpage', '$version')");
1442 + $function = 'plugin_' . $plugin . '_install';
1443 + if (function_exists($function)){
1445 + $ready = api_plugin_check_config ($plugin);
1447 + // Set the plugin as "disabled" so it can go live
1448 + db_execute("UPDATE plugin_config SET status = 4 WHERE directory = '$plugin'");
1450 + // Set the plugin as "needs configuration"
1451 + db_execute("UPDATE plugin_config SET status = 2 WHERE directory = '$plugin'");
1456 +function api_plugin_uninstall ($plugin) {
1458 + include_once($config['base_path'] . "/plugins/$plugin/setup.php");
1459 + // Run the Plugin's Uninstall Function first
1460 + $function = 'plugin_' . $plugin . '_uninstall';
1461 + if (function_exists($function)) {
1464 + api_plugin_remove_hooks ($plugin);
1465 + api_plugin_remove_realms ($plugin);
1466 + db_execute("DELETE FROM plugin_config WHERE directory = '$plugin'");
1467 + api_plugin_db_changes_remove ($plugin);
1470 +function api_plugin_check_config ($plugin) {
1472 + include_once($config['base_path'] . "/plugins/$plugin/setup.php");
1473 + $function = 'plugin_' . $plugin . '_check_config';
1474 + if (function_exists($function)) {
1475 + return $function();
1480 +function api_plugin_enable ($plugin) {
1481 + $ready = api_plugin_check_config ($plugin);
1483 + api_plugin_enable_hooks ($plugin);
1484 + db_execute("UPDATE plugin_config SET status = 1 WHERE directory = '$plugin'");
1488 +function api_plugin_is_enabled ($plugin) {
1489 + $status = db_fetch_cell("SELECT status FROM plugin_config WHERE directory = '$plugin'", false);
1490 + if ($status == '1')
1495 +function api_plugin_disable ($plugin) {
1496 + api_plugin_disable_hooks ($plugin);
1497 + db_execute("UPDATE plugin_config SET status = 4 WHERE directory = '$plugin'");
1500 +function api_plugin_moveup($plugin) {
1501 + global $plugins_system;
1504 + if (sizeof($plugins_system)) {
1505 + foreach($plugins_system as $s) {
1506 + $sql_where .= (strlen($sql_where) ? " AND ":"(") . " directory!='$s'";
1509 + $sql_where .= ")";
1512 + $id = db_fetch_cell("SELECT id FROM plugin_config WHERE directory='$plugin'" . (strlen($sql_where) ? " AND " . $sql_where:""));
1513 + $temp_id = db_fetch_cell("SELECT MAX(id) FROM plugin_config")+1;
1514 + $prior_id = db_fetch_cell("SELECT MAX(id) FROM plugin_config WHERE id<$id" . (strlen($sql_where) ? " AND " . $sql_where:""));
1516 + /* update the above plugin to the prior temp id */
1517 + db_execute("UPDATE plugin_config SET id=$temp_id WHERE id=$prior_id");
1518 + db_execute("UPDATE plugin_config SET id=$prior_id WHERE id=$id");
1519 + db_execute("UPDATE plugin_config SET id=$id WHERE id=$temp_id");
1522 +function api_plugin_movedown($plugin) {
1523 + global $plugins_system;
1526 + if (sizeof($plugins_system)) {
1527 + foreach($plugins_system as $s) {
1528 + $sql_where .= (strlen($sql_where) ? " AND ":"(") . " directory!='$s'";
1531 + $sql_where .= ")";
1534 + $id = db_fetch_cell("SELECT id FROM plugin_config WHERE directory='$plugin'" . (strlen($sql_where) ? " AND " . $sql_where:""));
1535 + $temp_id = db_fetch_cell("SELECT MAX(id) FROM plugin_config")+1;
1536 + $next_id = db_fetch_cell("SELECT MIN(id) FROM plugin_config WHERE id>$id" . (strlen($sql_where) ? " AND " . $sql_where:""));
1538 + /* update the above plugin to the prior temp id */
1539 + db_execute("UPDATE plugin_config SET id=$temp_id WHERE id=$next_id");
1540 + db_execute("UPDATE plugin_config SET id=$next_id WHERE id=$id");
1541 + db_execute("UPDATE plugin_config SET id=$id WHERE id=$temp_id");
1544 +function api_plugin_register_hook ($plugin, $hook, $function, $file) {
1545 + $exists = db_fetch_assoc("SELECT id FROM plugin_hooks WHERE name = '$plugin' AND hook = '$hook'", false);
1546 + if (!count($exists)) {
1547 + $settings = array('config_settings', 'config_arrays', 'config_form');
1548 + if (!in_array($hook, $settings)) {
1549 + db_execute("INSERT INTO plugin_hooks (name, hook, function, file) VALUES ('$plugin', '$hook', '$function', '$file')");
1551 + db_execute("INSERT INTO plugin_hooks (name, hook, function, file, status) VALUES ('$plugin', '$hook', '$function', '$file', 1)");
1556 +function api_plugin_remove_hooks ($plugin) {
1557 + db_execute("DELETE FROM plugin_hooks WHERE name = '$plugin'");
1560 +function api_plugin_enable_hooks ($plugin) {
1561 + db_execute("UPDATE plugin_hooks SET status = 1 WHERE name = '$plugin'");
1564 +function api_plugin_disable_hooks ($plugin) {
1565 + db_execute("UPDATE plugin_hooks SET status = 0 WHERE name = '$plugin' AND hook != 'config_settings' AND hook != 'config_arrays' AND hook != 'config_form'");
1568 +function api_plugin_register_realm ($plugin, $file, $display, $admin = false) {
1569 + $exists = db_fetch_assoc("SELECT id FROM plugin_realms WHERE plugin = '$plugin' AND file = '$file'", false);
1570 + if (!count($exists)) {
1571 + db_execute("INSERT INTO plugin_realms (plugin, file, display) VALUES ('$plugin', '$file', '$display')");
1573 + $realm_id = db_fetch_assoc("SELECT id FROM plugin_realms WHERE plugin = '$plugin' AND file = '$file'", false);
1574 + $realm_id = $realm_id[0]['id'] + 100;
1575 + $user_id = db_fetch_assoc("SELECT id FROM user_auth WHERE username = 'admin'", false);
1576 + if (count($user_id)) {
1577 + $user_id = $user_id[0]['id'];
1578 + $exists = db_fetch_assoc("SELECT realm_id FROM user_auth_realm WHERE user_id = $user_id and realm_id = $realm_id", false);
1579 + if (!count($exists)) {
1580 + db_execute("INSERT INTO user_auth_realm (user_id, realm_id) VALUES ($user_id, $realm_id)");
1587 +function api_plugin_remove_realms ($plugin) {
1588 + $realms = db_fetch_assoc("SELECT id FROM plugin_realms WHERE plugin = '$plugin'", false);
1589 + foreach ($realms as $realm) {
1590 + $id = $realm['id'] + 100;
1591 + db_execute("DELETE FROM user_auth_realm WHERE realm_id = '$id'");
1593 + db_execute("DELETE FROM plugin_realms WHERE plugin = '$plugin'");
1596 +function api_plugin_load_realms () {
1597 + global $user_auth_realms, $user_auth_realm_filenames;
1598 + $plugin_realms = db_fetch_assoc("SELECT * FROM plugin_realms ORDER BY plugin, display", false);
1599 + if (count($plugin_realms)) {
1600 + foreach ($plugin_realms as $plugin_realm) {
1601 + $plugin_files = explode(',', $plugin_realm['file']);
1602 + foreach($plugin_files as $plugin_file) {
1603 + $user_auth_realm_filenames[$plugin_file] = $plugin_realm['id'] + 100;
1605 + $user_auth_realms[$plugin_realm['id'] + 100] = $plugin_realm['display'];
1610 +function api_plugin_user_realm_auth ($filename = '') {
1611 + global $user_realms, $user_auth_realms, $user_auth_realm_filenames;
1612 + /* list all realms that this user has access to */
1613 + if (!isset($user_realms)) {
1614 + if (read_config_option('global_auth') == 'on' || read_config_option('auth_method') != 0) {
1615 + $user_realms = db_fetch_assoc("select realm_id from user_auth_realm where user_id=" . $_SESSION["sess_user_id"], false);
1616 + $user_realms = array_rekey($user_realms, "realm_id", "realm_id");
1618 + $user_realms = $user_auth_realms;
1621 + if ($filename != '') {
1622 + if (isset($user_realms[$user_auth_realm_filenames{basename($filename)}]))
1628 +function plugin_config_arrays () {
1630 + $menu['Configuration']['plugins.php'] = 'Plugin Management';
1631 + api_plugin_load_realms ();
1634 +function plugin_draw_navigation_text ($nav) {
1635 + $nav["plugins.php:"] = array("title" => "Plugin Management", "mapping" => "index.php:", "url" => "plugins.php", "level" => "1");
1645 diff -Naur cacti-0.8.7g-old/lib/poller.php cacti-0.8.7g/lib/poller.php
1646 --- cacti-0.8.7g-old/lib/poller.php 2010-07-09 18:33:46.000000000 -0400
1647 +++ cacti-0.8.7g/lib/poller.php 2010-07-09 18:34:11.000000000 -0400
1648 @@ -344,8 +344,11 @@
1652 + api_plugin_hook_function('poller_output', $rrd_update_array);
1654 - $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe);
1655 + if (api_plugin_hook_function('poller_on_demand', $results)) {
1656 + $rrds_processed = rrdtool_function_update($rrd_update_array, $rrdtool_pipe);
1660 return $rrds_processed;
1661 diff -Naur cacti-0.8.7g-old/lib/rrd.php cacti-0.8.7g/lib/rrd.php
1662 --- cacti-0.8.7g-old/lib/rrd.php 2010-07-09 18:33:46.000000000 -0400
1663 +++ cacti-0.8.7g/lib/rrd.php 2010-07-09 18:34:11.000000000 -0400
1666 $data_source_path = get_data_source_path($local_data_id, true);
1668 + /* update the rrdfile if performing a fetch */
1669 + api_plugin_hook_function('rrdtool_function_fetch_cache_check', $local_data_id);
1671 /* build and run the rrdtool fetch command with all of our data */
1672 $cmd_line = "fetch $data_source_path AVERAGE -s $start_time -e $end_time";
1673 if ($resolution > 0) {
1674 @@ -539,6 +542,10 @@
1678 + $data = api_plugin_hook_function('rrdtool_function_graph_cache_check', array('local_graph_id' => $local_graph_id,'rra_id' => $rra_id,'rrd_struc' => $rrdtool_pipe,'graph_data_array' => $graph_data_array, 'return' => false));
1679 + if (isset($data['return']) && $data['return'] != false)
1680 + return $data['return'];
1682 /* find the step and how often this graph is updated with new data */
1683 $ds_step = db_fetch_cell("select
1684 data_template_data.rrd_step
1685 @@ -1376,6 +1383,13 @@
1689 + $graph_array = api_plugin_hook_function('rrd_graph_graph_options', array('graph_opts' => $graph_opts, 'graph_defs' => $graph_defs, 'txt_graph_items' => $txt_graph_items, 'graph_id' => $local_graph_id, 'start' => $graph_start, 'end' => $graph_end));
1690 + if (!empty($graph_array)) {
1691 + $graph_defs = $graph_array['graph_defs'];
1692 + $txt_graph_items = $graph_array['txt_graph_items'];
1693 + $graph_opts = $graph_array['graph_opts'];
1696 /* either print out the source or pass the source onto rrdtool to get us a nice PNG */
1697 if (isset($graph_data_array["print_source"])) {
1698 print "<PRE>" . htmlspecialchars(read_config_option("path_rrdtool") . " graph " . $graph_opts . $graph_defs . $txt_graph_items) . "</PRE>";
1699 @@ -1384,13 +1398,19 @@
1700 @rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, RRDTOOL_OUTPUT_NULL, $rrdtool_pipe);
1703 + $graph_data_array = api_plugin_hook_function('prep_graph_array', $graph_data_array);
1705 if (isset($graph_data_array["output_flag"])) {
1706 $output_flag = $graph_data_array["output_flag"];
1708 $output_flag = RRDTOOL_OUTPUT_GRAPH_DATA;
1711 - return @rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrdtool_pipe);
1712 + $output = @rrdtool_execute("graph $graph_opts$graph_defs$txt_graph_items", false, $output_flag, $rrdtool_pipe);
1714 + api_plugin_hook_function('rrdtool_function_graph_set_file', array('output' => $output, 'local_graph_id' => $local_graph_id, 'rra_id' => $rra_id));
1720 diff -Naur cacti-0.8.7g-old/lib/variables.php cacti-0.8.7g/lib/variables.php
1721 --- cacti-0.8.7g-old/lib/variables.php 2010-07-09 18:33:46.000000000 -0400
1722 +++ cacti-0.8.7g/lib/variables.php 2010-07-09 18:34:11.000000000 -0400
1724 $string = str_replace($l_escape_string . "host_max_oids" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["max_oids"], $string);
1725 $string = str_replace($l_escape_string . "host_id" . $r_escape_string, $_SESSION["sess_host_cache_array"][$host_id]["id"], $string);
1727 + $temp = api_plugin_hook_function('substitute_host_data', array('string' => $string, 'l_escape_string' => $l_escape_string, 'r_escape_string' => $r_escape_string, 'host_id' => $host_id));
1728 + $string = $temp['string'];
1733 diff -Naur cacti-0.8.7g-old/plugins/index.php cacti-0.8.7g/plugins/index.php
1734 --- cacti-0.8.7g-old/plugins/index.php 1969-12-31 19:00:00.000000000 -0500
1735 +++ cacti-0.8.7g/plugins/index.php 2010-07-09 18:34:11.000000000 -0400
1739 +header("Location:../index.php");
1742 diff -Naur cacti-0.8.7g-old/plugins.php cacti-0.8.7g/plugins.php
1743 --- cacti-0.8.7g-old/plugins.php 1969-12-31 19:00:00.000000000 -0500
1744 +++ cacti-0.8.7g/plugins.php 2010-07-09 18:34:11.000000000 -0400
1748 + +-------------------------------------------------------------------------+
1749 + | Copyright (C) 2004-2010 The Cacti Group |
1751 + | This program is free software; you can redistribute it and/or |
1752 + | modify it under the terms of the GNU General Public License |
1753 + | as published by the Free Software Foundation; either version 2 |
1754 + | of the License, or (at your option) any later version. |
1756 + | This program is distributed in the hope that it will be useful, |
1757 + | but WITHOUT ANY WARRANTY; without even the implied warranty of |
1758 + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1759 + | GNU General Public License for more details. |
1760 + +-------------------------------------------------------------------------+
1761 + | Cacti: The Complete RRDTool-based Graphing Solution |
1762 + +-------------------------------------------------------------------------+
1763 + | This code is designed, written, and maintained by the Cacti Group. See |
1764 + | about.php and/or the AUTHORS file for specific developer information. |
1765 + +-------------------------------------------------------------------------+
1766 + | http://www.cacti.net/ |
1767 + +-------------------------------------------------------------------------+
1770 +include("./include/auth.php");
1772 +define("MAX_DISPLAY_PAGES", 21);
1774 +$actions = array("install" => "Install",
1775 + "enable" => "Enable",
1776 + "disable" => "Disable",
1777 + "uninstall" => "Uninstall",
1778 +// "check" => "Check"
1781 +$status_names = array(
1784 + 0 => 'Not Installed',
1786 + 2 => 'Awaiting Configuration',
1787 + 3 => 'Awaiting Upgrade',
1791 +/* get the comprehensive list of plugins */
1792 +$pluginslist = retrieve_plugin_list();
1794 +/* Check to see if we are installing, etc... */
1795 +$modes = array('installold', 'uninstallold', 'install', 'uninstall', 'disable', 'enable', 'check', 'moveup', 'movedown');
1797 +if (isset($_GET['mode']) && in_array($_GET['mode'], $modes) && isset($_GET['id'])) {
1798 + input_validate_input_regex(get_request_var("id"), "^([a-zA-Z0-9]+)$");
1800 + $mode = $_GET['mode'];
1801 + $id = sanitize_search_string($_GET['id']);
1804 + case 'installold':
1805 + api_plugin_install_old($id);
1806 + header("Location: plugins.php");
1809 + case 'uninstallold':
1810 + api_plugin_uninstall_old($id);
1811 + header("Location: plugins.php");
1815 + api_plugin_install($id);
1816 + header("Location: plugins.php");
1820 + if (!in_array($id, $pluginslist)) break;
1821 + api_plugin_uninstall($id);
1822 + header("Location: plugins.php");
1826 + if (!in_array($id, $pluginslist)) break;
1827 + api_plugin_disable($id);
1828 + header("Location: plugins.php");
1832 + if (!in_array($id, $pluginslist)) break;
1833 + api_plugin_enable($id);
1834 + header("Location: plugins.php");
1838 + if (!in_array($id, $pluginslist)) break;
1841 + if (!in_array($id, $pluginslist)) break;
1842 + if (is_system_plugin($id)) break;
1843 + api_plugin_moveup($id);
1844 + header("Location: plugins.php");
1848 + if (!in_array($id, $pluginslist)) break;
1849 + if (is_system_plugin($id)) break;
1850 + api_plugin_movedown($id);
1851 + header("Location: plugins.php");
1857 +function retrieve_plugin_list () {
1858 + $pluginslist = array();
1859 + $temp = db_fetch_assoc('SELECT directory FROM plugin_config ORDER BY name');
1860 + foreach ($temp as $t) {
1861 + $pluginslist[] = $t['directory'];
1863 + return $pluginslist;
1866 +include("./include/top_header.php");
1868 +update_show_current();
1870 +include("./include/bottom_footer.php");
1873 +function api_plugin_install_old ($plugin) {
1875 + if (!file_exists($config['base_path'] . "/plugins/$plugin/setup.php")) {
1878 + $oldplugins = read_config_option('oldplugins');
1879 + $oldplugins = explode(',', $oldplugins);
1880 + if (!in_array($plugin, $oldplugins)) {
1881 + include_once($config['base_path'] . "/plugins/$plugin/setup.php");
1882 + $function = 'plugin_init_' . $plugin;
1883 + if (function_exists($function)){
1884 + $oldplugins[] = $plugin;
1885 + $oldplugins = implode(',', $oldplugins);
1886 + set_config_option('oldplugins', $oldplugins);
1887 + unset($_SESSION['sess_config_array']['oldplugins']);
1896 +function api_plugin_uninstall_old ($plugin) {
1898 + $oldplugins = read_config_option('oldplugins');
1899 + $oldplugins = explode(',', $oldplugins);
1900 + if (!empty($oldplugins)) {
1901 + if (in_array($plugin, $oldplugins)) {
1902 + for ($a = 0; $a < count($oldplugins); $a++) {
1903 + if ($oldplugins[$a] == $plugin) {
1904 + unset($oldplugins[$a]);
1908 + $oldplugins = implode(',', $oldplugins);
1909 + set_config_option('oldplugins', $oldplugins);
1910 + unset($_SESSION['sess_config_array']['oldplugins']);
1917 +function update_show_updates () {
1918 + global $pluginslist, $colors, $config, $plugin_architecture;
1921 + sort($pluginslist);
1923 + $cinfo = update_get_plugin_info ();
1927 + $info = update_get_cached_plugin_info();
1929 + $cactinew = update_check_if_newer($cinfo['cacti']['version'], $info['cacti']['version']) ;
1930 + if (isset($cinfo['cacti_plugin_arch']['version'])) {
1931 + $archnew = update_check_if_newer($cinfo['cacti_plugin_arch']['version'], $info['cacti_plugin_arch']['version']);
1938 + print "<tr><td width='25%' valign=top><table width='100%'>";
1939 + html_header(array("Cacti"), 2);
1940 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1941 + print "<td width='25%'><strong>Version:</strong></td><td>" . $config["cacti_version"] . "</td></tr>";
1942 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1943 + print "<td valign=top><strong>Changes:</strong></td><td>" . str_replace("\n", '<br>', $info['cacti']['changes']) . "</td></tr></table>";
1945 + if (isset($plugin_architecture['version']) && $archnew) {
1947 + print "<table width='100%'>";
1948 + html_header(array("Plugin Architecture"), 2);
1949 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1950 + print "<td width='25%'><strong>Version:</strong></td><td>" . $plugin_architecture['version'] . "</td>";
1951 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1952 + print "<td valign=top><strong>Changes:</strong></td><td>" . str_replace("\n", '<br>', $info['cacti_plugin_arch']['changes']) . "</td></tr></table>";
1954 + print "<table width='100%' cellspacing=0 cellpadding=3>";
1956 + foreach ($pluginslist as $plugin) {
1957 + if (isset($cinfo[$plugin]) && update_check_if_newer($cinfo[$plugin]['version'], $info[$plugin]['version'])) {
1959 + print "<table width='100%'>";
1960 + html_header(array((isset($cinfo[$plugin]['longname']) ? $cinfo[$plugin]['longname'] : $plugin)), 2);
1961 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1962 + print "<td width='50%'><strong>Directory:</strong></td><td>$plugin</td>";
1963 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1964 + print "<td><strong>Version:</strong></td><td>" . $info[$plugin]['version'] . "</td>";
1965 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1966 + print "<td><strong>Author:</strong></td><td>" . (isset($cinfo[$plugin]['author']) && $cinfo[$plugin]['author'] != '' ? (isset($cinfo[$plugin]['email']) && $cinfo[$plugin]['email'] != '' ? "<a href='mailto:" . $cinfo[$plugin]['email'] . "'>" . $cinfo[$plugin]['author'] . "</a>" : $cinfo[$plugin]['author']) : "") . "</td>";
1967 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1968 + print "<td><strong>Home Page:</strong></td><td>" . (isset($cinfo[$plugin]['webpage']) && $cinfo[$plugin]['webpage'] != '' ? "<a href='" . $cinfo[$plugin]['webpage'] . "'>" . $cinfo[$plugin]['webpage'] . "</a>" : "") . "</td>";
1969 + form_alternate_row_color($colors["alternate"],$colors["light"], 0);
1970 + print "<td valign=top><strong>Changes:</strong></td><td>" . str_replace("\n", '<br>', $info[$plugin]['changes']) . "</td>";
1972 + print "</tr></table>";
1976 + print "<br><center><b>There are currently no Updates!</b></center><br>";
1978 + html_end_box(TRUE);
1981 +function update_check_if_newer() {
1985 +function plugins_temp_table_exists($table) {
1986 + return sizeof(db_fetch_row("SHOW TABLES LIKE '$table'"));
1989 +function plugins_load_temp_table() {
1990 + global $config, $plugins;
1992 + $pluginslist = retrieve_plugin_list();
1994 + if (isset($_SESSION["plugin_temp_table"])) {
1995 + $table = $_SESSION["plugin_temp_table"];
1997 + $table = "plugin_temp_table_" . rand();
2001 + if (!plugins_temp_table_exists($table)) {
2002 + $_SESSION["plugin_temp_table"] = $table;
2003 + db_execute("CREATE TEMPORARY TABLE $table LIKE plugin_config");
2004 + db_execute("INSERT INTO $table SELECT * FROM plugin_config");
2007 + $table = "plugin_temp_table_" . rand();
2011 + $path = $config['base_path'] . '/plugins/';
2012 + $dh = opendir($path);
2013 + while (($file = readdir($dh)) !== false) {
2014 + if ((is_dir("$path/$file")) && (file_exists("$path/$file/setup.php")) && (!in_array($file, $pluginslist))) {
2015 + if (!function_exists('plugin_' . $file . '_install')) {
2016 + include_once("$path/$file/setup.php");
2017 + if (!function_exists('plugin_' . $file . '_install') && function_exists($file . '_version')) {
2018 + $function = $file . '_version';
2019 + $cinfo[$file] = $function();
2020 + if (!isset($cinfo[$file]['author'])) $cinfo[$file]['author'] = 'Unknown';
2021 + if (!isset($cinfo[$file]['homepage'])) $cinfo[$file]['homepage'] = 'Not Stated';
2022 + if (isset($cinfo[$file]['webpage'])) $cinfo[$file]['homepage'] = $cinfo[$file]['webpage'];
2023 + if (!isset($cinfo[$file]['longname'])) $cinfo[$file]['longname'] = ucfirst($file);
2024 + $cinfo[$file]['status'] = -2;
2025 + if (in_array($file, $plugins)) {
2026 + $cinfo[$file]['status'] = -1;
2028 + db_execute("REPLACE INTO $table (directory, name, status, author, webpage, version)
2031 + $cinfo[$file]['longname'] . "', '" .
2032 + $cinfo[$file]['status'] . "', '" .
2033 + $cinfo[$file]['author'] . "', '" .
2034 + $cinfo[$file]['homepage'] . "', '" .
2035 + $cinfo[$file]['version'] . "')");
2036 + $pluginslist[] = $file;
2037 + } else if (function_exists('plugin_' . $file . '_install') && function_exists('plugin_' . $file . '_version')) {
2038 + $function = $file . '_version';
2039 + $cinfo[$file] = $function();
2040 + $cinfo[$file]['status'] = 0;
2041 + if (!isset($cinfo[$file]['author'])) $cinfo[$file]['author'] = 'Unknown';
2042 + if (!isset($cinfo[$file]['homepage'])) $cinfo[$file]['homepage'] = 'Not Stated';
2043 + if (isset($cinfo[$file]['webpage'])) $cinfo[$file]['homepage'] = $cinfo[$file]['webpage'];
2044 + if (!isset($cinfo[$file]['longname'])) $cinfo[$file]['homepage'] = ucfirst($file);
2045 + db_execute("REPLACE INTO $table (directory, name, status, author, webpage, version)
2048 + $cinfo[$file]['longname'] . "', '" .
2049 + $cinfo[$file]['status'] . "', '" .
2050 + $cinfo[$file]['author'] . "', '" .
2051 + $cinfo[$file]['homepage'] . "', '" .
2052 + $cinfo[$file]['version'] . "')");
2053 + $pluginslist[] = $file;
2056 + cacti_log("WARNING: Install function already exists for plugin directory '$file'", false);
2065 +function update_show_current () {
2066 + global $plugins, $pluginslist, $colors, $plugin_architecture, $config, $status_names, $actions;
2068 + /* ================= input validation ================= */
2069 + input_validate_input_number(get_request_var_request("page"));
2070 + /* ==================================================== */
2072 + /* clean up search string */
2073 + if (isset($_REQUEST["filter"])) {
2074 + $_REQUEST["filter"] = sanitize_search_string(get_request_var("filter"));
2077 + /* clean up sort_column */
2078 + if (isset($_REQUEST["sort_column"])) {
2079 + $_REQUEST["sort_column"] = sanitize_search_string(get_request_var("sort_column"));
2082 + /* clean up search string */
2083 + if (isset($_REQUEST["sort_direction"])) {
2084 + $_REQUEST["sort_direction"] = sanitize_search_string(get_request_var("sort_direction"));
2087 + /* if the user pushed the 'clear' button */
2088 + if (isset($_REQUEST["clear_x"])) {
2089 + kill_session_var("sess_plugins_filter");
2090 + kill_session_var("sess_plugins_sort_column");
2091 + kill_session_var("sess_plugins_sort_direction");
2093 + unset($_REQUEST["page"]);
2094 + unset($_REQUEST["filter"]);
2095 + unset($_REQUEST["sort_column"]);
2096 + unset($_REQUEST["sort_direction"]);
2097 + $_REQUEST["page"] = 1;
2100 + /* remember these search fields in session vars so we don't have to keep passing them around */
2101 + load_current_session_value("filter", "sess_plugins_filter", "");
2102 + load_current_session_value("sort_column", "sess_plugins_sort_column", "name");
2103 + load_current_session_value("sort_direction", "sess_plugins_sort_direction", "ASC");
2104 + load_current_session_value("page", "sess_plugins_current_page", "1");
2106 + $table = plugins_load_temp_table();
2108 + html_start_box("<strong>Plugin Management</strong> (Cacti Version: " . $config["cacti_version"] .
2109 + (isset($plugin_architecture['version']) ? ", Plugin Architecture Version: " . $plugin_architecture['version']:"") .
2110 + ")", "100%", $colors["header"], "3", "center", "");
2113 + <tr bgcolor="#<?php print $colors['panel'];?>">
2114 + <td class="noprint">
2115 + <form name="form_plugins" method="get" action="plugins.php">
2116 + <table width="100%" cellpadding="0" cellspacing="0">
2117 + <tr class="noprint">
2118 + <td nowrap style='white-space: nowrap;' width="50">
2122 + <input type="text" name="filter" size="40" value="<?php print get_request_var_request("filter");?>">
2124 + <td nowrap style='white-space: nowrap;'>
2125 + <input type="submit" value="Go" title="Set/Refresh Filters">
2126 + <input type="submit" name="clear_x" value="Clear" title="Clear Filters">
2130 + <input type='hidden' name='page' value='1'>
2138 + /* print checkbox form for validation */
2139 + print "<form name='chk' method='post' action='plugins.php'>\n";
2141 + html_start_box("", "100%", $colors["header"], "3", "center", "");
2143 + /* form the 'where' clause for our main sql query */
2144 + $sql_where = "WHERE ($table.name LIKE '%%" . get_request_var_request("filter") . "%%')";
2146 + if (get_request_var_request("sort_column") == "version") {
2147 + $sortc = "version+0";
2149 + $sortc = get_request_var_request("sort_column");
2152 + if (get_request_var_request("sort_column") == "id") {
2155 + $sortd = get_request_var_request("sort_direction");
2158 + $total_rows = db_fetch_cell("SELECT
2163 + $plugins = db_fetch_assoc("SELECT *
2166 + ORDER BY " . $sortc . " " . $sortd . "
2167 + LIMIT " . (read_config_option("num_rows_device")*(get_request_var_request("page")-1)) . "," . read_config_option("num_rows_device"));
2169 + db_execute("DROP TABLE $table");
2171 + /* generate page list */
2172 + $url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_device"), $total_rows, "plugins.php?filter=" . get_request_var_request("filter"));
2174 + if ($total_rows == 0) {
2175 + $nav = "<tr bgcolor='#" . $colors["header"] . "'>
2177 + <table width='100%' cellspacing='0' cellpadding='0' border='0'>
2179 + <td align='center' class='textHeaderDark'>
2186 + }elseif ($total_rows < read_config_option("num_rows_device")) {
2187 + $nav = "<tr bgcolor='#" . $colors["header"] . "'>
2189 + <table width='100%' cellspacing='0' cellpadding='0' border='0'>
2191 + <td align='center' class='textHeaderDark'>
2192 + Showing All $total_rows Rows
2199 + $nav = "<tr bgcolor='#" . $colors["header"] . "'>
2201 + <table width='100%' cellspacing='0' cellpadding='0' border='0'>
2203 + <td align='left' class='textHeaderDark'>
2204 + <strong><< "; if (get_request_var_request("page") > 1) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("plugins.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")-1)) . "'>"; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= "</a>"; } $nav .= "</strong>
2206 + <td align='center' class='textHeaderDark'>
2207 + Showing Rows " . ((read_config_option("num_rows_device")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_device")) || ($total_rows < (read_config_option("num_rows_device")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_device")*get_request_var_request("page"))) . " of $total_rows [$url_page_select]
2209 + <td align='right' class='textHeaderDark'>
2210 + <strong>"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("plugins.php?filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")+1)) . "'>"; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_device")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
2220 + $display_text = array(
2221 + "nosort" => array("Actions", ""),
2222 + "directory" => array("Name", "ASC"),
2223 + "id" => array("Load Order", "ASC"),
2224 + "name" => array("Description", "ASC"),
2225 + "nosort1" => array("Type", "ASC"),
2226 + "status" => array("Status", "ASC"),
2227 + "author" => array("Author", "ASC"),
2228 + "webpage" => array("Web Page", "ASC"),
2229 + "version" => array("Version", "ASC"));
2231 + html_header_sort($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"), 1);
2234 + if (sizeof($plugins)) {
2235 + if (get_request_var_request("sort_column") == "id") {
2236 + $inst_system_plugins = get_system_plugins($plugins);
2237 + if (sizeof($inst_system_plugins)) {
2238 + foreach($inst_system_plugins as $plugin) {
2239 + form_alternate_row_color($colors["alternate"], $colors["light"], $i); $i++;
2240 + print format_plugin_row($plugin, false, false, true);
2246 + foreach ($plugins as $plugin) {
2247 + if ((isset($plugins[$j+1]) && $plugins[$j+1]['status'] < 0) || (!isset($plugins[$j+1]))) {
2248 + $last_plugin = true;
2250 + $last_plugin = false;
2252 + if ($plugin['status'] <= 0 || is_system_plugin($plugin) || (get_request_var_request('sort_column') != 'id')) {
2253 + $load_ordering = false;
2255 + $load_ordering = true;
2258 + if (get_request_var_request("sort_column") == "id") {
2259 + if (!is_system_plugin($plugin)) {
2260 + form_alternate_row_color($colors["alternate"], $colors["light"], $i);
2261 + print format_plugin_row($plugin, $last_plugin, $load_ordering, false);
2265 + form_alternate_row_color($colors["alternate"], $colors["light"], $i);
2266 + print format_plugin_row($plugin, $last_plugin, $load_ordering, is_system_plugin($plugin));
2275 + print "<tr><td><em>No Plugins Found</em></td></tr>";
2278 + html_end_box(false);
2280 + html_start_box("", "100%", $colors["header"], "3", "center", "");
2281 + echo "<tr><td colspan=10><strong>NOTE:</strong> Please sort by 'Load Order' to change plugin load ordering.<br><strong>NOTE:</strong> SYSTEM plugins can not be ordered.</td></tr>";
2284 + print "</form>\n";
2287 +function format_plugin_row($plugin, $last_plugin, $include_ordering, $system_plugin) {
2288 + global $status_names;
2289 + static $first_plugin = true;
2291 + $row = plugin_actions($plugin);
2292 + $row .= "<td><strong>" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", ucfirst($plugin["directory"])) : ucfirst($plugin["directory"])) . "</strong></td>";
2293 + if ($include_ordering) {
2294 + $row .= "<td style='white-space:nowrap;'>";
2295 + if (!$first_plugin) {
2296 + $row .= "<a href='" . htmlspecialchars("plugins.php?mode=moveup&id=" . $plugin['directory']) . "' title='Order Before Prevous Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/move_up.gif'></a>";
2298 + $row .= "<a href='#' title='Can NOT Reduce Load Order' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/view_none.gif'></a>";
2300 + if (!$last_plugin) {
2301 + $row .= "<a href='" . htmlspecialchars("plugins.php?mode=movedown&id=" . $plugin['directory']) . "' title='Order After Next Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/move_down.gif'></a>";
2303 + $row .= "<a href='#' title='Can Increase Load Order' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/view_none.gif'></a>";
2305 + $row .= "</td>\n";
2307 + $row .= "<td></td>\n";
2310 + $row .= "<td style='white-space:nowrap;'>" . (strlen(get_request_var_request("filter")) ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $plugin["name"]) : $plugin["name"]) . "</td>\n";
2311 + $row .= "<td style='white-space:nowrap;'>" . ($system_plugin ? "System": ($plugin['status'] < 0 ? "Old PIA":"General")) . "</td>\n";
2312 + $row .= "<td style='white-space:nowrap;'>" . $status_names[$plugin["status"]] . "</td>\n";
2313 + $row .= "<td style='white-space:nowrap;'>" . $plugin["author"] . "</td>\n";
2314 + $row .= "<td><a href='" . htmlspecialchars($plugin["webpage"]) . "'>" . htmlspecialchars($plugin["webpage"]) . "</a></td>\n";
2315 + $row .= "<td>" . $plugin["version"] . "</td>\n";
2316 + $row .= "</tr>\n";
2318 + if ($include_ordering) {
2319 + $first_plugin = false;
2325 +function plugin_actions($plugin) {
2327 + switch ($plugin['status']) {
2328 + case "-2": // Old PA Not Installed
2329 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=installold&id=" . $plugin['directory']) . "' title='Install Old Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/install_icon.png'></a>";
2330 + $link .= "<img style='padding:1px;' border='0' align='absmiddle' src='images/view_none.gif'>";
2332 + case "-1": // Old PA Currently Active
2333 + $oldplugins = read_config_option('oldplugins');
2334 + $oldplugins = explode(',', $oldplugins);
2335 + if (in_array($plugin['directory'], $oldplugins)) {
2336 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=uninstallold&id=" . $plugin['directory']) . "' title='Uninstall Old Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/uninstall_icon.gif'></a>";
2338 + $link .= "<a href='#' title='Please Uninstall from config.php' class='linkEditMain'><img style='padding:1px;' align='absmiddle' border='0' src='images/install_icon_disabled.png'></a>";
2340 + $link .= "<img style='padding:1px;' border='0' align='absmiddle' src='images/view_none.gif'>";
2342 + case "0": // Not Installed
2343 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=install&id=" . $plugin['directory']) . "' title='Install Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/install_icon.png'></a>";
2344 + $link .= "<img style='padding:1px;' border='0' align='absmiddle' src='images/view_none.gif'>";
2346 + case "1": // Currently Active
2347 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=uninstall&id=" . $plugin['directory']) . "' title='Uninstall Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/uninstall_icon.gif'></a>";
2348 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=disable&id=" . $plugin['directory']) . "' title='Disable Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/disable_icon.png'></a>";
2350 + case "4": // Installed but not active
2351 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=uninstall&id=" . $plugin['directory']) . "' title='Uninstall Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/uninstall_icon.gif'></a>";
2352 + $link .= "<a href='" . htmlspecialchars("plugins.php?mode=enable&id=" . $plugin['directory']) . "' title='Enable Plugin' class='linkEditMain'><img style='padding:1px;' border='0' align='absmiddle' src='images/enable_icon.png'></a>";
2354 + default: // Old PIA
2355 + $link .= "<a href='#' title='Please Install/Uninstall from config.php' class='linkEditMain'><img style='padding:1px;' align='absmiddle' border='0' src='images/install_icon_disabled.png'></a>";
2356 + $link .= "<a href='#' title='Enabling from the UI is not supported' class='linkEditMain'><img style='padding:1px;' align='absmiddle' border='0' src='images/enable_icon_disabled.png'></a>";
2364 +function is_system_plugin($plugin) {
2365 + global $plugins_system;
2367 + if (is_array($plugin)) {
2368 + $plugin = $plugin["directory"];
2371 + if (!in_array($plugin, $plugins_system)) {
2378 +function get_system_plugins($plugins) {
2379 + $inst_system_plugins = array();
2381 + if (sizeof($plugins)) {
2382 + foreach($plugins as $plugin) {
2383 + if (is_system_plugin($plugin)) {
2384 + $inst_system_plugins[] = $plugin;
2389 + return $inst_system_plugins;
2393 diff -Naur cacti-0.8.7g-old/poller.php cacti-0.8.7g/poller.php
2394 --- cacti-0.8.7g-old/poller.php 2010-07-09 18:33:46.000000000 -0400
2395 +++ cacti-0.8.7g/poller.php 2010-07-09 18:34:11.000000000 -0400
2397 pcntl_signal(SIGINT, "sig_handler");
2400 +api_plugin_hook('poller_top');
2402 /* record the start time */
2403 list($micro,$seconds) = split(" ", microtime());
2404 $poller_start = $seconds + $micro;
2406 $total_procs = $concurrent_processes;
2409 + $extra_args = api_plugin_hook_function ('poller_command_args', $extra_args);
2411 /* Populate each execution file with appropriate information */
2412 foreach ($polling_hosts as $item) {
2413 if ($host_count == 1) {
2414 @@ -446,9 +450,11 @@
2416 /* sleep the appripriate amount of time */
2417 if ($poller_runs_completed < $poller_runs) {
2418 + api_plugin_hook('poller_bottom');
2420 usleep($sleep_time * 1000000);
2421 db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
2422 + api_plugin_hook('poller_top');
2424 }else if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_MEDIUM || $debug) {
2425 cacti_log("WARNING: Cacti Polling Cycle Exceeded Poller Interval by " . $loop_end-$loop_start-$poller_interval . " seconds", TRUE, "POLLER");
2427 echo " --debug|-d Output debug information. Similar to cacti's DEBUG logging level.\n\n";
2430 +api_plugin_hook('poller_bottom');
2433 diff -Naur cacti-0.8.7g-old/user_admin.php cacti-0.8.7g/user_admin.php
2434 --- cacti-0.8.7g-old/user_admin.php 2010-07-09 18:33:46.000000000 -0400
2435 +++ cacti-0.8.7g/user_admin.php 2010-07-09 18:34:11.000000000 -0400
2440 - include_once("include/top_header.php");
2442 - include_once("include/bottom_footer.php");
2443 + if (!api_plugin_hook_function('user_admin_action', get_request_var_request("action"))) {
2444 + include_once("include/top_header.php");
2446 + include_once("include/bottom_footer.php");
2452 $save["policy_graph_templates"] = form_input_validate(get_request_var_post("policy_graph_templates", get_request_var_post("_policy_graph_templates")), "policy_graph_templates", "", true, 3);
2453 $save["realm"] = get_request_var_post("realm", 0);
2454 $save["enabled"] = form_input_validate(get_request_var_post("enabled", ""), "enabled", "", true, 3);
2455 + $save = api_plugin_hook_function('user_admin_setup_sql_save', $save);
2457 if (!is_error_message()) {
2458 $user_id = sql_save($save, "user_auth");
2460 policy_hosts = " . get_request_var_post("policy_hosts") . ",
2461 policy_graph_templates = " . get_request_var_post("policy_graph_templates") . "
2462 WHERE id = " . get_request_var_post("id"));
2464 + api_plugin_hook('user_admin_user_save');
2469 $header_label = "[new]";
2472 + api_plugin_hook_function('user_admin_edit', (isset($user) ? get_request_var("id") : 0));
2474 html_start_box("<strong>User Management</strong> $header_label", "100%", $colors["header"], "3", "center", "");
2476 draw_edit_form(array(
2477 diff -Naur cacti-0.8.7g-old/utilities.php cacti-0.8.7g/utilities.php
2478 --- cacti-0.8.7g-old/utilities.php 2010-07-09 18:33:46.000000000 -0400
2479 +++ cacti-0.8.7g/utilities.php 2010-07-09 18:34:11.000000000 -0400
2480 @@ -123,11 +123,14 @@
2481 include_once("./include/bottom_footer.php");
2484 - include_once("./include/top_header.php");
2487 + if (!api_plugin_hook_function('utilities_action', $_REQUEST['action'])) {
2488 + include_once('./include/top_header.php');
2490 - include_once("./include/bottom_footer.php");
2493 + include_once('./include/bottom_footer.php');
2498 @@ -1644,6 +1647,8 @@
2502 + api_plugin_hook('utilities_list');