[Fusionforge-commits] r15050 - in trunk/src: common/include www/scm www/scm/include

Franck VILLAUME nerville at fusionforge.org
Thu Feb 2 11:29:27 CET 2012


Author: nerville
Date: 2012-02-02 11:29:26 +0100 (Thu, 02 Feb 2012)
New Revision: 15050

Modified:
   trunk/src/common/include/Navigation.class.php
   trunk/src/www/scm/include/viewvc_utils.php
   trunk/src/www/scm/viewvc.php
Log:
fix #358: revert previous hack, add new way to get projectname in uri

Modified: trunk/src/common/include/Navigation.class.php
===================================================================
--- trunk/src/common/include/Navigation.class.php	2012-02-01 13:44:08 UTC (rev 15049)
+++ trunk/src/common/include/Navigation.class.php	2012-02-02 10:29:26 UTC (rev 15050)
@@ -312,6 +312,12 @@
 		if (isset($GLOBALS['group_id'])) {
 			// get group info using the common result set
 			$project =& group_get_object($GLOBALS['group_id']);
+			if ($project == 0) {
+				if (preg_match('/root=/',$request_uri)) {
+					$project_name = preg_replace('/.*?root=/', '', $request_uri);
+					$project =& group_get_object_by_name($project_name);
+				}
+			}
 			if ($project && is_object($project)) {
 				if ($project->isError()) {
 				} elseif (!$project->isProject()) {

Modified: trunk/src/www/scm/include/viewvc_utils.php
===================================================================
--- trunk/src/www/scm/include/viewvc_utils.php	2012-02-01 13:44:08 UTC (rev 15049)
+++ trunk/src/www/scm/include/viewvc_utils.php	2012-02-02 10:29:26 UTC (rev 15050)
@@ -69,7 +69,6 @@
 function viewcvs_execute($repos_name, $repos_type) {
 	$request_uri = getStringFromServer('REQUEST_URI');
 	$query_string = getStringFromServer('QUERY_STRING');
-	$query_string = preg_replace('/group_id=[0-9]+&/','',$query_string);
 	$viewcvs_path = forge_get_config('url_root').'/scm/viewvc';
 
 	// this is very important ...

Modified: trunk/src/www/scm/viewvc.php
===================================================================
--- trunk/src/www/scm/viewvc.php	2012-02-01 13:44:08 UTC (rev 15049)
+++ trunk/src/www/scm/viewvc.php	2012-02-02 10:29:26 UTC (rev 15050)
@@ -89,7 +89,7 @@
 	$server_script = preg_replace("/^\\//", "", $server_script);
 
 	// pass the parameters passed to this script to the remote script in the same fashion
-	$script_url = "http://".$scm_box."/".$server_script.$_SERVER["PATH_INFO"]."?".preg_replace('/group_id=[0-9]+&/','',$_SERVER["QUERY_STRING"]);
+	$script_url = "http://".$scm_box."/".$server_script.$_SERVER["PATH_INFO"]."?".$_SERVER["QUERY_STRING"];
 	$fh = @fopen($script_url, "r");
 	if (!$fh) {
 		exit_error(sprintf(_('Could not open script %s.'),$script_url),'home');




More information about the Fusionforge-commits mailing list