diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-11-03 21:06:48 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-11-03 21:06:48 +0000 |
commit | 48c6ab80c449620ff937e0dc4066a9fef1af4ab6 (patch) | |
tree | 609e53157cbd4822f6f905eaefee43c97c4a8885 | |
parent | 67c04e807bc7bdcd51e86f45d29f620051fad5eb (diff) | |
download | pfsense-48c6ab80c449620ff937e0dc4066a9fef1af4ab6.zip pfsense-48c6ab80c449620ff937e0dc4066a9fef1af4ab6.tar.gz |
Do not allow dhcp-relay to be enabled if dhcp server is enabled on any interface.
Ticket #1488
-rwxr-xr-x | usr/local/www/services_dhcp_relay.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index 3d798ed..eba5d39 100755 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -83,6 +83,13 @@ $pconfig['agentoption'] = isset($config['dhcrelay']['agentoption']); $ifcfg = $config['interfaces'][$if]; +/* set the enabled flag which will tell us if DHCP server is enabled + * on any interface. We will use this to disable dhcp-relay since + * the two are not compatible with each other. + */ +$dhcpd_enabled = false; +foreach($config['dhcpd'] as $dhcp) + if($dhcp['enable']) $dhcpd_enabled = true; if ($_POST) { @@ -170,6 +177,17 @@ function enable_change(enable_over) { <form action="services_dhcp_relay.php" method="post" name="iform" id="iform"> <?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($savemsg) print_info_box($savemsg); ?> + +<?php + if ($dhcpd_enabled) { + echo "DHCP Server is currently enabled. Cannot display dhcp-relay service while DHCP Server is enabled on any interface."; + include("fend.inc"); + echo "</body>"; + echo "</html>"; + exit; + } +?> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php |