]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - header.php
Add api/common_api.php and use Server-Sent Events, streaming JSON
[irc/unrealircd/unrealircd-webpanel.git] / header.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();