2024-11-06 02:24:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$pluginManager = \RaspAP\Plugins\PluginManager::getInstance();
|
|
|
|
|
|
|
|
// Get the requested page
|
|
|
|
$extraFooterScripts = array();
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Core application page handling
|
|
|
|
*
|
|
|
|
* @param string $page
|
|
|
|
* @param array $extraFooterScripts
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function handleCorePageAction(string $page, array &$extraFooterScripts): void
|
|
|
|
{
|
|
|
|
switch ($page) {
|
2023-09-14 13:14:02 +00:00
|
|
|
case "/wlan0_info":
|
|
|
|
DisplayDashboard($extraFooterScripts);
|
|
|
|
break;
|
|
|
|
case "/dhcpd_conf":
|
|
|
|
DisplayDHCPConfig();
|
|
|
|
break;
|
|
|
|
case "/wpa_conf":
|
|
|
|
DisplayWPAConfig();
|
|
|
|
break;
|
|
|
|
case "/network_conf":
|
2023-09-15 18:02:37 +00:00
|
|
|
DisplayNetworkingConfig();
|
2023-09-14 13:14:02 +00:00
|
|
|
break;
|
|
|
|
case "/hostapd_conf":
|
|
|
|
DisplayHostAPDConfig();
|
|
|
|
break;
|
|
|
|
case "/adblock_conf":
|
|
|
|
DisplayAdBlockConfig();
|
|
|
|
break;
|
|
|
|
case "/openvpn_conf":
|
|
|
|
DisplayOpenVPNConfig();
|
|
|
|
break;
|
|
|
|
case "/wg_conf":
|
|
|
|
DisplayWireGuardConfig();
|
|
|
|
break;
|
2023-10-12 17:21:23 +00:00
|
|
|
case "/provider_conf":
|
|
|
|
DisplayProviderConfig();
|
|
|
|
break;
|
2023-09-14 13:14:02 +00:00
|
|
|
case "/torproxy_conf":
|
|
|
|
DisplayTorProxyConfig();
|
|
|
|
break;
|
|
|
|
case "/auth_conf":
|
|
|
|
DisplayAuthConfig($_SESSION['user_id']);
|
|
|
|
break;
|
|
|
|
case "/save_hostapd_conf":
|
|
|
|
SaveTORAndVPNConfig();
|
|
|
|
break;
|
|
|
|
case "/data_use":
|
|
|
|
DisplayDataUsage($extraFooterScripts);
|
|
|
|
break;
|
|
|
|
case "/system_info":
|
|
|
|
DisplaySystem($extraFooterScripts);
|
|
|
|
break;
|
2024-02-19 09:08:29 +00:00
|
|
|
case "/restapi_conf":
|
|
|
|
DisplayRestAPI();
|
|
|
|
break;
|
2023-09-14 13:14:02 +00:00
|
|
|
case "/about":
|
|
|
|
DisplayAbout();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DisplayDashboard($extraFooterScripts);
|
2024-11-06 02:24:41 +00:00
|
|
|
}
|
|
|
|
}
|
2023-09-15 18:02:37 +00:00
|
|
|
|