From d0e461068e64ae9aa31574a4212819f6804ee9df Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Wed, 14 Sep 2022 09:33:49 +0300 Subject: lws: dhcp hostname overrides (aliases) --- localwebsite/handlers/ModemHandler.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'localwebsite/handlers') diff --git a/localwebsite/handlers/ModemHandler.php b/localwebsite/handlers/ModemHandler.php index aca69a3..b54b82c 100644 --- a/localwebsite/handlers/ModemHandler.php +++ b/localwebsite/handlers/ModemHandler.php @@ -146,7 +146,12 @@ class ModemHandler extends RequestHandler } public function GET_routing_dhcp_page() { + $overrides = config::get('dhcp_hostname_overrides'); $leases = MyOpenWrtUtils::getDHCPLeases(); + foreach ($leases as &$lease) { + if ($lease['hostname'] == '?' && array_key_exists($lease['mac'], $overrides)) + $lease['hostname'] = $overrides[$lease['mac']]; + } $this->tpl->set([ 'leases' => $leases ]); -- cgit v1.2.3