mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +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() {
|
et2_loadingFinished: function() {
|
||||||
this.checkTabOverflow();
|
this.checkTabOverflow();
|
||||||
var $logout = jQuery('#topmenu_logout');
|
var $logout = jQuery('#topmenu_logout');
|
||||||
|
var self = this;
|
||||||
if (!$logout.hasClass('onLogout'))
|
if (!$logout.hasClass('onLogout'))
|
||||||
{
|
{
|
||||||
$logout.on('click', function(e){
|
$logout.on('click', function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var apps = Object.keys(framework.applications);
|
self.callOnLogout(e);
|
||||||
for(var i in apps)
|
|
||||||
{
|
|
||||||
if (app[apps[i]] && typeof app[apps[i]].onLogout === "function")
|
|
||||||
{
|
|
||||||
app[apps[i]].onLogout.call(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.framework.redirect(this.href);
|
window.framework.redirect(this.href);
|
||||||
});
|
});
|
||||||
$logout.addClass('onLogout');
|
$logout.addClass('onLogout');
|
||||||
@ -502,6 +496,17 @@
|
|||||||
$body.off('click');
|
$body.off('click');
|
||||||
}
|
}
|
||||||
$menu.toggle();
|
$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);
|
})(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
|
Json\Request::isJSONRequest(true); // because Api\Json\Request::parseRequest() is not (yet) called
|
||||||
$response = Json\Response::get();
|
$response = Json\Response::get();
|
||||||
|
$response->apply('framework.callOnLogout');
|
||||||
$response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10', true);
|
$response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10', true);
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
|
Loading…
Reference in New Issue
Block a user