Call on logout event when any sort of logout happens

This commit is contained in:
Hadi Nategh 2019-10-18 14:17:27 +02:00
parent 87501bb2a9
commit e0fdcaa959
2 changed files with 14 additions and 8 deletions

View File

@ -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);

View File

@ -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();