]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/logout.php
Merge commit 'jeff-themovie/group-rss-empty' into 0.8.x
[quix0rs-gnu-social.git] / actions / logout.php
index b7681be3827ed25fe2546f7b83c8f7ea37fe9499..3fcfb4f4ef2570352d1c28f888c09329182feced 100644 (file)
@@ -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!
+    }
+
 }