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 77845474d8
commit bc85bcda7b

View File

@@ -565,7 +565,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)
@@ -578,6 +578,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))