if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php"))
{?>
<script>
- var get_config("base_url") = "<?php echo get_config("base_url"); ?>";
+ var BASE_URL = "<?php echo get_config("base_url"); ?>";
function timeoutCheck() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
window.location = get_config("base_url") + 'login/?timeout=1&redirect=' + encodeURIComponent(window.location.pathname);
}
};
- xhttp.open("GET", get_config("base_url") + "api/timeout.php", true);
+ xhttp.open("GET", BASE_URL + "api/timeout.php", true);
xhttp.send();
}
timeoutCheck();
<script>
function updateStats() {
var xhttp = new XMLHttpRequest();
- var get_config("base_url") = "<?php echo get_config("base_url"); ?>";
+ var BASE_URL = "<?php echo get_config("base_url"); ?>";
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data = JSON.parse(this.responseText);
document.getElementById("memory-usage").innerHTML = "Memory Usage: <code>" + data.memory + "</code>";
}
};
- xhttp.open("GET", get_config("base_url") + "api/data.php", true);
+ xhttp.open("GET", BASE_URL + "api/data.php", true);
xhttp.send();
}
updateStats();