diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2008-11-11 22:01:30 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2008-11-11 22:01:30 +0000 |
commit | 7922db8a40a166c8c57bdfe13769e942056de934 (patch) | |
tree | e268be764b91b7f4174b7b3fb842eb8b354b7c61 /usr/local/www | |
parent | 7d5589f56aa55a4574f4549a58ca8395193cedca (diff) | |
download | pfsense-7922db8a40a166c8c57bdfe13769e942056de934.zip pfsense-7922db8a40a166c8c57bdfe13769e942056de934.tar.gz |
Correct the broken multiwan check.
It now works properly with dynamic gateways too.
Things to do, add static routes, input validation that no gateways are assigned to dns servers on a directly connected subnet.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/system.php | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php index d48c05d..ac8a592 100755 --- a/usr/local/www/system.php +++ b/usr/local/www/system.php @@ -84,11 +84,12 @@ $timezonelist = array_filter($timezonelist, 'is_timezone'); sort($timezonelist); $multiwan = false; -foreach($config['interfaces'] as $int) - if($int['gateway']) +$interfaces = get_configured_interface_list(); +foreach($interfaces as $interface) { + if(interface_has_gateway($interface)) { $multiwan = true; - -$ints = get_interface_list(); + } +} if ($_POST) { @@ -257,23 +258,31 @@ include("head.inc"); <td> <input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="20" value="<?php echo $pconfig['dns'.$dnscounter];?>"> </td> - <?php if ($multiwan): ?> <td> <select name=<?=$fldname;?>> <?php - foreach($ints as $int): - $friendly = $int['friendly']; - if(!$config['interfaces'][$friendly]['gateway']) - continue; + if ($multiwan) { + $interface = "none"; + if($pconfig['dns{$dnscounter}gwint'] == $interface) { + $selected = "$selected"; + } else { $selected = ""; - if($pconfig['dns{$dnscounter}gwint'] == $int) - $selected = " SELECTED"; + } + print "<option value='$interface' $selected >". ucwords($interface) ."</option>\n"; + foreach($interfaces as $interface) { + if(interface_has_gateway($interface)) { + if($pconfig['dns{$dnscounter}gwint'] == $interface) { + $selected = "$selected"; + } else { + $selected = ""; + } + print "<option value='$interface' $selected >". ucwords($interface) ."</option>\n"; + } + } + } ?> - <option <?=$selected;?>><?=$friendly;?></option> - <?php endforeach; ?> </select> </td> - <?php endif; ?> </tr> <?php endfor; ?> </table> |