Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.4

Bug #6644 LDAP & Active Directory 2003 (LDAP_OPT_REFERRALS)
Submitted: 2006-01-31 17:14 UTC
From: marc at practeo dot ch Assigned: aashley
Status: Closed Package: Auth (version 1.3.0)
PHP Version: 5.0.5 OS: Linux / Ubuntu
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 19 + 3 = ?

 
 [2006-01-31 17:14 UTC] marc at practeo dot ch
Description: ------------ Hello, I coud'nt connect to a Active Directory Windows 2003 Server without setting the LDAP_OPT_REFERRALS to false. So please find attached my small patch to correct this. Thanks for your package, Best regards, Marc --- LDAP.php.orig 2006-01-31 15:04:35.000000000 +0100 +++ LDAP.php 2006-01-31 17:56:54.000000000 +0100 @@ -43,6 +43,9 @@ * it will be preferred over host and port * version: LDAP version to use, ususally 2 (default) or 3, * must be an integer! + * referrals If set, determines whether the LDAP library automatically follows + * referrals returned by LDAP servers or not. + * Possible values are true (default) or false * binddn: If set, searching for user will be done after binding * as this user, if not set the bind will be anonymous. * This is reported to make the container work with MS @@ -108,6 +111,7 @@ * 'host' => 'ldap.netsols.de', * 'port' => 389, * 'version' => 3, + * 'referrals' => false, * 'basedn' => 'dc=netsols,dc=de', * 'binddn' => 'cn=Jan Wagner,cn=Users,dc=netsols,dc=de', * 'bindpw' => 'password', @@ -217,6 +221,12 @@ @ldap_set_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $this->options['version']); } + // switch LDAP referrals + if (is_int($this->options['referrals'])) { + $this->_debug("Switching to LDAP referrals {$this->options['referrals']}", __LINE__); + @ldap_set_option($this->conn_id, LDAP_OPT_REFERRALS, $this->options['referrals']); + } + // bind with credentials or anonymously if ($this->options['binddn'] && $this->options['bindpw']) { $this->_debug('Binding with credentials', __LINE__);

Comments

 [2006-02-15 19:40 UTC] marc at practeo dot ch
I forget one part : .... @@ -309,6 +319,7 @@ $this->options['host'] = 'localhost'; $this->options['port'] = '389'; $this->options['version'] = 2; + $this->options['referrals'] = true; $this->options['binddn'] = ''; $this->options['bindpw'] = ''; $this->options['basedn'] = '';
 [2006-02-21 02:02 UTC] aashley at php dot net
Thank you for taking the time to report a problem with the package. This problem may have been already fixed by a previous change that is in the CVS of the package. Please log into CVS with: cvs -d :pserver:cvsread@cvs.php.net:/repository login and check out the CVS repository of this package and upgrade cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/Auth pear upgrade pear/Auth/package2.xml or pear upgrade pear/Auth/package.xml If you are able to reproduce the bug with the latest CVS, please change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2006-02-21 02:03 UTC] aashley at php dot net
That is your patch has been merged to trunk, could you please test it as I do not have access to an active directory server.
 [2006-04-10 13:42 UTC] marc at practeo dot ch
Thanks a lot, It's ok in the latest stable revision. Kind regards, Marc