X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Flogout.php;h=3fcfb4f4ef2570352d1c28f888c09329182feced;hb=c2c631d19dad52e528d633ddd6729bf35d9fd60c;hp=b7681be3827ed25fe2546f7b83c8f7ea37fe9499;hpb=590cc0c9a41206ba58c9333b4e9ef8931285f7e4;p=quix0rs-gnu-social.git diff --git a/actions/logout.php b/actions/logout.php index b7681be382..3fcfb4f4ef 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -12,7 +12,7 @@ * @link http://laconi.ca/ * * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * Copyright (C) 2008, 2009, Control Yourself, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -52,7 +52,7 @@ class LogoutAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return false; } @@ -70,10 +70,20 @@ class LogoutAction extends Action if (!common_logged_in()) { $this->clientError(_('Not logged in.')); } else { - common_set_user(null); - common_real_login(false); // not logged in - common_forgetme(); // don't log back in! + if (Event::handle('StartLogout', array($this))) { + $this->logout(); + } + Event::handle('EndLogout', array($this)); + 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! + } + }