Add logout application method - used for logout tasks
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 1 Oct 2010 17:44:55 +0000 (11:44 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 1 Oct 2010 22:41:10 +0000 (16:41 -0600)
framework/Core/lib/Horde/Registry.php
framework/Core/lib/Horde/Registry/Application.php

index c41ef86..c71f2f3 100644 (file)
@@ -1697,6 +1697,15 @@ class Horde_Registry
      */
     public function clearAuth($destroy = true)
     {
+        /* Do logout tasks. */
+        if (!empty($_SESSION['horde_auth']['app'])) {
+            foreach (array_keys($_SESSION['horde_auth']['app']) as $app) {
+                try {
+                    $this->callAppMethod($app, 'logout');
+                } catch (Horde_Exception $e) {}
+            }
+        }
+
         unset($_SESSION['horde_auth']);
 
         /* Remove the user's cached preferences if they are present. */
index 197eb5e..34305bf 100644 (file)
@@ -109,6 +109,11 @@ class Horde_Registry_Application
     // Functions called from Horde's API.
 
     /**
+     * Tasks to perform at logout.
+     */
+    // public function logout()
+
+    /**
      * Removes user data.
      *
      * @param string $user  Name of user to remove data for.