mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Reload UI when the user changes.
The JSON server has been modified to return the principal name in all responses. The UI has been modified to keep the principal obtained during whoami operation and check the principal returned in subsequent operations. If the principal changes the UI will reload itself. Ticket #1400
This commit is contained in:
parent
78e93c11f6
commit
edd37d2019
@ -120,6 +120,7 @@ var IPA = function() {
|
||||
},
|
||||
on_success: function(data, text_status, xhr) {
|
||||
that.whoami = data.result[0];
|
||||
that.principal = that.whoami.krbprincipalname[0];
|
||||
}
|
||||
}));
|
||||
|
||||
@ -419,6 +420,9 @@ IPA.command = function(spec) {
|
||||
message: data ? xhr.statusText : IPA.get_message('errors.no_response', 'No response')
|
||||
});
|
||||
|
||||
} else if (IPA.principal && data.principal && IPA.principal !== data.principal) {
|
||||
window.location.reload();
|
||||
|
||||
} else if (data.error) {
|
||||
// error_handler() calls IPA.hide_activity_icon()
|
||||
error_handler.call(this, xhr, text_status, /* error_thrown */ {
|
||||
|
@ -469,6 +469,7 @@ class jsonserver(WSGIExecutioner):
|
||||
result=result,
|
||||
error=error,
|
||||
id=_id,
|
||||
principal=unicode(context.principal),
|
||||
)
|
||||
response = json_encode_binary(response)
|
||||
return json.dumps(response, sort_keys=True, indent=4)
|
||||
|
Loading…
Reference in New Issue
Block a user