[Fusionforge-commits] r16016 - trunk/src/common/include

Olivier Berger olberger at fusionforge.org
Thu Jul 19 15:49:07 CEST 2012


Author: olberger
Date: 2012-07-19 15:49:06 +0200 (Thu, 19 Jul 2012)
New Revision: 16016

Modified:
   trunk/src/common/include/account.php
Log:
Properly select default value if the value in DB doesn't match .../etc/shells

Modified: trunk/src/common/include/account.php
===================================================================
--- trunk/src/common/include/account.php	2012-07-19 13:48:59 UTC (rev 16015)
+++ trunk/src/common/include/account.php	2012-07-19 13:49:06 UTC (rev 16016)
@@ -264,7 +264,12 @@
                         $found = true;
                         $html .= "<option selected=\"selected\" value=\"$this_shell\">$this_shell</option>\n";
                 } else {
-			$html .= "<option value=\"$this_shell\">$this_shell</option>\n";
+			// the last one is supposed to be the default, so select it if not found current shell to observe default settings
+			if ( ($i == (count($shells) - 1)) && (! $found)) {
+				$html .= "<option selected=\"selected\" value=\"$this_shell\">$this_shell</option>\n";
+			} else {
+				$html .= "<option value=\"$this_shell\">$this_shell</option>\n";
+			}
                 }
         }
         if(! $found) {




More information about the Fusionforge-commits mailing list