summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-04-27 12:47:53 -0300
committerRenato Botelho <renato@netgate.com>2017-04-27 12:47:53 -0300
commit4b9807014bedda17e0f854b6c7626966bd71d0ea (patch)
treea5a9735c1f462a773314b8bf0dbb4a6f3c382443 /src/usr/local/www/services_dhcp.php
parent77da3482050b7db1a4979ba7487cfe15014881ef (diff)
downloadpfsense-4b9807014bedda17e0f854b6c7626966bd71d0ea.zip
pfsense-4b9807014bedda17e0f854b6c7626966bd71d0ea.tar.gz
Checks for DHCP Relay being enabled/disabled should be skipped when editting an additional pool
Diffstat (limited to 'src/usr/local/www/services_dhcp.php')
-rw-r--r--src/usr/local/www/services_dhcp.php34
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 92a3403..3de08c4 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -412,18 +412,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.");
+ }
}
}
OpenPOWER on IntegriCloud