mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
Call on logout event when any sort of logout happens
This commit is contained in:
parent
87501bb2a9
commit
e0fdcaa959
@ -404,18 +404,12 @@
|
||||
et2_loadingFinished: function() {
|
||||
this.checkTabOverflow();
|
||||
var $logout = jQuery('#topmenu_logout');
|
||||
var self = this;
|
||||
if (!$logout.hasClass('onLogout'))
|
||||
{
|
||||
$logout.on('click', function(e){
|
||||
e.preventDefault();
|
||||
var apps = Object.keys(framework.applications);
|
||||
for(var i in apps)
|
||||
{
|
||||
if (app[apps[i]] && typeof app[apps[i]].onLogout === "function")
|
||||
{
|
||||
app[apps[i]].onLogout.call(e);
|
||||
}
|
||||
}
|
||||
self.callOnLogout(e);
|
||||
window.framework.redirect(this.href);
|
||||
});
|
||||
$logout.addClass('onLogout');
|
||||
@ -502,6 +496,17 @@
|
||||
$body.off('click');
|
||||
}
|
||||
$menu.toggle();
|
||||
},
|
||||
|
||||
callOnLogout: function(e) {
|
||||
var apps = Object.keys(framework.applications);
|
||||
for(var i in apps)
|
||||
{
|
||||
if (app[apps[i]] && typeof app[apps[i]].onLogout === "function")
|
||||
{
|
||||
app[apps[i]].onLogout.call(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window);
|
||||
|
1
json.php
1
json.php
@ -29,6 +29,7 @@ function login_redirect(&$anon_account)
|
||||
}
|
||||
Json\Request::isJSONRequest(true); // because Api\Json\Request::parseRequest() is not (yet) called
|
||||
$response = Json\Response::get();
|
||||
$response->apply('framework.callOnLogout');
|
||||
$response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10', true);
|
||||
|
||||
exit();
|
||||
|
Loading…
Reference in New Issue
Block a user