[Fusionforge-commits] r8946 - branches/Branch_5_0/gforge/www/admin

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


Author: aljeux
Date: 2010-03-04 22:42:39 +0100 (Thu, 04 Mar 2010)
New Revision: 8946

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

Modified: branches/Branch_5_0/gforge/www/admin/configman.php
===================================================================
--- branches/Branch_5_0/gforge/www/admin/configman.php	2010-03-04 21:42:13 UTC (rev 8945)
+++ branches/Branch_5_0/gforge/www/admin/configman.php	2010-03-04 21:42:39 UTC (rev 8946)
@@ -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