[Fusionforge-commits] r8947 - trunk/gforge/www/admin

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Mar 4 22:43:04 CET 2010


Author: aljeux
Date: 2010-03-04 22:43:04 +0100 (Thu, 04 Mar 2010)
New Revision: 8947

Modified:
   trunk/gforge/www/admin/configman.php
Log:
Fix [#92] Config Manager 4.8.2

Modified: trunk/gforge/www/admin/configman.php
===================================================================
--- trunk/gforge/www/admin/configman.php	2010-03-04 21:42:39 UTC (rev 8946)
+++ trunk/gforge/www/admin/configman.php	2010-03-04 21:43:04 UTC (rev 8947)
@@ -34,6 +34,8 @@
 
 site_admin_header(array('title'=>_('Site admin')));
 
+$gfcgfile = get_absolute_filename($gfcgfile);
+
 /**
  * printSelection - prints the select box for the user to get the files to edit
  *
@@ -282,6 +284,28 @@
 
 site_admin_footer(array());
 
+function get_absolute_filename($filename) {
+	// Check for absolute path
+	if (realpath($filename) == $filename) {
+		return $filename;
+	}
+
+	// Otherwise, treat as relative path
+	$paths = explode(':', get_include_path());
+	foreach ($paths as $path) {
+		if (substr($path, -1) == '/') {
+			$fullpath = $path.$filename;
+		} else {
+			$fullpath = $path.'/'.$filename;
+		}
+		if (file_exists($fullpath)) {
+			return $fullpath;
+		}
+	}
+
+	return false;
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"




More information about the Fusionforge-commits mailing list