skipifbindfailure.inc 357 B

12345678910111213
  1. <?php
  2. require_once 'connect.inc';
  3. if ($skip_on_bind_failure) {
  4. $link = ldap_connect($host, $port);
  5. ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
  6. if (!@ldap_bind($link, $user, $passwd))
  7. die(sprintf("skip Can't bind to LDAP Server - [%d] %s", ldap_errno($link), ldap_error($link)));
  8. ldap_unbind($link);
  9. }
  10. ?>