diff options
author | Renato Botelho <renato@netgate.com> | 2017-04-27 12:47:53 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-04-27 12:47:59 -0300 |
commit | fd7049e74db51980dd05d3e96e19221d2d122957 (patch) | |
tree | 7433f4c93db24a0b4a26e2498081a1649b1b2b49 | |
parent | 1e40bdebc1113718131c7ac56d1d393651d437a2 (diff) | |
download | pfsense-fd7049e74db51980dd05d3e96e19221d2d122957.zip pfsense-fd7049e74db51980dd05d3e96e19221d2d122957.tar.gz |
Checks for DHCP Relay being enabled/disabled should be skipped when editting an additional pool
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index a80514b..d70757d 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -449,18 +449,30 @@ if (isset($_POST['save'])) { } } - /* If enabling DHCP Server, make sure that the DHCP Relay isn't enabled on this interface */ - if ($_POST['enable'] && isset($config['dhcrelay']['enable']) && (stristr($config['dhcrelay']['interface'], $if) !== false)) { - $input_errors[] = sprintf(gettext("The DHCP relay on the %s interface must be disabled before enabling the DHCP server."), $iflist[$if]); - } - - /* If disabling DHCP Server, make sure that DHCP registration isn't enabled for DNS forwarder/resolver */ - if (!$_POST['enable']) { - if (isset($config['dnsmasq']['enable']) && (isset($config['dnsmasq']['regdhcp']) || isset($config['dnsmasq']['regdhcpstatic']) || isset($config['dnsmasq']['dhcpfirst']))) { - $input_errors[] = gettext("Disable DHCP Registration features in DNS Forwarder before disabling DHCP Server."); + if ((!isset($pool) || !is_numeric($pool)) && $act != "newpool") { + /* If enabling DHCP Server, make sure that the DHCP Relay isn't enabled on this interface */ + if ($_POST['enable'] && isset($config['dhcrelay']['enable']) && + (stristr($config['dhcrelay']['interface'], $if) !== false)) { + $input_errors[] = sprintf(gettext( + "The DHCP relay on the %s interface must be disabled before enabling the DHCP server."), + $iflist[$if]); } - if (isset($config['unbound']['enable']) && (isset($config['unbound']['regdhcp']) || isset($config['unbound']['regdhcpstatic']))) { - $input_errors[] = gettext("Disable DHCP Registration features in DNS Resolver before disabling DHCP Server."); + + /* If disabling DHCP Server, make sure that DHCP registration isn't enabled for DNS forwarder/resolver */ + if (!$_POST['enable']) { + if (isset($config['dnsmasq']['enable']) && + (isset($config['dnsmasq']['regdhcp']) || + isset($config['dnsmasq']['regdhcpstatic']) || + isset($config['dnsmasq']['dhcpfirst']))) { + $input_errors[] = gettext( + "Disable DHCP Registration features in DNS Forwarder before disabling DHCP Server."); + } + if (isset($config['unbound']['enable']) && + (isset($config['unbound']['regdhcp']) || + isset($config['unbound']['regdhcpstatic']))) { + $input_errors[] = gettext( + "Disable DHCP Registration features in DNS Resolver before disabling DHCP Server."); + } } } |