Prevent static DHCP leases from having duplicate hostnames

Fixes #979

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2019-07-09 20:35:15 -07:00
parent f6aeac5a1c
commit fafd5b419b

View File

@@ -570,7 +570,7 @@ function readAdlists()
if(strlen($ip) == 0)
$ip = "noip";
// Test if this MAC address is already included
// Test if this lease is already included
readStaticLeasesFile();
foreach($dhcp_static_leases as $lease) {
if($lease["hwaddr"] === $mac)
@@ -583,6 +583,10 @@ function readAdlists()
$error .= "Static lease for IP address (".htmlspecialchars($ip).") already defined!<br>";
break;
}
if($lease["host"] === $hostname)
{
$error .= "Static lease for hostname (".htmlspecialchars($hostname).") already defined!<br>";
}
}
if(!strlen($error))