[Fusionforge-commits] r16020 - in trunk/src: common/include www/admin

Olivier Berger olberger at fusionforge.org
Thu Jul 19 18:11:59 CEST 2012


Author: olberger
Date: 2012-07-19 18:11:58 +0200 (Thu, 19 Jul 2012)
New Revision: 16020

Modified:
   trunk/src/common/include/account.php
   trunk/src/www/admin/admin_utils.php
Log:
Oops, make sure the check is meaningful : don't add the var's value to the shells in all cases

Modified: trunk/src/common/include/account.php
===================================================================
--- trunk/src/common/include/account.php	2012-07-19 15:24:49 UTC (rev 16019)
+++ trunk/src/common/include/account.php	2012-07-19 16:11:58 UTC (rev 16020)
@@ -232,6 +232,7 @@
 		}
 		$out_shells[] = chop($s);
 	}
+	// in most cases, we do need to add the default shell in case it wouldn't be in the ../etc/shells already (no regression)
 	if ($add_user_default_shell) {
 		$user_default_shell = account_get_user_default_shell();
 		if (! file_exists($user_default_shell) ) {

Modified: trunk/src/www/admin/admin_utils.php
===================================================================
--- trunk/src/www/admin/admin_utils.php	2012-07-19 15:24:49 UTC (rev 16019)
+++ trunk/src/www/admin/admin_utils.php	2012-07-19 16:11:58 UTC (rev 16020)
@@ -41,8 +41,10 @@
 	if (!function_exists("pg_pconnect")) {
 		$result[] = 'ERROR: Missing Postgresql support in PHP, please install/compile php-pg.';
 	}
+	// verify the compatibility between the user_default_shell ini var and the contents of .../etc/shells
 	$user_default_shell = forge_get_config('user_default_shell');
-	$shells = account_getavailableshells();
+	// pass FALSE to make sure the var contents isn't added to the list
+	$shells = account_getavailableshells(FALSE);
 	if (!in_array($user_default_shell, $shells)) {
 		$result[] = 'WARNING: default user shell "'. $user_default_shell .'" not in allowed shells (check ini var "user_default_shell" and contents of '. forge_get_config('chroot') .'/etc/shells or /etc/shells).';
 	}




More information about the Fusionforge-commits mailing list