[Fusionforge-commits] r9610 - in trunk: gforge/common/include gforge/db gforge/www/include tests/code/deprecations

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Apr 27 21:21:38 CEST 2010


Author: lolando
Date: 2010-04-27 21:21:38 +0200 (Tue, 27 Apr 2010)
New Revision: 9610

Modified:
   trunk/gforge/common/include/account.php
   trunk/gforge/common/include/config-vars.php
   trunk/gforge/db/20040826_migraterbac.php
   trunk/gforge/www/include/pre.php
   trunk/gforge/www/include/squal_pre.php
   trunk/tests/code/deprecations/DeprecationsTest.php
Log:
Config API: two variables related to shell accounts

Modified: trunk/gforge/common/include/account.php
===================================================================
--- trunk/gforge/common/include/account.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/gforge/common/include/account.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -156,14 +156,14 @@
  *
  */
 function account_gensalt(){
-	global $unix_cipher;
+
 	// ncommander: modified for cipher selection
 	// crypt() selects the cipher based on
 	// the salt, so ...
 	
 	$a = genchr(); 
 	$b = genchr();
-	switch($unix_cipher) {
+	switch(forge_get_config('unix_cipher')) {
 		case 'DES':
 			$salt = "$a$b";
 			break;
@@ -193,8 +193,8 @@
 function account_genunixpw($plainpw) {
 	// ncommander: Support clear password hashing
 	// for usergroup_plain.php
-	global $unix_cipher;
-	if (strcasecmp($unix_cipher, 'Plain') == 0) {
+
+	if (strcasecmp(forge_get_config('unix_cipher'), 'Plain') == 0) {
 		return $plainpw;
 	} else {
 		return crypt($plainpw,account_gensalt());

Modified: trunk/gforge/common/include/config-vars.php
===================================================================
--- trunk/gforge/common/include/config-vars.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/gforge/common/include/config-vars.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -82,6 +82,8 @@
 forge_define_config_item ('sendmail_path', 'core', $GLOBALS['sys_sendmail_path']) ;
 forge_define_config_item ('mailman_path', 'core', $GLOBALS['sys_path_to_mailman']) ;
 forge_define_config_item ('jpgraph_path', 'core', $GLOBALS['sys_path_to_jpgraph']) ;
+forge_define_config_item ('account_manager_type', 'core', $GLOBALS['sys_account_manager_type']) ;
+forge_define_config_item ('unix_cipher', 'core', $GLOBALS['unix_cipher']) ;
 // forge_define_config_item ('', 'core', $GLOBALS['sys_']) ;
 
 /* Long-term:

Modified: trunk/gforge/db/20040826_migraterbac.php
===================================================================
--- trunk/gforge/db/20040826_migraterbac.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/gforge/db/20040826_migraterbac.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -31,11 +31,12 @@
 require_once $gfcommon.'include/System.class.php';
 // Right now the nss tables don't exist so if sys_account_manager_type=pgsql 
 // This will fail UNIX should be safe
-//if (!$sys_account_manager_type) {
+//if (!forge_get_config('account_manager_type')) {
 	$sys_account_manager_type='UNIX';
 //}
-require_once $gfcommon.'include/system/'.$sys_account_manager_type.'.class.php';
-$SYS=new $sys_account_manager_type();
+require_once $gfcommon.'include/system/'.forge_get_config('account_manager_type').'.class.php';
+$amt = forge_get_config('account_manager_type') ;
+$SYS=new $amt();
 
 require_once $gfcommon.'include/Role.class.php';
 

Modified: trunk/gforge/www/include/pre.php
===================================================================
--- trunk/gforge/www/include/pre.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/gforge/www/include/pre.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -67,11 +67,12 @@
 
 //system library
 require_once $gfcommon.'include/System.class.php';
-if (!$sys_account_manager_type) {
+if (!forge_get_config('account_manager_type')) {
 	$sys_account_manager_type='UNIX';
 }
-require_once $gfcommon.'include/system/'.$sys_account_manager_type.'.class.php';
-$SYS=new $sys_account_manager_type();
+require_once $gfcommon.'include/system/'.forge_get_config('account_manager_type').'.class.php';
+$amt = forge_get_config('account_manager_type') ;
+$SYS=new $amt();
 
 //user functions like get_name, logged_in, etc
 require_once $gfcommon.'include/User.class.php';

Modified: trunk/gforge/www/include/squal_pre.php
===================================================================
--- trunk/gforge/www/include/squal_pre.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/gforge/www/include/squal_pre.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -50,11 +50,12 @@
 
 //system library
 require_once $gfcommon.'include/System.class.php';
-if (!$sys_account_manager_type) {
+if (!forge_get_config('account_manager_type')) {
         $sys_account_manager_type='UNIX';
 }
-require_once $gfcommon.'include/system/'.$sys_account_manager_type.'.class.php';
-$SYS=new $sys_account_manager_type();
+require_once $gfcommon.'include/system/'.forge_get_config('account_manager_type').'.class.php';
+$amt = forge_get_config('account_manager_type') ;
+$SYS=new $amt();
 
 
 // #### Connect to db

Modified: trunk/tests/code/deprecations/DeprecationsTest.php
===================================================================
--- trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-27 19:14:53 UTC (rev 9609)
+++ trunk/tests/code/deprecations/DeprecationsTest.php	2010-04-27 19:21:38 UTC (rev 9610)
@@ -99,6 +99,8 @@
 			       'sys_sendmail_path',
 			       'sys_path_to_mailman',
 			       'sys_path_to_jpgraph',
+			       'sys_account_manager_type',
+			       'unix_cipher',
 			) ;
 
 		$pattern = implode ('|', $vars) ;




More information about the Fusionforge-commits mailing list