forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldap_sasl_bind_basic.phpt
37 lines (34 loc) · 959 Bytes
/
ldap_sasl_bind_basic.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
ldap_sasl_bind() - Basic anonymous binding
--CREDITS--
Patrick Allaert <[email protected]>
# Belgian PHP Testfest 2009
--EXTENSIONS--
ldap
--SKIPIF--
<?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
<?php
require "connect.inc";
$link = @fsockopen($host, $port);
if (!$link) {
die("skip no server listening");
}
?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);
ldap_unbind($link);
$link = ldap_connect($host, $port);
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
var_dump(ldap_sasl_bind($link, null, $sasl_passwd, 'DIGEST-MD5', 'realm', $sasl_user));
?>
--CLEAN--
<?php
include "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
remove_dummy_data($link, $base);
?>
--EXPECT--
bool(true)