1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class LogoutAction extends ManagedAction
- {
-
- function isReadOnly($args)
- {
- return false;
- }
- protected function doPreparation()
- {
- if (!common_logged_in()) {
-
- throw new AlreadyFulfilledException(_('Cannot log you out if you are not logged in.'));
- }
- if (Event::handle('StartLogout', array($this))) {
- $this->logout();
- }
- Event::handle('EndLogout', array($this));
- common_redirect(common_local_url('top'));
- }
-
- public function logout()
- {
- common_set_user(null);
- common_real_login(false);
- common_forgetme();
- }
- }
|