cacti 0.8.3a Out

Important information about Cacti developments that all users should be interested in.

Moderators: Moderators, Developers

Post Reply
Author
Message
raX
Lead Developer
Posts: 2237
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

cacti 0.8.3a Out

#1 Post by raX » Sat Aug 30, 2003 12:28 am

I thought I could get away without releasing an "a" release for this version, I guess not ;-). I fixed a few critical issues, one only affecting win32/IIS users and the second breaking graph permissions for everyone. Sorry about any problems these bugs may have caused anyone. Anyhow, the 0.8.3 -> 0.8.3a diff and changelog are below.

Code: Select all

diff -ru cacti-0.8.3a/docs/CHANGELOG cacti-0.8.3/docs/CHANGELOG
--- cacti-0.8.3a/docs/CHANGELOG	2003-08-30 01:13:51.000000000 -0400
+++ cacti-0.8.3/docs/CHANGELOG	2003-08-29 00:45:36.000000000 -0400
@@ -1,10 +1,5 @@
 raXnet - cacti
 
-0.8.3a
--bug#81: Partial/complete poller cache rebuild failure after an upgrade.
--bug#82: Undefined variable error messages under win32/IIS.
--bug: Problems with overlapping graph permissions with multiple users. 
-
 0.8.3
 -bug#50: When viewing a graph, only display it for the RRAs used on the graph.
 -bug#66: Users can see a list of all hosts in graph preview mode.
diff -ru cacti-0.8.3a/graph_view.php cacti-0.8.3/graph_view.php
--- cacti-0.8.3a/graph_view.php	2003-08-30 01:13:52.000000000 -0400
+++ cacti-0.8.3/graph_view.php	2003-08-29 00:45:37.000000000 -0400
@@ -38,8 +38,8 @@
 	}
 }
 
-if (ereg("action=(tree|preview|list)", get_browser_query_string())) {
-	$_SESSION["sess_graph_view_url_cache"] = get_browser_query_string();
+if (ereg("action=(tree|preview|list)", $_SERVER["REQUEST_URI"])) {
+	$_SESSION["sess_graph_view_url_cache"] = $_SERVER["REQUEST_URI"];
 }
 
 /* set default action */
@@ -137,7 +137,7 @@
 		
 		$sql_join = "left join host on host.id=graph_local.host_id
 			left join graph_templates on graph_templates.id=graph_local.graph_template_id
-			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
+			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")";
 	}
 	
 	/* the user select a bunch of graphs of the 'list' view and wants them dsplayed here */
@@ -297,7 +297,7 @@
 			from graph_templates_graph,graph_local
 			left join host on host.id=graph_local.host_id
 			left join graph_templates on graph_templates.id=graph_local.graph_template_id
-			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
+			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")
 			where graph_templates_graph.local_graph_id=graph_local.id
 			and graph_templates_graph.local_graph_id>0
 			" . (empty($sql_where) ? "" : "and $sql_where") . "
diff -ru cacti-0.8.3a/include/config.php cacti-0.8.3/include/config.php
--- cacti-0.8.3a/include/config.php	2003-08-30 01:13:52.000000000 -0400
+++ cacti-0.8.3/include/config.php	2003-08-29 00:45:38.000000000 -0400
@@ -67,6 +67,6 @@
 include_once($config["include_path"] . "/database.php");
 
 /* current cacti version */
-$config["cacti_version"] = "0.8.3a";
+$config["cacti_version"] = "0.8.3";
 
 ?>
diff -ru cacti-0.8.3a/include/functions.php cacti-0.8.3/include/functions.php
--- cacti-0.8.3a/include/functions.php	2003-08-30 01:13:52.000000000 -0400
+++ cacti-0.8.3/include/functions.php	2003-08-29 00:45:37.000000000 -0400
@@ -1029,7 +1029,7 @@
 		from graph_templates_graph,graph_local
 		left join host on host.id=graph_local.host_id
 		left join graph_templates on graph_templates.id=graph_local.graph_template_id
-		left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
+		left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")
 		where graph_templates_graph.local_graph_id=graph_local.id
 		" . (empty($sql_where) ? "" : "and $sql_where") . "
 		and graph_templates_graph.local_graph_id=$local_graph_id
@@ -1250,7 +1250,7 @@
 	}
 	
 	/* keep a cache for each level we encounter */
-	$nav_level_cache{$current_array["level"]} = array("id" => $current_page . ":" . $current_action, "url" => get_browser_query_string());
+	$nav_level_cache{$current_array["level"]} = array("id" => $current_page . ":" . $current_action, "url" => $_SERVER["REQUEST_URI"]);
 	$_SESSION["sess_nav_level_cache"] = $nav_level_cache;
 	
 	print $current_nav;
@@ -1287,14 +1287,4 @@
 		order by rra.timespan");
 }
 
-/* get_browser_query_string - returns the full url, including args requested by the browser
-   @returns - the url requested by the browser */
-function get_browser_query_string() {
-	if (isset($_SERVER["REQUEST_URI"])) {
-		return $_SERVER["REQUEST_URI"];
-	}else{
-		return $_SERVER["PHP_SELF"] . (empty($_SERVER["QUERY_STRING"]) ? "" : "?" . $_SERVER["QUERY_STRING"]);
-	}
-}
-
 ?>
