Loading...
 
Skip to main content

Architecture / Installation


LDAP ActiveDirectory patch

I tried attaching this as a file in the LDAP authentication thread. However, it might be useful to others...

Essentially, the adminuser and adminpass for the LDAP server are not passed to the LDAP authentication functions, and so LDAP servers that do not allow anonymous binding will not allow searches. This seems to include Active Directory 2003 (or at least it does where I work!)

The patch below just passes the adminuser and adminpass configuration variables through to the ldap_bind function.

Run this patch (should you wish) using
patch -p5 < patch.txt

Image
Copy to clipboard
diff -rch --exclude Galaxia /var/www/html/tiki/lib/pear/Auth/Container/LDAP.php /var/www/html/tiki-1.8/lib/pear/Auth/Container/LDAP.php *** /var/www/html/tiki/lib/pear/Auth/Container/LDAP.php Sat Jul 12 09:36:39 2003--- /var/www/html/tiki-1.8/lib/pear/Auth/Container/LDAP.php Thu Feb 17 14:23:05 2005 *************** *** 186,192 **** } // bind anonymously for searching ! if ((@ldap_bind($this->conn_id)) == false) { return PEAR::raiseError("Auth_Container_LDAP: Could not connect and bind to LDAP server.", 41, PEAR_ERROR_DIE); } } --- 186,198 ---- } // bind anonymously for searching ! if ($this->options['adminuser']) { ! $bindresult = @ldap_bind($this->conn_id, $this->options['adminuser'], $this->options['adminpass']); ! } else { ! $bindresult = @ldap_bind($this->conn_id); ! } ! ! if ($bindresult == false) { return PEAR::raiseError("Auth_Container_LDAP: Could not connect and bind to LDAP server.", 41, PEAR_ERROR_DIE); } } *************** *** 265,271 **** $msg .= "$key: $val\n"; // why that hardcoded value in auth ? // I feel like it's a very very nasty thing !!! ! // mail("da...@mc...", "test in auth_ldap", $msg); $msg = ""; } --- 271,277 ---- $msg .= "$key: $val\n"; // why that hardcoded value in auth ? // I feel like it's a very very nasty thing !!! ! mail($this->debug, "test in auth_ldap", $msg); $msg = ""; } diff -rch --exclude Galaxia /var/www/html/tiki/lib/userslib.php /var/www/html/tiki-1.8/lib/userslib.php *** /var/www/html/tiki/lib/userslib.php Thu Jul 29 13:47:40 2004 --- /var/www/html/tiki-1.8/lib/userslib.php Thu Feb 17 13:22:47 2005 *************** *** 368,373 **** --- 368,375 ---- $options["groupoc"] = $tikilib->get_preference("auth_ldap_groupoc", "groupOfUniqueNames"); $options["memberattr"] = $tikilib->get_preference("auth_ldap_memberattr", "uniqueMember"); $options["memberisdn"] = ($tikilib->get_preference("auth_ldap_memberisdn", "y") == "y"); + $options["adminuser"] = $tikilib->get_preference("auth_ldap_adminuser", ""); + $options["adminpass"] = $tikilib->get_preference("auth_ldap_adminpass", ""); // set the Auth options $a = new Auth("LDAP", $options, "", false, $user, $pass);

I've applied the patch & am still unable to login =(.
My php.ini is set to "error_reporting = E_ALL" but nothing is showing up.
I'm guessing that my AD is setup differently. Is there another tweak I can/should
perform in order to see errors/loggin on why it doesn't want to login?


As I understand it, the @ symbol preceding the ldap_ functions is making them supress any warnings or error messages. Remove the @ symbol before each one and you should start to get error messages.