Check authentication driver for expired authentication. Still doesn't trigger logouts...
authorJan Schneider <jan@horde.org>
Fri, 14 May 2010 22:03:51 +0000 (00:03 +0200)
committerJan Schneider <jan@horde.org>
Fri, 14 May 2010 22:03:51 +0000 (00:03 +0200)
framework/Auth/lib/Horde/Auth.php
framework/Auth/lib/Horde/Auth/Base.php
framework/Auth/lib/Horde/Auth/Shibboleth.php

index de6d921..6d6ef65 100644 (file)
@@ -444,7 +444,8 @@ class Horde_Auth
             }
         }
 
-        return true;
+        $auth = self::singleton($GLOBALS['conf']['auth']['driver']);
+        return $auth->checkExistingAuth();
     }
 
     /**
index 62b8784..38fde74 100644 (file)
@@ -133,6 +133,16 @@ abstract class Horde_Auth_Base
     abstract protected function _authenticate($userId, $credentials);
 
     /**
+     * Check existing auth for triggers that might invalidate it.
+     *
+     * @return boolean  Is existing auth valid?
+     */
+    public function checkExistingAuth()
+    {
+        return true;
+    }
+
+    /**
      * Adds a set of authentication credentials.
      *
      * @param string $userId      The userId to add.
index e2cfea2..01311e7 100644 (file)
@@ -76,6 +76,17 @@ class Horde_Auth_Shibboleth extends Horde_Auth_Base
     }
 
     /**
+     * Check existing auth for triggers that might invalidate it.
+     *
+     * @return boolean  Is existing auth valid?
+     */
+    public function checkExistingAuth()
+    {
+        return !empty($_SERVER[$this->_params['username_header']]) &&
+            $_SERVER[$this->_params['username_header']] == Horde_Auth::getAuth();
+    }
+
+    /**
      * Automatic authentication: check if the username is set in the
      * configured header.
      *