Merge pull request #1427 from RaspAP/fix/log-dhcp-checkboxes

Fix: log DHCP requests + DNS queries checkbox states
This commit is contained in:
Bill Zimmerman 2023-10-23 10:46:41 +02:00 committed by GitHub
commit 9dcdd2ca7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,8 @@ function DisplayDHCPConfig()
$ap_iface = $_SESSION['ap_interface'];
$serviceStatus = $dnsmasq_state ? "up" : "down";
exec('cat '. RASPI_DNSMASQ_PREFIX.'raspap.conf', $return);
$log_dhcp = (preg_grep('/log-dhcp/', $return));
$log_queries = (preg_grep('/log-queries/', $return));
$conf = ParseConfig($return);
exec('cat '. RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return);
$conf = array_merge(ParseConfig($return));
@ -55,6 +57,9 @@ function DisplayDHCPConfig()
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
exec('cat ' . RASPI_DNSMASQ_LEASES, $leases);
count($log_dhcp) > 0 ? $conf['log-dhcp'] = true : false ;
count($log_queries) > 0 ? $conf['log-queries'] = true : false ;
echo renderTemplate(
"dhcp", compact(
"status",