diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-03-30 00:37:45 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-03-30 00:38:36 +0000 |
commit | a55e9c701c2fc8914e0aebf12e37038f59b07cf8 (patch) | |
tree | 05b5a1bc85f8742706649429ec164f576d240975 /usr/local/www/services_dhcp_edit.php | |
parent | cc460ee980e427bf4acdb8a4903e3278df59ea94 (diff) | |
download | pfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.zip pfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.tar.gz |
* Hide interfaces internals to other code and use the propper interfaces.
Basically use get_interface*() functions instead of accessing fields like 'ipaddr'/'descr' etc...
* Make get_interfaces_with_gateway less heavyweight by getting information from the configuration stored in config.xml
* Some other missed custom interface list building and substituing with propper get_configured_interface*()
NOTE: This should give indipendce on dynamic interfaces on some services that before could not be used on top of this type of interfaces.
Diffstat (limited to 'usr/local/www/services_dhcp_edit.php')
-rwxr-xr-x | usr/local/www/services_dhcp_edit.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index fb9718d..3239d05 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -62,7 +62,9 @@ $static_map_enabled=isset($config['dhcpd'][$if]['staticarp']); staticmaps_sort($if); $a_maps = &$config['dhcpd'][$if]['staticmap']; -$ifcfg = &$config['interfaces'][$if]; +$ifcfgip = get_interface_ip($if); +$ifcfgsn = get_interface_subnet($if); +$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if); $id = $_GET['id']; if (isset($_POST['id'])) @@ -121,11 +123,11 @@ if ($_POST) { if ($_POST['ipaddr']) { $dynsubnet_start = ip2long($config['dhcpd'][$if]['range']['from']); $dynsubnet_end = ip2long($config['dhcpd'][$if]['range']['to']); - $lansubnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet'])); - $lansubnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); + $lansubnet_start = (ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)); + $lansubnet_end = (ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))); if ((ip2long($_POST['ipaddr']) < $lansubnet_start) || (ip2long($_POST['ipaddr']) > $lansubnet_end)) { - $input_errors[] = "The IP address must lie in the {$ifcfg['descr']} subnet."; + $input_errors[] = "The IP address must lie in the {$ifcfgdescr} subnet."; } } |