No error handling for - ldap_bind(): Unable to bind to server: Invalid credentials.

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

 



Hello,
I am using php (5.4.11 windows) ldap extension and I am having problems when I bind to my LDAP server with wrong credentials.
The problem is that I get the warning: : ldap_bind(): Unable to bind to server: Invalid credentials no matter what I do.
I simply would like to handle the case and gracefully return false in my function (example below).
This problem is preventing me from post processing any PHP logic after bind.

I tried:

1-      error_reporting in php.ini (E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING & ~E_USER_WARNING & ~E_RECOVERABLE_ERROR & ~E_ERROR   or even ~E_ALL)

2-      Diplay_errors is Off.

3-      Similar setting from code (ini_set etc.)

Can anybody please help ? I have seen many posts on internet but nothing been resolved.

Basic example:

$ds = ldap_connect($address);
if( !$ds ) return false;
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$bind = @ldap_bind($ds,$dn,$password);   --> warning.
if( !$bind )  return false;

Thanks,
Giuseppe.


This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.


[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