ldap_sasl_bind_basic.phpt 684 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. ldap_sasl_bind() - Basic anonymous binding
  3. --CREDITS--
  4. Patrick Allaert <patrickallaert@php.net>
  5. # Belgian PHP Testfest 2009
  6. --SKIPIF--
  7. <?php require_once('skipif.inc'); ?>
  8. <?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
  9. <?php
  10. require "connect.inc";
  11. $link = fsockopen($host, $port);
  12. if (!$link) {
  13. die("skip no server listening");
  14. }
  15. ?>
  16. --FILE--
  17. <?php
  18. require "connect.inc";
  19. $link = ldap_connect($host, $port);
  20. ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
  21. var_dump(ldap_sasl_bind($link, null, $passwd, 'DIGEST-MD5', 'realm', $sasl_user));
  22. ?>
  23. ===DONE===
  24. --EXPECT--
  25. bool(true)
  26. ===DONE===