cvs: pear /Auth package.xml /Auth/Container LDAP.php

From: Date: Tue, 21 Feb 2006 02:01:51 +0000
Subject: cvs: pear /Auth package.xml /Auth/Container LDAP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38427@lists.php.net to get a copy of this message
aashley Tue Feb 21 02:01:51 2006 UTC Modified files: /pear/Auth/Container LDAP.php /pear/Auth package.xml Log: Fix for #6644. Add support for LDAP referals option to aid compatibility with microsoft active directory http://cvs.php.net/viewcvs.cgi/pear/Auth/Container/LDAP.php?r1=1.23&r2=1.24&diff_format=u Index: pear/Auth/Container/LDAP.php diff -u pear/Auth/Container/LDAP.php:1.23 pear/Auth/Container/LDAP.php:1.24 --- pear/Auth/Container/LDAP.php:1.23 Fri Feb 17 13:24:28 2006 +++ pear/Auth/Container/LDAP.php Tue Feb 21 02:01:51 2006 @@ -16,7 +16,7 @@ // | Authors: Jan Wagner <wagner@netsols.de> | // +----------------------------------------------------------------------+ // -// $Id: LDAP.php,v 1.23 2006/02/17 13:24:28 moosh Exp $ +// $Id: LDAP.php,v 1.24 2006/02/21 02:01:51 aashley Exp $ // require_once "Auth/Container.php"; @@ -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 @@ -122,6 +125,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', @@ -165,7 +169,7 @@ * * @author Jan Wagner <wagner@netsols.de> * @package Auth - * @version $Revision: 1.23 $ + * @version $Revision: 1.24 $ */ class Auth_Container_LDAP extends Auth_Container @@ -232,6 +236,12 @@ @ldap_set_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $this->options['version']); } + // switch LDAP referrals + if (is_bool($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__); @@ -240,6 +250,7 @@ $this->_debug('Binding anonymously', __LINE__); $bind_params = array($this->conn_id); } + // bind for searching if ((@call_user_func_array('ldap_bind', $bind_params)) == false) { $this->_debug(); @@ -324,6 +335,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'] = ''; @@ -583,4 +595,4 @@ } } -?> \ No newline at end of file +?> http://cvs.php.net/viewcvs.cgi/pear/Auth/package.xml?r1=1.68&r2=1.69&diff_format=u Index: pear/Auth/package.xml diff -u pear/Auth/package.xml:1.68 pear/Auth/package.xml:1.69 --- pear/Auth/package.xml:1.68 Tue Feb 21 01:07:19 2006 +++ pear/Auth/package.xml Tue Feb 21 02:01:51 2006 @@ -53,6 +53,8 @@ <state>beta</state> <notes> <![CDATA[ + * Fixed Bug #6644: Added support for LDAP_OPT_REFERRALS. Setting to false can + improve compatibility with Active Directory. * Fixed Bug #6791: Made all calls to call_user_func() call_user_func_array and made calls consistant per change done in 1.3.0r3. * Fixed Bug #6803: depreciated DB function. Now requires DB >= 1.6.0

« previous php.pear.cvs (#38427) next »