Check for null Array and move option system to top

This commit is contained in:
Bryan Haase 2011-07-27 14:41:55 -05:00
parent 2c189c8cb1
commit f9199cd3ac

View File

@ -355,16 +355,19 @@ function login_banner_change() {
<td width="78%" class="vtable">
<?=gettext("Source"); ?>:&nbsp;&nbsp;
<select name="user_source" class="formselect" id="user_source">
<?
foreach ($config['system']['authserver'] as $authcfg) {
if ($authcfg['type'] == 'ldap') {
$selected = "";
if ($pconfig['user_source'] == $authcfg['name']) $selected = "selected";
print '<option value="'.$authcfg['name'].'" '. $selected.'>'.$authcfg['name'].'</option>';
}
}
?>
<option value="system" <?php if ($pconfig['user_source'] == 'system') echo "selected"; ?>><?=gettext("system"); ?></option>
<?
if (isset($config['system']['authserver']))
{
foreach ($config['system']['authserver'] as $authcfg) {
if ($authcfg['type'] == 'ldap') {
$selected = "";
if ($pconfig['user_source'] == $authcfg['name']) $selected = "selected";
print '<option value="'.$authcfg['name'].'" '. $selected.'>'.$authcfg['name'].'</option>';
}
}
}
?>
</select>
</td>
</tr>