mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-27 07:31:09 +01:00
Merge pull request #1935 from RaspAP/fix/custom-paths
Fix: Update class methods + js handler for custom path locations
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user