note 56105 added to function.ldap-bind

From: Date: Tue, 23 Aug 2005 18:33:07 +0000
Subject: note 56105 added to function.ldap-bind
Groups: php.notes 
Request: Send a blank email to php-notes+get-94089@lists.php.net to get a copy of this message
Hey I was trying this all day and final noticed that when you use bind and authenticate. The user name needs to be as follows for it to work. I am using PHP V 4.03 so this might be different now but here is what I used and the auth worked. <?php $ldaphost = "ldap.what.at.greatnet.com"; $ldapport = 389; $ds = ldap_connect($ldaphost, $ldapport) or die("Could not connect to $ldaphost"); if ($ds) { $username = "johndoe@what.at.greatnet.com"; $upasswd = "pass"; $ldapbind = ldap_bind($ds, $username, $upasswd); if ($ldapbind) {print "Congratulations! $username is authenticated.";} else {print "Nice try, kid. Better luck next time!";} } ?> ---- Manual Page -- http://www.php.net/manual/en/function.ldap-bind.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56105 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56105&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56105&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94089) next »