Added event handlers to logout action
This commit is contained in:
parent
6a2d22ddd8
commit
41f6c9d8cf
@ -103,3 +103,9 @@ EndPublicGroupNav: At the end of the public group nav menu
|
|||||||
RouterInitialized: After the router instance has been initialized
|
RouterInitialized: After the router instance has been initialized
|
||||||
- $m: the Net_URL_Mapper that has just been set up
|
- $m: the Net_URL_Mapper that has just been set up
|
||||||
|
|
||||||
|
StartLogout: Before logging out
|
||||||
|
- $action: the logout action
|
||||||
|
|
||||||
|
EndLogout: After logging out
|
||||||
|
- $action: the logout action
|
||||||
|
|
||||||
|
@ -70,10 +70,20 @@ class LogoutAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
} else {
|
} else {
|
||||||
common_set_user(null);
|
if (Event::handle('StartLogout', array($this))) {
|
||||||
common_real_login(false); // not logged in
|
$this->logout();
|
||||||
common_forgetme(); // don't log back in!
|
}
|
||||||
|
Event::handle('EndLogout', array($this));
|
||||||
|
|
||||||
common_redirect(common_local_url('public'), 303);
|
common_redirect(common_local_url('public'), 303);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logout()
|
||||||
|
{
|
||||||
|
common_set_user(null);
|
||||||
|
common_real_login(false); // not logged in
|
||||||
|
common_forgetme(); // don't log back in!
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user