From: Maxime D. <mde...@te...> - 2007-08-12 17:42:39
|
Quoting Paul Willoughby <pa...@na...>: > php_ldap defaults to using LDAPv2 but I need LDAPv3. As far as I can > tell this option can not be changed in a config file and has to be set > when creating the connection. It's only available with OpenLDAP 2.x.x or Netscape Directory SDK x.x But I'm OK with your patch > > Perhaps something like this could be added: > > drivers_ldap.php > > $host=3D$config['host']; > $port=3D$config['port']; > + $protocolVersion=3D$config['protocolVersion']; > if(!function_exists('ldap_connect')){ > $c->messages[] =3D i18n("drivers_ldap : function ldap_connect > not defined, check your php_ldap module"); > $this->valid=3Dfalse; > return ; > } > if ($port) $this->connect=3Dldap_connect($host, $port); > else $this->connect=3Dldap_connect($host); > if (! $this->connect){ > $c->messages[] =3D sprintf(i18n( "drivers_ldap : Unable to > connect to LDAP with port %s on host %s"), $port,$host ); > $this->valid=3Dfalse; > return ; > } > + //Set LDAP protocol version > + if ($protocolVersion) ldap_set_option($this->connect, > LDAP_OPT_PROTOCOL_VERSION, $protocolVersion); > > //connect as root > if (!ldap_bind($this->connect,$config['bindDN'],$config['passDN'])){ > > > ********************************/ > /*********** LDAP hook **********/ > /********************************/ > $c->authenticate_hook['call'] =3D 'LDAP_check'; > $c->authenticate_hook['config'] =3D array( > 'host' =3D> 'www.tennaxia.net', //host name of your LDAP Server > 'port' =3D> '389', //port > 'bindDN'=3D> 'cn=3Dmanager,cn=3Dinternal,dc=3Dtennaxia,dc=3Dnet', //DN= to bind > to this server enabling to perform request > 'passDN'=3D> 'xxxxxxxx', //Password of the previous bindDN to bind to > this server enabling to perform request > + 'protocolVersion' =3D> '3', //Version of LDAP protocol to use > 'baseDNUsers'=3D> 'dc=3Dtennaxia,dc=3Dnet', //where to look at valid u= ser > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rscds-general mailing list > Rsc...@li... > https://lists.sourceforge.net/lists/listinfo/rscds-general > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. |