note 11809 added to ref.ldap.php

From: Date: Thu, 08 Mar 2001 06:32:25 +0000
Subject: note 11809 added to ref.ldap.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-12025@lists.php.net to get a copy of this message
When authenticating to a Win2k LDAP server you must include the name of the person authenticating to the server in the dn i.e. cn=administrator, cn=users, dc=server, dc=domain, dc=country Then when you bind to the LDAP database you use: $res = ldap_bind($ldap, $dn, $password); So a full example would be: if (!($ldap = ldap_connect("<server>", <port>))) { die ("Could not connect to LDAP server"); } $dn = "cn=administrator, cn=users, dc=myserver, dc=com, dc=au"; $password = "MyPassword"; if (!($res = @ldap_bind($ldap, $dn, $password))) { die ("Could not bind to $dn"); } Then you do your list or search functions on the ldap database. http://www.php.net/manual/en/ref.ldap.php

« previous php.notes (#12025) next »