mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
We add an intermediate role : Reseller. It is somewhere between a super administrator and a domain administrator. A reseller can create objects (a limited or not amount) and then define permissions on those objects: * Create a domain admins, * Assign limits to those admins, * ... see #105
34 lines
878 B
JavaScript
34 lines
878 B
JavaScript
/*
|
|
* Collection of functions that are accessible to every page.
|
|
*/
|
|
|
|
/*
|
|
* Simple function that redirect ajax requests to the login page if
|
|
* the status code received with a response is equal to 278.
|
|
*/
|
|
function ajax_login_redirect() {
|
|
if (this.status != 278) {
|
|
return;
|
|
}
|
|
var params = "?next=" + window.location.pathname;
|
|
|
|
window.location.href =
|
|
this.xhr.getResponseHeader("Location").replace(/\?.*$/, params);
|
|
}
|
|
|
|
/*
|
|
* Simple wrapper around Request.JSON. We just ensure that
|
|
* redirections are correctly catched. (on session timeout for
|
|
* example)
|
|
*/
|
|
Request.JSON.mdb = new Class({
|
|
Extends: Request.JSON,
|
|
|
|
options: {
|
|
onComplete: ajax_login_redirect,
|
|
onFailure: function(xhr) {
|
|
$(document.body).setStyle("overflow", "auto");
|
|
$(document.body).set("html", xhr.responseText);
|
|
}
|
|
}
|
|
}); |