Merge pull request #1935 from RaspAP/fix/custom-paths

Fix: Update class methods + js handler for custom path locations
This commit is contained in:
Bill Zimmerman
2025-08-20 11:48:02 -07:00
committed by GitHub
4 changed files with 5 additions and 4 deletions

View File

@@ -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());

View File

@@ -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();
}
}

View File

@@ -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;
}

View File

@@ -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';