diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-12-09 06:09:10 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-12-09 06:09:10 +0000 |
commit | b875f3061a6591de849d8c01240cefaf359d13ac (patch) | |
tree | 547ff183511859088b239a080e5e6360303f441d /usr/local/www/system.php | |
parent | 5d721fa0d83032a15862c7f390674e0a14f4f87f (diff) | |
download | pfsense-b875f3061a6591de849d8c01240cefaf359d13ac.zip pfsense-b875f3061a6591de849d8c01240cefaf359d13ac.tar.gz |
Convert the dns server code into a for loop and add 2 more dns servers on. Now we can easily control how many dns servers we want to allow entry for. Also get rid of code duplication.
Diffstat (limited to 'usr/local/www/system.php')
-rwxr-xr-x | usr/local/www/system.php | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php index 04885d6..3744d85 100755 --- a/usr/local/www/system.php +++ b/usr/local/www/system.php @@ -226,54 +226,37 @@ include("head.inc"); <?php $multiwan = false; foreach($config['interfaces'] as $int) - if($int['gateway']) + if($int['gateway']) $multiwan = true; $ints = get_interface_list(); if($multiwan) echo "<td><b>Use gateway</td>"; ?> </tr> +<?php for($dnscounter=1; $dnscounter<5; $dnscounter++): ?> <tr> - <td> - <input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"> + <td> + <input name="dns{$dnscounter}" type="text" class="formfld unknown" id="dns{$dnscounter}" size="20" value="<?=htmlspecialchars($pconfig['dns{$dnscounter}']);?>"> </td> <?php - $ints = get_interface_list(); if($multiwan) { - echo "<td><select name='dns1gwint'>\n"; - echo "<option></option>"; + echo "<td><select name='dns{$dnscounter}gwint'>\n"; + echo "<option value=''>wan</option>"; foreach($ints as $int) { $friendly = $int['friendly']; - if($config['interfaces'][$friendly]['gateway']) { + if($config['interfaces'][$friendly]['gateway']) { $selected = ""; - if($pconfig['dns1gwint'] == $int) + if($pconfig['dns{$dnscounter}gwint'] == $int) $selected = " SELECTED"; echo "<option value='{$friendly}'{$selected}>{$friendly}</option>"; } } echo "</select>"; } - ?></td></tr> - <tr><td> - <input name="dns2" type="text" class="formfld unknown" id="dns22" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"> - </td> - <?php - if($multiwan) { - echo "<td><select name='dns2gwint'>\n"; - echo "<option></option>"; - foreach($ints as $int) { - $friendly = $int['friendly']; - if($config['interfaces'][$friendly]['gateway']) { - $selected = ""; - if($pconfig['dns2gwint'] == $int) - $selected = " SELECTED"; - echo "<option value='{$friendly}'{$selected}>{$friendly}</option>"; - } - } - echo "</select></td>"; - } ?> + </td> </tr> +<?php endfor; ?> </table> <br> <span class="vexpl">IP addresses; these are also used for |