]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Fixes for BASE_URL massreplace, accidentally changes JS code too.
authorBram Matthys <redacted>
Wed, 12 Apr 2023 09:15:05 +0000 (11:15 +0200)
committerBram Matthys <redacted>
Wed, 12 Apr 2023 09:15:05 +0000 (11:15 +0200)
header.php
tools/checkup.php

index 97100c42d39ee6c9a82230556946294aa563f57e..df46ea86f975c7e44a6d4b078276f1a3442931d6 100644 (file)
@@ -2,7 +2,7 @@
 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() {
@@ -12,7 +12,7 @@ if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php
                                                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();
index 562aed386d4bb9e74d8738bee9412651b71560b4..e294ca11d8890927105e2e4fe3bd3968d7ff9498 100644 (file)
@@ -148,7 +148,7 @@ new Chart("myChart", {
 <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);
@@ -156,7 +156,7 @@ new Chart("myChart", {
                 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();