[Fusionforge-commits] r9056 - in trunk/gforge: common/include www/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Mar 15 14:01:56 CET 2010


Author: lolando
Date: 2010-03-15 14:01:55 +0100 (Mon, 15 Mar 2010)
New Revision: 9056

Modified:
   trunk/gforge/common/include/Navigation.class.php
   trunk/gforge/common/include/config.php
   trunk/gforge/www/include/pre.php
Log:
Added config item registration, with default values

Modified: trunk/gforge/common/include/Navigation.class.php
===================================================================
--- trunk/gforge/common/include/Navigation.class.php	2010-03-15 13:01:46 UTC (rev 9055)
+++ trunk/gforge/common/include/Navigation.class.php	2010-03-15 13:01:55 UTC (rev 9056)
@@ -201,7 +201,7 @@
                         $res['titles'][] = _('Log In');
                         $res['urls'][] = util_make_url($url);
                         
-                        if (!$GLOBALS['sys_user_reg_restricted']) {
+                        if (!get_config ('core', 'user_registration_restricted')) {
                                 $res['titles'][] = _('New Account');
                                 $res['urls'][] = util_make_url('/account/register.php');
                         }

Modified: trunk/gforge/common/include/config.php
===================================================================
--- trunk/gforge/common/include/config.php	2010-03-15 13:01:46 UTC (rev 9055)
+++ trunk/gforge/common/include/config.php	2010-03-15 13:01:55 UTC (rev 9056)
@@ -27,15 +27,22 @@
 }
 
 function get_config ($section, $var) {
-	if (!isset ($fusionforge_config[$section])) {
+	if (!isset ($fusionforge_config[$section])
+	    || !isset ($fusionforge_config[$section][$var])) {
 		return false ;
 	}
+	
+	return $fusionforge_config[$section][$var] ;
+}
 
+function define_config_item ($section, $var, $default) {
+	if (!isset ($fusionforge_config[$section])) {
+		$fusionforge_config[$section] = array () ;
+	}
+
 	if (!isset ($fusionforge_config[$section][$var])) {
-		return false ;
+		$fusionforge_config[$section][$var] = $default ;
 	}
-
-	return $fusionforge_config[$section][$var] ;
 }
 
 function read_config_file ($file) {

Modified: trunk/gforge/www/include/pre.php
===================================================================
--- trunk/gforge/www/include/pre.php	2010-03-15 13:01:46 UTC (rev 9055)
+++ trunk/gforge/www/include/pre.php	2010-03-15 13:01:55 UTC (rev 9056)
@@ -33,6 +33,8 @@
 
 require $gfcgfile;
 require $gfcommon.'include/config.php';
+define_config_item ('core', 'forge_name', $GLOBALS['sys_name']) ;
+define_config_itme ('core', 'user_registration_restricted', $GLOBALS['sys_user_reg_restricted']) ;
 read_config ($gfconfig.'/fusionforge.ini') ;
 
 // get constants used for flags or status




More information about the Fusionforge-commits mailing list