Annotation of embedaddon/php/ext/ldap/tests/ldap_unbind_variation.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ldap_unbind() - Variation of ldap_unbind() function using ldap_set_rebind_proc()
! 3: --CREDITS--
! 4: Patrick Allaert <patrickallaert@php.net>
! 5: # Belgian PHP Testfest 2009
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: <?php require_once('skipifbindfailure.inc'); ?>
! 9: --FILE--
! 10: <?php
! 11: require "connect.inc";
! 12:
! 13: function rebind_proc ($ds, $ldap_url) {
! 14: global $user;
! 15: global $passwd;
! 16: global $protocol_version;
! 17:
! 18: // required by most modern LDAP servers, use LDAPv3
! 19: ldap_set_option($a, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
! 20:
! 21: if (!ldap_bind($a, $user, $passwd)) {
! 22: print "Cannot bind";
! 23: }
! 24: }
! 25:
! 26: $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
! 27: ldap_set_rebind_proc($link, "rebind_proc");
! 28:
! 29: var_dump(ldap_unbind($link));
! 30: ?>
! 31: ===DONE===
! 32: --EXPECT--
! 33: bool(true)
! 34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>