Re-bind as user if requested.
authorJan Schneider <jan@horde.org>
Mon, 20 Sep 2010 16:35:59 +0000 (18:35 +0200)
committerJan Schneider <jan@horde.org>
Mon, 20 Sep 2010 16:35:59 +0000 (18:35 +0200)
framework/Core/lib/Horde/Core/Factory/Ldap.php

index c73bfe0..11a983d 100644 (file)
@@ -84,6 +84,11 @@ class Horde_Core_Factory_Ldap
 
         try {
             $this->_instances[$sig] = new Horde_Ldap($config);
+            if (isset($config['bindas']) && $config['bindas'] == 'user') {
+                $this->_instances[$sig]->bind(
+                    $this->_instances[$sig]->findUserDN($GLOBALS['registry']->getAuth()),
+                    $GLOBALS['registry']->getAuthCredential('password'));
+            }
         } catch (Horde_Exception $e) {
             if ($pushed) {
                 $GLOBALS['registry']->popApp();