RE: LDAP confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip] I vaguely recall you couldn't do an anonymous bind to an active 
directory system - you had to properly authenticate before you could do 
a search.

You didn't include the bind stuff so I can't tell if that's the problem
:)
[/snip]

I thought that I was not doing an anonymous bind, until I changed the
username to something that I know did not exist. The bind occurred (or
appeared to) anyhow.

if(!$ds=ldap_connect("foo")){
	echo "did not connect";
}else {
	echo "connection successful";
}
$un = "user";
$upw = "pass";
echo "connect result is " . $ds . "<br />";
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);

if ($ds) { 
   echo "Binding ..."; 
   if(!$r=ldap_bind($ds, $un, $upd)){
   	echo "unable to verify</br>";
   }else{
   	echo "verified<br>";
   }    

The result is always "verified".

This should be a really simple operation.

1. user enters name and password
2. if bind is successful redirect them properly
3. else give them a message about incorrect login.

I really do not need to search the AD or any of that (I may want to
install phpldapadmin at some point though).

I feel as if I am missing something very simple, I have always been able
to connect to everything with PHP. Can anyone help me with this please?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux