forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldap_delete_ext.phpt
71 lines (67 loc) · 1.48 KB
/
ldap_delete_ext.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--TEST--
ldap_delete_ext() - Delete operation with controls
--CREDITS--
Côme Chilliet <[email protected]>
--EXTENSIONS--
ldap
--SKIPIF--
<?php require_once('skipifbindfailure.inc'); ?>
<?php
require_once('skipifcontrol.inc');
skipifunsupportedcontrol(LDAP_CONTROL_PRE_READ);
?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_add($link, "dc=my-domain,$base", array(
"objectClass" => array(
"top",
"dcObject",
"organization"),
"dc" => "my-domain",
"o" => "my-domain",
));
var_dump(
$result = ldap_delete_ext($link, "dc=my-domain,$base",
[['oid' => LDAP_CONTROL_PRE_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['dc', 'o']]]]
),
ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
$errcode,
$errmsg,
$ctrls[LDAP_CONTROL_PRE_READ],
@ldap_search($link, "dc=my-domain,$base", "(o=my-domain)")
);
?>
--CLEAN--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
@ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
object(LDAP\Result)#%d (0) {
}
bool(true)
int(0)
string(0) ""
array(2) {
["oid"]=>
string(14) "1.3.6.1.1.13.1"
["value"]=>
array(3) {
["dn"]=>
string(%d) "dc=my-domain,%s"
["dc"]=>
array(1) {
[0]=>
string(9) "my-domain"
}
["o"]=>
array(1) {
[0]=>
string(9) "my-domain"
}
}
}
bool(false)