From ce13cc5f8f661f4ef0d24e237a83d4caccea6a11 Mon Sep 17 00:00:00 2001 From: Individual IT Services Date: Tue, 13 Aug 2013 04:14:36 -0700 Subject: Fix check for existing IP Address in DHCP mapping Even the Error message says: "This Hostname, IP or MAC address already exists." the IP Address was not checked if it already was given to a client as static mapped --- usr/local/www/services_dhcp_edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr') diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 281d754..5428747 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -179,7 +179,8 @@ if ($_POST) { if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent)) continue; - if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname']) || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) { + if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname']) || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'] ) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) { + $input_errors[] = gettext("This Hostname, IP, MAC address or Client identifier already exists."); break; } -- cgit v1.1