return;
}
- $.ajax({
- global: false,
- jsonp: false,
- dataType: "json",
- type: "GET",
- url: "auth",
- beforeSend: function (xhr) {
- xhr.setRequestHeader("Password", password);
+ ui.query("auth", {
+ headers: {
+ Password: password
},
success: function (json) {
+ var data = json[0].data;
$("#connectPassword").val("");
- if (json.auth === "failed") {
- // Is actually never returned by Rspamd
- } else {
- sessionStorage.setItem("read_only", json.read_only);
+ if (data.auth === "ok") {
+ sessionStorage.setItem("read_only", data.read_only);
saveCredentials(password);
$(dialog).hide();
$(backdrop).hide();
ui.alertMessage("alert-modal alert-error", jqXHR.statusText);
$("#connectPassword").val("");
$("#connectPassword").focus();
- }
+ },
+ params: {
+ global: false,
+ },
+ server: "local"
});
});
};