mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed ipa.js for sessions.
The patch fixes a problem in error_handler_login() when it gets an error other than 401. The login_url is not needed for fixtures because it does not need authentication. The patch also fixes jslint warnings and formatting issues.
This commit is contained in:
parent
bba4ccb3a0
commit
eba3a341e6
@ -59,10 +59,11 @@ var IPA = function() {
|
|||||||
// if current path matches live server path, use live data
|
// if current path matches live server path, use live data
|
||||||
if (that.url && window.location.pathname.substring(0, that.url.length) === that.url) {
|
if (that.url && window.location.pathname.substring(0, that.url.length) === that.url) {
|
||||||
that.json_url = params.url || '/ipa/json';
|
that.json_url = params.url || '/ipa/json';
|
||||||
that.login_url = params.url || '/ipa/login'; // FIXME, what about the other case below?
|
that.login_url = params.url || '/ipa/login';
|
||||||
|
|
||||||
} else { // otherwise use fixtures
|
} else { // otherwise use fixtures
|
||||||
that.json_path = params.url || "test/data";
|
that.json_path = params.url || "test/data";
|
||||||
|
// that.login_url is not needed for fixtures
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajaxSetup(that.ajax_options);
|
$.ajaxSetup(that.ajax_options);
|
||||||
@ -300,8 +301,8 @@ IPA.get_credentials = function() {
|
|||||||
|
|
||||||
var request = {
|
var request = {
|
||||||
url: IPA.login_url,
|
url: IPA.login_url,
|
||||||
async: false,
|
async: false,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
success: success_handler,
|
success: success_handler,
|
||||||
error: error_handler
|
error: error_handler
|
||||||
};
|
};
|
||||||
@ -309,7 +310,7 @@ IPA.get_credentials = function() {
|
|||||||
$.ajax(request);
|
$.ajax(request);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call an IPA command over JSON-RPC.
|
* Call an IPA command over JSON-RPC.
|
||||||
@ -421,13 +422,13 @@ IPA.command = function(spec) {
|
|||||||
var login_status = IPA.get_credentials();
|
var login_status = IPA.get_credentials();
|
||||||
|
|
||||||
if (login_status === 200) {
|
if (login_status === 200) {
|
||||||
that.request.error = error_handler
|
that.request.error = error_handler;
|
||||||
$.ajax(that.request);
|
$.ajax(that.request);
|
||||||
} else {
|
return;
|
||||||
// error_handler() calls IPA.hide_activity_icon()
|
|
||||||
error_handler.call(this, xhr, text_status, error_thrown);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// error_handler() calls IPA.hide_activity_icon()
|
||||||
|
error_handler.call(this, xhr, text_status, error_thrown);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user