diff -ru cacti-0.8.3a/include/tree_view_functions.php cacti-0.8.3/include/tree_view_functions.php
--- cacti-0.8.3a/include/tree_view_functions.php	2003-08-30 01:13:52.000000000 -0400
+++ cacti-0.8.3/include/tree_view_functions.php	2003-08-29 00:45:37.000000000 -0400
@@ -49,7 +49,7 @@
 		$sql_where = (empty($sql_where) ? "" : "and (" . $sql_where . " OR graph_tree_items.local_graph_id=0)");
 		$sql_join = "left join graph_local on graph_templates_graph.local_graph_id=graph_local.id
 			left join graph_templates on graph_templates.id=graph_local.graph_template_id
-			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
+			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")";
 	}
 	
 	$heirarchy = db_fetch_assoc("select
@@ -359,7 +359,7 @@
 		$sql_join = "left join graph_local on graph_templates_graph.local_graph_id=graph_local.id
 			left join host on host.id=graph_local.host_id
 			left join graph_templates on graph_templates.id=graph_local.graph_template_id
-			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))";
+			left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")";
 	}
 	
 	/* get information for the headers */
diff -ru cacti-0.8.3a/install/index.php cacti-0.8.3/install/index.php
--- cacti-0.8.3a/install/index.php	2003-08-30 01:13:52.000000000 -0400
+++ cacti-0.8.3/install/index.php	2003-08-29 00:45:37.000000000 -0400
@@ -33,7 +33,7 @@
 include ("../include/config.php");
 include ("../include/config_settings.php");
 
-$cacti_versions = array("0.8", "0.8.1", "0.8.2", "0.8.2a", "0.8.3", "0.8.3a");
+$cacti_versions = array("0.8", "0.8.1", "0.8.2", "0.8.2a", "0.8.3");
 
 $old_cacti_version = db_fetch_cell("select cacti from version");
 
@@ -205,9 +205,6 @@
 	
 	setcookie(session_name(),"",time() - 3600,"/");
 	
-	kill_session_var("sess_config_array");
-	kill_session_var("sess_host_cache_array");
-	
 	/* just in case we have hard drive graphs to deal with */
 	data_query(db_fetch_cell("select id from host where management_ip='127.0.0.1'"), 6);
 	
@@ -403,26 +400,22 @@
 						$fail_text = "<span style='color: red; font-weight: bold; font-size: 12px;'>[Fail]</span>&";
 						$success_text = "<span style='color: green; font-weight: bold; font-size: 12px;'>[Success]</span>&";
 						
-						if (isset($_SESSION["sess_sql_install_cache"])) {
-							while (list($index, $arr1) = each($_SESSION["sess_sql_install_cache"])) {
-								while (list($version, $arr2) = each($arr1)) {
-									while (list($status, $sql) = each($arr2)) {
-										if ($current_version != $version) {
-											$version_index = array_search($version, $cacti_versions);
-											print "<p><strong>" . $cacti_versions{$version_index-1}  . " -> " . $cacti_versions{$version_index} . "</strong></p>\n";
-										}
-										
-										print "<p class='code'>" . (($status == 0) ? $fail_text : $success_text) . nl2br($sql) . "</p>\n";
-										
-										$current_version = $version;
+						while (list($index, $arr1) = each($_SESSION["sess_sql_install_cache"])) {
+							while (list($version, $arr2) = each($arr1)) {
+								while (list($status, $sql) = each($arr2)) {
+									if ($current_version != $version) {
+										$version_index = array_search($version, $cacti_versions);
+										print "<p><strong>" . $cacti_versions{$version_index-1}  . " -> " . $cacti_versions{$version_index} . "</strong></p>\n";
 									}
+									
+									print "<p class='code'>" . (($status == 0) ? $fail_text : $success_text) . nl2br($sql) . "</p>\n";
+									
+									$current_version = $version;
 								}
 							}
-						
-							kill_session_var("sess_sql_install_cache");
-						}else{
-							print "<em>No SQL queries have been executed.</em>";
 						}
+						
+						kill_session_var("sess_sql_install_cache");
 						?>
 						
 						<?php }?>

Code: Select all

-bug#81: Partial/complete poller cache rebuild failure after an upgrade.
-bug#82: Undefined variable error messages under win32/IIS.
-bug: Problems with overlapping graph permissions with multiple users.
-Ian
Last edited by raX on Mon Sep 01, 2003 12:12 pm, edited 1 time in total.

User avatar
TFC
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

#2 Post by TFC » Mon Sep 01, 2003 6:18 am

Can u tell us which page and which code change?
I prefer cahnge code instead of upgrade. Due to I am newbie..

raX
Lead Developer
Posts: 2237
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

#3 Post by raX » Mon Sep 01, 2003 12:18 pm

My diff/patch skills aren't so hot, I redid the diff in unified format which patch seems to like better. You can find the new diff here:

http://www.raxnet.net/downloads/patches ... .8.3a.diff

Download it to your Cacti 0.8.3 directory and run:

Code: Select all

patch -p1 < cacti-0.8.3-to-cacti-0.8.3a.diff
-Ian

User avatar
TFC
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

#4 Post by TFC » Tue Sep 02, 2003 2:48 am

He he he
god save Linus and Linux masters.
I am newbie of linux and cacti but when I learn linux I shocked. Linux is very simple and useful OS :D

Post Reply