1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Implemented admin mode

This commit is contained in:
Krateng
2019-11-20 05:19:02 +01:00
parent 204712e240
commit 9b7bc5e38e
4 changed files with 77 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ function saveAPIkey() {
function checkAPIkey() {
function checkAPIkey(extrafunc=null) {
url = "/api/test?key=" + APIkey()
var xhttp = new XMLHttpRequest();
@@ -81,6 +81,11 @@ function checkAPIkey() {
document.getElementById("apikey").style.backgroundColor = "red"
apikeycorrect = false
}
if (extrafunc != null) {
extrafunc();
}
};
try {
xhttp.open("GET",url,true);
@@ -89,6 +94,9 @@ function checkAPIkey() {
catch (e) {
document.getElementById("apikey").style.backgroundColor = "red"
apikeycorrect = false
if (extrafunc != null) {
extrafunc();
}
}
}