summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-05-21 13:45:24 -0400
committerjim-p <jimp@pfsense.org>2010-05-21 13:45:24 -0400
commitde792e62e30ac90d0d5d96f119681c86836a366f (patch)
treeac9bbcf41db0f1894240eb982e5331d74a755e80 /usr/local/www/services_dhcp.php
parent6d1af0e9d8e4398f71a572bb1cf2b4174ac5503b (diff)
downloadpfsense-de792e62e30ac90d0d5d96f119681c86836a366f.zip
pfsense-de792e62e30ac90d0d5d96f119681c86836a366f.tar.gz
Fix whitespace while I'm here.
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-xusr/local/www/services_dhcp.php666
1 files changed, 326 insertions, 340 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index 0a9bb46..0bbb3bc 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -47,7 +47,7 @@ if(!$g['services_dhcp_server_enable']) {
exit;
}
-/* Fix failover DHCP problem
+/* Fix failover DHCP problem
* http://article.gmane.org/gmane.comp.security.firewalls.pfsense.support/18749
*/
ini_set("memory_limit","64M");
@@ -120,8 +120,8 @@ $iflist = get_configured_interface_with_descr();
/* set the starting interface */
if (!$if || !isset($iflist[$if])) {
foreach ($iflist as $ifent => $ifname) {
- $oc = $config['interfaces'][$ifent];
- if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
+ $oc = $config['interfaces'][$ifent];
+ if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
(!is_array($config['dhcpd'][$ifent]) && (!is_ipaddr($oc['ipaddr']))))
continue;
$if = $ifent;
@@ -133,7 +133,7 @@ if (is_array($config['dhcpd'][$if])){
if (is_array($config['dhcpd'][$if]['range'])) {
$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from'];
$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to'];
- }
+ }
$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime'];
$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime'];
$pconfig['gateway'] = $config['dhcpd'][$if]['gateway'];
@@ -156,8 +156,8 @@ if (is_array($config['dhcpd'][$if])){
$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
$pconfig['netmask'] = $config['dhcpd'][$if]['netmask'];
$pconfig['numberoptions'] = $config['dhcpd'][$if]['numberoptions'];
- if (!is_array($config['dhcpd'][$if]['staticmap']))
- $config['dhcpd'][$if]['staticmap'] = array();
+ if (!is_array($config['dhcpd'][$if]['staticmap']))
+ $config['dhcpd'][$if]['staticmap'] = array();
$a_maps = &$config['dhcpd'][$if]['staticmap'];
}
@@ -165,7 +165,7 @@ $ifcfgip = get_interface_ip($if);
$ifcfgsn = get_interface_subnet($if);
/* set the enabled flag which will tell us if DHCP relay is enabled
- * on any interface. We will use this to disable DHCP server since
+ * on any interface. We will use this to disable DHCP server since
* the two are not compatible with each other.
*/
@@ -211,31 +211,31 @@ if ($_POST) {
$reqdfieldsn = explode(",", "Range begin,Range end");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['range_from'] && !is_ipaddr($_POST['range_from'])))
+
+ if (($_POST['range_from'] && !is_ipaddr($_POST['range_from'])))
$input_errors[] = "A valid range must be specified.";
- if (($_POST['range_to'] && !is_ipaddr($_POST['range_to'])))
+ if (($_POST['range_to'] && !is_ipaddr($_POST['range_to'])))
$input_errors[] = "A valid range must be specified.";
- if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
+ if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
$input_errors[] = "A valid IP address must be specified for the gateway.";
- if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2'])))
+ if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2'])))
$input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers.";
- if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])))
+ if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])))
$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers.";
- if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
+ if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
$input_errors[] = "The default lease time must be at least 60 seconds.";
- if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
+ if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
$input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
- if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
+ if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
$input_errors[] = "A valid domain name must be specified for the dynamic DNS registration.";
- if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2'])))
+ if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2'])))
$input_errors[] = "A valid IP address must be specified for the primary/secondary NTP servers.";
if (($_POST['domain'] && !is_domain($_POST['domain'])))
$input_errors[] = "A valid domain name must be specified for the DNS domain.";
if (($_POST['tftp'] && (!is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp']))))
$input_errors[] = "A valid IP address or hostname must be specified for the TFTP server.";
- if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver'])))
+ if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver'])))
$input_errors[] = "A valid IP address must be specified for the network boot server.";
if(gen_subnet($ifcfgip, $ifcfgsn) == $_POST['range_from'])
@@ -246,8 +246,8 @@ if ($_POST) {
// Disallow a range that includes the virtualip
if (is_array($config['virtualip']['vip'])) {
foreach($config['virtualip']['vip'] as $vip) {
- if($vip['interface'] == $if)
- if($vip['subnet'] && is_inrange($vip['subnet'], $_POST['range_from'], $_POST['range_to']))
+ if($vip['interface'] == $if)
+ if($vip['subnet'] && is_inrange($vip['subnet'], $_POST['range_from'], $_POST['range_to']))
$input_errors[] = "The subnet range cannot overlap with virtual IP address {$vip['subnet']}.";
}
}
@@ -283,7 +283,7 @@ if ($_POST) {
$config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
$config['dhcpd'][$if]['netmask'] = $_POST['netmask'];
$previous = $config['dhcpd'][$if]['failover_peerip'];
- if($previous <> $_POST['failover_peerip'])
+ if($previous <> $_POST['failover_peerip'])
mwexec("/bin/rm -rf /var/dhcpd/var/db/*");
$config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
@@ -346,12 +346,12 @@ if ($_POST) {
if ($retvaldns == 0) {
clear_subsystem_dirty('hosts');
clear_subsystem_dirty('staticmaps');
- }
+ }
} else {
- $retvaldhcp = services_dhcpd_configure();
+ $retvaldhcp = services_dhcpd_configure();
if ($retvaldhcp == 0)
clear_subsystem_dirty('staticmaps');
- }
+ }
if($retvaldhcp == 1 || $retvaldns == 1)
$retval = 1;
$savemsg = get_std_save_message($retval);
@@ -461,10 +461,10 @@ include("head.inc");
<form action="services_dhcp.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php
+<?php
if ($dhcrelay_enabled) {
- echo "DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.";
- include("fend.inc");
+ echo "DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.";
+ include("fend.inc");
echo "</body>";
echo "</html>";
exit;
@@ -474,15 +474,15 @@ include("head.inc");
<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
- <?php
+<tr><td>
+<?php
/* active tabs */
$tab_array = array();
$tabscounter = 0;
$i = 0;
foreach ($iflist as $ifent => $ifname) {
- $oc = $config['interfaces'][$ifent];
- if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
+ $oc = $config['interfaces'][$ifent];
+ if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
(!is_array($config['dhcpd'][$ifent]) && (!is_ipaddr($oc['ipaddr']))))
continue;
if ($ifent == $if)
@@ -500,189 +500,181 @@ include("head.inc");
exit;
}
display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
+?>
+</td></tr>
+<tr>
+<td>
<div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
- <strong>Enable DHCP server on
- <?=htmlspecialchars($iflist[$if]);?>
- interface</strong></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
- <strong>Deny unknown clients</strong><br>
- If this is checked, only the clients defined below will get DHCP leases from this server. </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet</td>
- <td width="78%" class="vtable">
- <?=gen_subnet($ifcfgip, $ifcfgsn);?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet mask</td>
- <td width="78%" class="vtable">
- <?=gen_subnet_mask($ifcfgsn);?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Available range</td>
- <td width="78%" class="vtable">
- <?php
- $range_from = ip2long(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
- $range_from++;
- echo long2ip32($range_from);
- ?>
- -
- <?php
- $range_to = ip2long(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
- $range_to--;
- echo long2ip32($range_to);
- ?>
- </td>
- </tr>
- <?php if($is_olsr_enabled): ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet Mask</td>
- <td width="78%" class="vtable">
- <select name="netmask" class="formselect" id="netmask">
- <?php
- for ($i = 32; $i > 0; $i--) {
- if($i <> 31) {
- echo "<option value=\"{$i}\" ";
- if ($i == $pconfig['netmask']) echo "selected";
- echo ">" . $i . "</option>";
- }
- }
- ?>
- </select>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Range</td>
- <td width="78%" class="vtable">
- <input name="range_from" type="text" class="formfld unknown" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
- &nbsp;to&nbsp; <input name="range_to" type="text" class="formfld unknown" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">WINS servers</td>
- <td width="78%" class="vtable">
- <input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
- <input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">DNS servers</td>
- <td width="78%" class="vtable">
- <input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
- <input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
- NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Gateway</td>
- <td width="78%" class="vtable">
- <input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
- The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Domain name</td>
- <td width="78%" class="vtable">
- <input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
- The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Domain search list</td>
- <td width="78%" class="vtable">
- <input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
- The DHCP server can optionally provide a domain search list.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Default lease time</td>
- <td width="78%" class="vtable">
- <input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
- seconds<br>
- This is used for clients that do not ask for a specific
- expiration time.<br>
- The default is 7200 seconds.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Maximum lease time</td>
- <td width="78%" class="vtable">
- <input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
- seconds<br>
- This is the maximum lease time for clients that ask
- for a specific expiration time.<br>
- The default is 86400 seconds.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Failover peer IP:</td>
- <td width="78%" class="vtable">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vtable">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
+ <strong>Enable DHCP server on
+ <?=htmlspecialchars($iflist[$if]);?>
+ interface</strong></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
+ <strong>Deny unknown clients</strong><br>
+ If this is checked, only the clients defined below will get DHCP leases from this server. </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet</td>
+ <td width="78%" class="vtable">
+ <?=gen_subnet($ifcfgip, $ifcfgsn);?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet mask</td>
+ <td width="78%" class="vtable">
+ <?=gen_subnet_mask($ifcfgsn);?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Available range</td>
+ <td width="78%" class="vtable">
+ <?php
+ $range_from = ip2long(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
+ $range_from++;
+ echo long2ip32($range_from);
+ ?>
+ -
+ <?php
+ $range_to = ip2long(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
+ $range_to--;
+ echo long2ip32($range_to);
+ ?>
+ </td>
+ </tr>
+ <?php if($is_olsr_enabled): ?>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet Mask</td>
+ <td width="78%" class="vtable">
+ <select name="netmask" class="formselect" id="netmask">
+ <?php
+ for ($i = 32; $i > 0; $i--) {
+ if($i <> 31) {
+ echo "<option value=\"{$i}\" ";
+ if ($i == $pconfig['netmask']) echo "selected";
+ echo ">" . $i . "</option>";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Range</td>
+ <td width="78%" class="vtable">
+ <input name="range_from" type="text" class="formfld unknown" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
+ &nbsp;to&nbsp; <input name="range_to" type="text" class="formfld unknown" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">WINS servers</td>
+ <td width="78%" class="vtable">
+ <input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
+ <input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">DNS servers</td>
+ <td width="78%" class="vtable">
+ <input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
+ <input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
+ NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Gateway</td>
+ <td width="78%" class="vtable">
+ <input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
+ The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Domain name</td>
+ <td width="78%" class="vtable">
+ <input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
+ The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Domain search list</td>
+ <td width="78%" class="vtable">
+ <input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
+ The DHCP server can optionally provide a domain search list.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Default lease time</td>
+ <td width="78%" class="vtable">
+ <input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
+ seconds<br>
+ This is used for clients that do not ask for a specific
+ expiration time.<br>
+ The default is 7200 seconds.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Maximum lease time</td>
+ <td width="78%" class="vtable">
+ <input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
+ seconds<br>
+ This is the maximum lease time for clients that ask
+ for a specific expiration time.<br>
+ The default is 86400 seconds.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Failover peer IP:</td>
+ <td width="78%" class="vtable">
<input name="failover_peerip" type="text" class="formfld host" id="failover_peerip" size="20" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP.
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">
- Static ARP
- </td>
- <td width="78%" class="vtable">
- <table>
- <tr>
- <td>
- <input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>&nbsp;
- </td>
- <td>
- <b>Enable Static ARP entries</b>
- </td>
- </tr>
- <tr>
- <td>
- &nbsp;
- </td>
- <td>
- <span class="red"><strong>Note:</strong></span> Only the machines listed below will be able to communicate with the firewall on this NIC.
- </td>
- </tr>
- </table>
- </td>
+ <td width="22%" valign="top" class="vncell">Static ARP</td>
+ <td width="78%" class="vtable">
+ <table>
+ <tr>
+ <td>
+ <input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>&nbsp;
+ </td>
+ <td><b>Enable Static ARP entries</b></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <span class="red"><strong>Note:</strong></span> Only the machines listed below will be able to communicate with the firewall on this NIC.
+ </td>
+ </tr>
+ </table>
+ </td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">
- Dynamic DNS
- </td>
- <td width="78%" class="vtable">
- <div id="showddnsbox">
- <input type="button" onClick="show_ddns_config()" value="Advanced"></input> - Show Dynamic DNS</a>
- </div>
- <div id="showddns" style="display:none">
- <input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
- <b>Enable registration of DHCP client names in DNS.</b><br />
- <p>
- <input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
- Note: Leave blank to disable dynamic DNS registration.<br />
- Enter the dynamic DNS domain which will be used to register client names in the DNS server.
- </div>
- </td>
- </tr>
+ <td width="22%" valign="top" class="vncell">Dynamic DNS</td>
+ <td width="78%" class="vtable">
+ <div id="showddnsbox">
+ <input type="button" onClick="show_ddns_config()" value="Advanced"></input> - Show Dynamic DNS</a>
+ </div>
+ <div id="showddns" style="display:none">
+ <input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
+ <b>Enable registration of DHCP client names in DNS.</b><br />
+ <p>
+ <input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
+ Note: Leave blank to disable dynamic DNS registration.<br />
+ Enter the dynamic DNS domain which will be used to register client names in the DNS server.
+ </div>
+ </td>
+ </tr>
<tr>
- <td width="22%" valign="top" class="vncell">NTP servers</td>
- <td width="78%" class="vtable">
+ <td width="22%" valign="top" class="vncell">NTP servers</td>
+ <td width="78%" class="vtable">
<div id="showntpbox">
<input type="button" onClick="show_ntp_config()" value="Advanced"></input> - Show NTP configuration</a>
</div>
@@ -693,102 +685,96 @@ include("head.inc");
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">
- TFTP server
- </td>
- <td width="78%" class="vtable">
- <div id="showtftpbox">
- <input type="button" onClick="show_tftp_config()" value="Advanced"></input> - Show TFTP configuration</a>
- </div>
- <div id="showtftp" style="display:none">
- <input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
- Leave blank to disable. Enter a full hostname or IP for the TFTP server.
- </div>
+ <td width="22%" valign="top" class="vncell">TFTP server</td>
+ <td width="78%" class="vtable">
+ <div id="showtftpbox">
+ <input type="button" onClick="show_tftp_config()" value="Advanced"></input> - Show TFTP configuration</a>
+ </div>
+ <div id="showtftp" style="display:none">
+ <input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
+ Leave blank to disable. Enter a full hostname or IP for the TFTP server.
+ </div>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">LDAP URI</td>
- <td width="78%" class="vtable">
- <div id="showldapbox">
- <input type="button" onClick="show_ldap_config()" value="Advanced"></input> - Show LDAP configuration</a>
- </div>
- <div id="showldap" style="display:none">
- <input name="ldap" type="text" class="formfld unknown" id="ldap" size="80" value="<?=htmlspecialchars($pconfig['ldap']);?>"><br>
- Leave blank to disable. Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com
- </div>
- </td>
+ <td width="22%" valign="top" class="vncell">LDAP URI</td>
+ <td width="78%" class="vtable">
+ <div id="showldapbox">
+ <input type="button" onClick="show_ldap_config()" value="Advanced"></input> - Show LDAP configuration</a>
+ </div>
+ <div id="showldap" style="display:none">
+ <input name="ldap" type="text" class="formfld unknown" id="ldap" size="80" value="<?=htmlspecialchars($pconfig['ldap']);?>"><br>
+ Leave blank to disable. Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com
+ </div>
+ </td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Enable network booting</td>
- <td width="78%" class="vtable">
- <div id="shownetbootbox">
- <input type="button" onClick="show_netboot_config()" value="Advanced"></input> - Show Network booting</a>
- </div>
- <div id="shownetboot" style="display:none">
- <input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
- <b>Enables network booting.</b>
- <p>
- Enter the IP of the <b>next-server</b>
- <input name="nextserver" type="text" class="formfld unknown" id="nextserver" size="20" value="<?=htmlspecialchars($pconfig['nextserver']);?>">
- and the filename
- <input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
- Note: You need both a filename and a boot server configured for this to work!
- <p>
- Enter the <b>root-path</b>-string
- <input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
- Note: string-format: iscsi:(servername):(protocol):(port):(LUN):targetname
- </div>
+ <td width="22%" valign="top" class="vncell">Enable network booting</td>
+ <td width="78%" class="vtable">
+ <div id="shownetbootbox">
+ <input type="button" onClick="show_netboot_config()" value="Advanced"></input> - Show Network booting</a>
+ </div>
+ <div id="shownetboot" style="display:none">
+ <input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
+ <b>Enables network booting.</b>
+ <p>
+ Enter the IP of the <b>next-server</b>
+ <input name="nextserver" type="text" class="formfld unknown" id="nextserver" size="20" value="<?=htmlspecialchars($pconfig['nextserver']);?>">
+ and the filename
+ <input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
+ Note: You need both a filename and a boot server configured for this to work!
+ <p>
+ Enter the <b>root-path</b>-string
+ <input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
+ Note: string-format: iscsi:(servername):(protocol):(port):(LUN):targetname
+ </div>
</td>
</tr>
<tr>
-
-
- <td width="22%" valign="top" class="vncell">
- Additional BOOTP/DHCP Options
- </td>
- <td width="78%" class="vtable">
- <div id="shownumbervaluebox">
- <input type="button" onClick="show_shownumbervalue()" value="Advanced"></input> - Show Additional BOOTP/DHCP Options</a>
+ <td width="22%" valign="top" class="vncell">Additional BOOTP/DHCP Options</td>
+ <td width="78%" class="vtable">
+ <div id="shownumbervaluebox">
+ <input type="button" onClick="show_shownumbervalue()" value="Advanced"></input> - Show Additional BOOTP/DHCP Options</a>
+ </div>
+ <div id="shownumbervalue" style="display:none">
+ <table id="maintable">
+ <tbody>
+ <tr>
+ <td colspan="3">
+ <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">
+ Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information. For a list of available options please visit this <a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_new">URL</a>.
</div>
- <div id="shownumbervalue" style="display:none">
- <table id="maintable">
- <tbody>
- <tr>
- <td colspan="3">
- <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">
- Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information. For a list of available options please visit this <a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_new">URL</a>.
- </div>
- </td>
- </tr>
- <tr>
- <td><div id="onecolumn">Number</div></td>
- <td><div id="twocolumn">Value</div></td>
- </tr>
+ </td>
+ </tr>
+ <tr>
+ <td><div id="onecolumn">Number</div></td>
+ <td><div id="twocolumn">Value</div></td>
+ </tr>
<?php $counter = 0; ?>
- <?php
+ <?php
if($pconfig['numberoptions'])
- foreach($pconfig['numberoptions']['item'] as $item):
+ foreach($pconfig['numberoptions']['item'] as $item):
?>
<?php
$number = $item['number'];
$value = $item['value'];
?>
- <tr>
- <td>
- <input autocomplete="off" name="number<?php echo $counter; ?>" type="text" class="formfld" id="number<?php echo $counter; ?>" size="10" value="<?=htmlspecialchars($number);?>" />
- </td>
- <td>
- <input autocomplete="off" name="value<?php echo $counter; ?>" type="text" class="formfld" id="value<?php echo $counter; ?>" size="55" value="<?=htmlspecialchars($value);?>" />
- </td>
- <td>
- <input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete" />
- </td>
- </tr>
+ <tr>
+ <td>
+ <input autocomplete="off" name="number<?php echo $counter; ?>" type="text" class="formfld" id="number<?php echo $counter; ?>" size="10" value="<?=htmlspecialchars($number);?>" />
+ </td>
+ <td>
+ <input autocomplete="off" name="value<?php echo $counter; ?>" type="text" class="formfld" id="value<?php echo $counter; ?>" size="55" value="<?=htmlspecialchars($value);?>" />
+ </td>
+ <td>
+ <input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete" />
+ </td>
+ </tr>
<?php $counter++; ?>
<?php endforeach; ?>
- </tbody>
- <tfoot>
- </tfoot>
+ </tbody>
+ <tfoot>
+ </tfoot>
</table>
<a onclick="javascript:addRowTo('maintable', 'formfldalias'); return false;" href="#">
<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
@@ -803,25 +789,25 @@ include("head.inc");
</td>
</tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="if" type="hidden" value="<?=$if;?>">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
- </td>
- </tr>
<tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>The DNS servers entered in <a href="system.php">System:
- General setup</a> (or the <a href="services_dnsmasq.php">DNS
- forwarder</a>, if enabled) </span><span class="vexpl">will
- be assigned to clients by the DHCP server.<br>
- <br>
- The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Status:
- DHCP leases</a> page.<br>
- </span></p>
- </td>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="if" type="hidden" value="<?=$if;?>">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
+ </strong></span>The DNS servers entered in <a href="system.php">System:
+ General setup</a> (or the <a href="services_dnsmasq.php">DNS
+ forwarder</a>, if enabled) </span><span class="vexpl">will
+ be assigned to clients by the DHCP server.<br>
+ <br>
+ The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Status:
+ DHCP leases</a> page.<br>
+ </span></p>
+ </td>
</tr>
</table>
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -832,56 +818,56 @@ include("head.inc");
<td width="30%" class="listhdr">Description</td>
<td width="10%" class="list">
<table border="0" cellspacing="0" cellpadding="1">
- <tr>
+ <tr>
<td valign="middle" width="17"></td>
<td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
</tr>
- <?php if(is_array($a_maps)): ?>
- <?php $i = 0; foreach ($a_maps as $mapent): ?>
- <?php if($mapent['mac'] <> "" or $mapent['ipaddr'] <> ""): ?>
- <tr>
- <td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['mac']);?>
- </td>
- <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['ipaddr']);?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['hostname']);?>&nbsp;
- </td>
- <td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['descr']);?>&nbsp;
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
+ <?php if(is_array($a_maps)): ?>
+ <?php $i = 0; foreach ($a_maps as $mapent): ?>
+ <?php if($mapent['mac'] <> "" or $mapent['ipaddr'] <> ""): ?>
+ <tr>
+ <td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['mac']);?>
+ </td>
+ <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['ipaddr']);?>&nbsp;
+ </td>
+ <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['hostname']);?>&nbsp;
+ </td>
+ <td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['descr']);?>&nbsp;
+ </td>
+ <td valign="middle" nowrap class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
+ <td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
<?php endif; ?>
<?php $i++; endforeach; ?>
<?php endif; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
+ <tr>
+ <td class="list" colspan="4"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
<td valign="middle" width="17"></td>
- <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
+ <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
</div>
- </td>
- </tr>
+</td>
+</tr>
</table>
</form>
<script language="JavaScript">
OpenPOWER on IntegriCloud