1--TEST--
2ldap_sasl_bind() - Basic anonymous binding
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--EXTENSIONS--
7ldap
8--SKIPIF--
9<?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
10<?php
11    require "connect.inc";
12    $link = @fsockopen($uri);
13    if (!$link) {
14        die("skip no server listening");
15    }
16?>
17--FILE--
18<?php
19require "connect.inc";
20
21$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
22insert_dummy_data($link, $base);
23ldap_unbind($link);
24
25$link = ldap_connect($uri);
26ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
27var_dump(ldap_sasl_bind($link, null, $sasl_passwd, 'DIGEST-MD5', 'realm', $sasl_user));
28?>
29--CLEAN--
30<?php
31include "connect.inc";
32
33$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
34remove_dummy_data($link, $base);
35?>
36--EXPECT--
37bool(true)
38