diff --git a/app/js/ui/main.js b/app/js/ui/main.js index c387ea50..008765c6 100644 --- a/app/js/ui/main.js +++ b/app/js/ui/main.js @@ -542,7 +542,7 @@ function disableValidation(form) { function updateActivityLED() { const threshold_bytes = 300; - fetch('/app/net_activity') + fetch('app/net_activity') .then(res => res.text()) .then(data => { const activity = parseInt(data.trim()); diff --git a/plugins b/plugins index b8e51de4..054f6bc0 160000 --- a/plugins +++ b/plugins @@ -1 +1 @@ -Subproject commit b8e51de4480fa502ab88e861604f13a91c2233a4 +Subproject commit 054f6bc0abe6999ddd629cc6878d5ada1749a6e8 diff --git a/src/RaspAP/Auth/HTTPAuth.php b/src/RaspAP/Auth/HTTPAuth.php index d5fcf215..fe141ae0 100755 --- a/src/RaspAP/Auth/HTTPAuth.php +++ b/src/RaspAP/Auth/HTTPAuth.php @@ -82,9 +82,10 @@ class HTTPAuth session_regenerate_id(true); // generate a new session id session_unset(); // unset all session variables session_destroy(); // destroy the session + $basePath = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/'); $redirectUrl = $_SERVER['REQUEST_URI']; if (strpos($redirectUrl, '/login') === false) { - header('Location: /login?action=' . urlencode($redirectUrl)); + header('Location: ' . $basePath . '/login?action=' . urlencode(basename($redirectUrl))); exit(); } } diff --git a/src/RaspAP/Exceptions/HtmlErrorRenderer.php b/src/RaspAP/Exceptions/HtmlErrorRenderer.php index 058a2478..9d6b5612 100755 --- a/src/RaspAP/Exceptions/HtmlErrorRenderer.php +++ b/src/RaspAP/Exceptions/HtmlErrorRenderer.php @@ -19,7 +19,7 @@ class HtmlErrorRenderer public function __construct() { $this->charset = 'UTF-8'; - $this->projectDir = $_SERVER['DOCUMENT_ROOT']; + $this->projectDir = dirname(__DIR__, 3); $this->template = '/templates/exception.php'; $this->debug = true; } diff --git a/src/RaspAP/Plugins/PluginInstaller.php b/src/RaspAP/Plugins/PluginInstaller.php index 3df0b067..e6043c8e 100644 --- a/src/RaspAP/Plugins/PluginInstaller.php +++ b/src/RaspAP/Plugins/PluginInstaller.php @@ -32,7 +32,7 @@ class PluginInstaller $this->tempSudoers = '/tmp/090_'; $this->destSudoers = '/etc/sudoers.d/'; $this->refModules = '/refs/heads/master/.gitmodules'; - $this->rootPath = $_SERVER['DOCUMENT_ROOT']; + $this->rootPath = dirname(__DIR__, 3); $this->pluginsManifest = '/plugins/manifest.json'; $this->repoPublic = $this->getRepository(); $this->helperScriptPath = RASPI_CONFIG.'/plugins/plugin_helper.sh';