diff --git a/includes/about.php b/includes/about.php index 12bf1897..45008f2d 100755 --- a/includes/about.php +++ b/includes/about.php @@ -5,7 +5,7 @@ require_once "app/lib/Parsedown.php"; /** * Displays info about the RaspAP project */ -function DisplayAbout($token) +function DisplayAbout() { $Parsedown = new Parsedown(); $strContent = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/BACKERS.md'); @@ -17,8 +17,7 @@ function DisplayAbout($token) echo renderTemplate( "about", compact( 'sponsorsHtml', - 'contributingHtml', - 'token' + 'contributingHtml' ) ); } diff --git a/includes/adblock.php b/includes/adblock.php index 75a751f0..ec6fb38d 100755 --- a/includes/adblock.php +++ b/includes/adblock.php @@ -6,7 +6,7 @@ require_once 'config.php'; * Manages ad blocking (dnsmasq) configuration * */ -function DisplayAdBlockConfig($token) +function DisplayAdBlockConfig() { $status = new \RaspAP\Messages\StatusMessage; $enabled = false; @@ -93,6 +93,7 @@ function DisplayAdBlockConfig($token) $adblock_log = "Unable to open log file"; } $logdata = getLogLimited(RASPI_DHCPCD_LOG, $adblock_log); + echo renderTemplate( "adblock", compact( "status", @@ -101,8 +102,7 @@ function DisplayAdBlockConfig($token) "enabled", "custom_enabled", "adblock_custom_content", - "logdata", - "token" + "logdata" ) ); } diff --git a/includes/admin.php b/includes/admin.php index c169a6f4..61dd21ed 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -1,6 +1,6 @@ getVpnManaged($vpn) : null; + if ($vpn) { + $vpnManaged = $dashboard->getVpnManged($vpn); + } $firewallManaged = $firewallStatus = ""; $firewallInstalled = array_filter($plugins, fn($p) => str_ends_with($p, 'Firewall')) ? true : false; if (!$firewallInstalled) { @@ -120,8 +122,7 @@ function DisplayDashboard(&$extraFooterScripts, $token): void "wirelessActive", "tetheringActive", "cellularActive", - "status", - "token" + "status" ) ); $extraFooterScripts[] = array('src'=>'app/js/dashboardchart.js', 'defer'=>false); diff --git a/includes/dhcp.php b/includes/dhcp.php index 2986c602..fd6a47ac 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -5,7 +5,7 @@ require_once 'config.php'; /** * Manage DHCP configuration */ -function DisplayDHCPConfig($token) +function DisplayDHCPConfig() { $status = new \RaspAP\Messages\StatusMessage; if (!RASPI_MONITOR_ENABLED) { @@ -74,8 +74,7 @@ function DisplayDHCPConfig($token) "upstreamServers", "interfaces", "leases", - "logdata", - "token" + "logdata" ) ); } diff --git a/includes/hostapd.php b/includes/hostapd.php index 6483c425..99b24fe3 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -9,7 +9,7 @@ getWifiInterface(); * Initialize hostapd values, display interface * */ -function DisplayHostAPDConfig($token) +function DisplayHostAPDConfig() { $status = new \RaspAP\Messages\StatusMessage; $system = new \RaspAP\System\Sysinfo; @@ -165,8 +165,7 @@ function DisplayHostAPDConfig($token) "operatingSystem", "selectedHwMode", "countryCodes", - "logdata", - "token" + "logdata" ) ); } diff --git a/includes/login.php b/includes/login.php index 742ff6c1..e3084a27 100755 --- a/includes/login.php +++ b/includes/login.php @@ -6,7 +6,7 @@ require_once 'includes/functions.php'; /** * Handler for administrative user login */ -function DisplayLogin($token) +function DisplayLogin() { // initialize auth object $auth = new \RaspAP\Auth\HTTPAuth; @@ -33,8 +33,7 @@ function DisplayLogin($token) echo renderTemplate( "login", compact( "status", - "redirectUrl", - "token" + "redirectUrl" ) ); } diff --git a/includes/openvpn.php b/includes/openvpn.php index 9c2c4418..2b59666b 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -8,7 +8,7 @@ getWifiInterface(); /** * Manage OpenVPN configuration */ -function DisplayOpenVPNConfig($token) +function DisplayOpenVPNConfig() { $status = new \RaspAP\Messages\StatusMessage; if (!RASPI_MONITOR_ENABLED) { @@ -79,8 +79,7 @@ function DisplayOpenVPNConfig($token) "authUser", "authPassword", "clients", - "conf_default", - "token" + "conf_default" ) ); } diff --git a/includes/page_actions.php b/includes/page_actions.php index 28606e07..c9649792 100755 --- a/includes/page_actions.php +++ b/includes/page_actions.php @@ -9,7 +9,7 @@ $page = $_SERVER['PATH_INFO']; // Check if any plugin wants to handle the request if (!$pluginManager->handlePageAction($page)) { // If no plugin is available fall back to core page action handlers - handleCorePageAction($page, $extraFooterScripts, $token); + handleCorePageAction($page, $extraFooterScripts); } /** @@ -17,65 +17,64 @@ if (!$pluginManager->handlePageAction($page)) { * * @param string $page * @param array $extraFooterScripts - * @param object $token * @return void */ -function handleCorePageAction(string $page, array &$extraFooterScripts, object $token): void +function handleCorePageAction(string $page, array &$extraFooterScripts): void { switch ($page) { case "/wlan0_info": - DisplayDashboard($extraFooterScripts, $token); + DisplayDashboard($extraFooterScripts); break; case "/dhcpd_conf": - DisplayDHCPConfig($token); + DisplayDHCPConfig(); break; case "/wpa_conf": - DisplayWPAConfig($token); + DisplayWPAConfig(); break; case "/network_conf": - DisplayNetworkingConfig($token); + DisplayNetworkingConfig(); break; case "/hostapd_conf": - DisplayHostAPDConfig($token); + DisplayHostAPDConfig(); break; case "/adblock_conf": - DisplayAdBlockConfig($token); + DisplayAdBlockConfig(); break; case "/openvpn_conf": - DisplayOpenVPNConfig($token); + DisplayOpenVPNConfig(); break; case "/wg_conf": - DisplayWireGuardConfig($token); + DisplayWireGuardConfig(); break; case "/provider_conf": - DisplayProviderConfig($token); + DisplayProviderConfig(); break; case "/torproxy_conf": - DisplayTorProxyConfig($token); + DisplayTorProxyConfig(); break; case "/auth_conf": - DisplayAuthConfig($_SESSION['user_id'], $token); + DisplayAuthConfig($_SESSION['user_id']); break; case "/save_hostapd_conf": - SaveTORAndVPNConfig($token); + SaveTORAndVPNConfig(); break; case "/data_use": - DisplayDataUsage($extraFooterScripts, $token); + DisplayDataUsage($extraFooterScripts); break; case "/system_info": - DisplaySystem($extraFooterScripts, $token); + DisplaySystem($extraFooterScripts); break; case "/restapi_conf": - DisplayRestAPI($token); + DisplayRestAPI(); break; case "/about": - DisplayAbout($token); + DisplayAbout(); break; case "/login": - DisplayLogin($token); + DisplayLogin(); break; default: - DisplayDashboard($extraFooterScripts, $token); + DisplayDashboard($extraFooterScripts); } } diff --git a/includes/restapi.php b/includes/restapi.php index 621e390f..4c11cfce 100755 --- a/includes/restapi.php +++ b/includes/restapi.php @@ -6,7 +6,7 @@ require_once 'config.php'; /** * Handler for RestAPI settings */ -function DisplayRestAPI($token) +function DisplayRestAPI() { // initialize status object $status = new \RaspAP\Messages\StatusMessage; @@ -59,16 +59,13 @@ function DisplayRestAPI($token) $docMsg = sprintf(_("RestAPI docs are accessible here %s"),$docUrl, $faicon); } - echo renderTemplate( - "restapi", compact( - "status", - "apiKey", - "serviceStatus", - "serviceLog", - "docMsg", - "token" - ) - ); + echo renderTemplate("restapi", compact( + "status", + "apiKey", + "serviceStatus", + "serviceLog", + "docMsg" + )); } /** diff --git a/includes/system.php b/includes/system.php index addaeea2..d37a5450 100755 --- a/includes/system.php +++ b/includes/system.php @@ -6,7 +6,7 @@ require_once 'config.php'; /** * */ -function DisplaySystem(&$extraFooterScripts, $token) +function DisplaySystem(&$extraFooterScripts) { $status = new \RaspAP\Messages\StatusMessage; $dashboard = new \RaspAP\UI\Dashboard; @@ -146,8 +146,7 @@ function DisplaySystem(&$extraFooterScripts, $token) "themes", "selectedTheme", "logLimit", - "pluginsTable", - "token" + "pluginsTable" )); } diff --git a/includes/wireguard.php b/includes/wireguard.php index 5a04801a..f6beb3dd 100755 --- a/includes/wireguard.php +++ b/includes/wireguard.php @@ -5,7 +5,7 @@ require_once 'config.php'; /** * Displays wireguard server & peer configuration */ -function DisplayWireGuardConfig($token) +function DisplayWireGuardConfig() { $status = new \RaspAP\Messages\StatusMessage; $parseFlag = true; @@ -98,8 +98,7 @@ function DisplayWireGuardConfig($token) "wg_pendpoint", "wg_pallowedips", "wg_pkeepalive", - "wg_log", - "token" + "wg_log" ) ); }