[dokuwiki] Problems with subscriptions and ldap auth

If you use ldap auth, and the ldap server requires authentication,
subscriptions do not currently work because the getUserData routine
doesn't authenticate. 

I was able to do a quick fix for us by adding this patch, but you may
want to do something cleaner.


diff -rN -u old-dokuwiki/inc/auth/ldap.class.php
new-dokuwiki/inc/auth/ldap.class.php
--- old-dokuwiki/inc/auth/ldap.class.php        2006-01-31
08:36:53.559814873 -0600
+++ new-dokuwiki/inc/auth/ldap.class.php        2006-01-31
08:36:54.439183478 -0600
@@ -128,6 +128,15 @@
         global $conf;
         if(!$this->_openLDAP()) return false;
 
+        if($this->cnf['binddn'] && $this->cnf['bindpw']){
+            // use superuser credentials
+
if(!@ldap_bind($this->con,$this->cnf['binddn'],$this->cnf['bindpw'])){
+                if($this->cnf['debug'])
+                    msg('LDAP bind as superuser:
'.htmlspecialchars(ldap_error($this->con)),0);
+                return false;
+            }
+        }
+
         $info['user']   = $user;
         $info['server'] = $this->cnf['server'];
 




 
------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@xxxxxxx
University of Missouri - Rolla         Phone: (573) 341-6679
UMR Information Technology             Fax: (573) 341-4216
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: