Fix undefined vars in class methods + includes

This commit is contained in:
billz
2025-09-12 23:08:48 -07:00
parent 08cc452e3d
commit 66b0a42576
6 changed files with 14 additions and 11 deletions

View File

@@ -88,6 +88,7 @@ function DisplayDashboard(&$extraFooterScripts): void
} else {
$firewallManaged = '<a href="/plugin__Firewall">';
$firewallStatus = ($dashboard->firewallEnabled() == true) ? "active" : "";
$firewallUnavailable = null;
}
echo renderTemplate(

View File

@@ -49,7 +49,9 @@ function DisplayWireGuardConfig()
exec('sudo cat '. RASPI_WIREGUARD_CONFIG, $return);
$conf = ParseConfig($return, $parseFlag);
$wg_srvpubkey = exec('sudo cat '. RASPI_WIREGUARD_PATH .'wg-server-public.key', $return);
$wg_srvport = ($conf['ListenPort'] == '') ? getDefaultNetValue('wireguard','server','ListenPort') : $conf['ListenPort'];
$wg_srvport = ($conf['ListenPort'] ?? '') === ''
? getDefaultNetValue('wireguard','server','ListenPort')
: $conf['ListenPort'];
$wg_srvipaddress = ($conf['Address'] == '') ? getDefaultNetValue('wireguard','server','Address') : $conf['Address'];
$wg_srvdns = ($conf['DNS'] == '') ? getDefaultNetValue('wireguard','server','DNS') : $conf['DNS'];
if (is_array($wg_srvdns)) {