Annotation of embedaddon/php/ext/ldap/tests/ldap_set_rebind_proc_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ldap_set_rebind_proc() - Basic ldap_set_rebind_proc test
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: var_dump(ldap_set_rebind_proc($link, "rebind_proc"));
28: var_dump(ldap_set_rebind_proc($link, ""));
29: ?>
30: ===DONE===
31: --EXPECT--
32: bool(true)
33: bool(true)
34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>