import zend ldap tests
Esse commit está contido em:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$dn = "dc=my-domain,dc=com";
|
||||
$filter = "(objectclass=person)";
|
||||
|
||||
var_dump(
|
||||
$result = ldap_search($link, $dn, $filter, array('sn')),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
var_dump(
|
||||
$result = ldap_search($link, $dn, $filter, array('sn'), 1, 1, 1, LDAP_DEREF_ALWAYS),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
var_dump(
|
||||
$result = ldap_search($link, $dn, $filter, array('sn')),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,127 @@
|
||||
resource(%d) of type (ldap result)
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN1"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
[1]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN2"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
[2]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN3"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
HipHop Warning: %a
|
||||
resource(%d) of type (ldap result)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
resource(%d) of type (ldap result)
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN1"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
[1]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN2"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
[2]=>
|
||||
array(4) {
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN3"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "sn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
ldap_read(1,1,1);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
HipHop Warning: %a
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
var_dump(
|
||||
ldap_add($link, "dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
)),
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(o=my-domain)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
bool(true)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(8) {
|
||||
["objectclass"]=>
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "top"
|
||||
[1]=>
|
||||
string(8) "dcObject"
|
||||
[2]=>
|
||||
string(12) "organization"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["dc"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "dc"
|
||||
["o"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[2]=>
|
||||
string(1) "o"
|
||||
["count"]=>
|
||||
int(3)
|
||||
["dn"]=>
|
||||
string(19) "dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_add());
|
||||
var_dump(ldap_add($link));
|
||||
var_dump(ldap_add($link, "dc=my-domain,dc=com"));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_add($link, "dc=my-domain,dc=com", array(), "Additional data"));
|
||||
|
||||
var_dump(ldap_add($link, "dc=my-domain,dc=com", array()));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(
|
||||
ldap_add($link, "weirdAttribute=val", array(
|
||||
"weirdAttribute" => "val",
|
||||
)),
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
);
|
||||
|
||||
// Duplicate entry
|
||||
for ($i = 0; $i < 2; $i++)
|
||||
var_dump(
|
||||
ldap_add($link, "dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
))
|
||||
);
|
||||
var_dump(ldap_error($link), ldap_errno($link));
|
||||
|
||||
// Wrong array indexes
|
||||
var_dump(
|
||||
ldap_add($link, "dc=my-domain2,dc=com", array(
|
||||
"objectClass" => array(
|
||||
0 => "top",
|
||||
2 => "dcObject",
|
||||
5 => "organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
))
|
||||
/* Is this correct behaviour to still have "Already exists" as error/errno?
|
||||
,
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
*/
|
||||
);
|
||||
|
||||
// Invalid attribute
|
||||
var_dump(
|
||||
ldap_add($link, "dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
"weirdAttr" => "weirdVal",
|
||||
)),
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
);
|
||||
|
||||
var_dump(
|
||||
ldap_add($link, "dc=my-domain,dc=com", array(array( "Oops"
|
||||
)))
|
||||
/* Is this correct behaviour to still have "Undefined attribute type" as error/errno?
|
||||
,
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
*/
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
string(17) "Invalid DN syntax"
|
||||
int(34)
|
||||
bool(true)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
string(14) "Already exists"
|
||||
int(68)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
string(24) "Undefined attribute type"
|
||||
int(17)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
|
||||
var_dump(ldap_bind($link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,2 @@
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
|
||||
|
||||
// Invalid parameter count
|
||||
var_dump(ldap_bind($link, $user, $passwd, null));
|
||||
|
||||
// Invalid password
|
||||
var_dump(ldap_bind($link, $user, "ThisIsNotCorrect$passwd"));
|
||||
|
||||
// Invalid DN syntax
|
||||
var_dump(ldap_bind($link, "unexistingProperty=weirdValue,$user", $passwd));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
|
||||
var_dump(ldap_bind($link, $user, $passwd));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,2 @@
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
var_dump(
|
||||
ldap_compare($link, "cn=userA,dc=my-domain,dc=com", "sn", "testSN1"),
|
||||
ldap_compare($link, "cn=userA,dc=my-domain,dc=com", "telephoneNumber", "yy-yy-yy-yy-yy")
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
bool(true)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_compare($link));
|
||||
var_dump(ldap_compare($link, $link));
|
||||
var_dump(ldap_compare($link, $link, $link));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_compare($link, $link, $link, $link, "Additional data"));
|
||||
|
||||
var_dump(
|
||||
ldap_compare($link, "cn=userNotAvailable,dc=my-domain,dc=com", "sn", "testSN1"),
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,13 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
int(-1)
|
||||
string(14) "No such object"
|
||||
int(32)
|
||||
===DONE===
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$dn = "dc=my-domain,dc=com";
|
||||
$filter = "(cn=*)";
|
||||
var_dump(
|
||||
ldap_control_paged_result($link, 1),
|
||||
$result = ldap_search($link, $dn, $filter, array('cn')),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
bool(true)
|
||||
resource(6) of type (ldap result)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userA"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$dn = "dc=my-domain,dc=com";
|
||||
$filter = "(cn=*)";
|
||||
var_dump(
|
||||
ldap_control_paged_result($link, 2),
|
||||
$result = ldap_search($link, $dn, $filter, array('cn')),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,39 @@
|
||||
bool(true)
|
||||
resource(6) of type (ldap result)
|
||||
array(3) {
|
||||
["count"]=>
|
||||
int(2)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userA"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
[1]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userB"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$dn = "dc=my-domain,dc=com";
|
||||
$filter = "(cn=*)";
|
||||
$cookie = '';
|
||||
var_dump(
|
||||
ldap_control_paged_result($link, 2, true, $cookie),
|
||||
$result = ldap_search($link, $dn, $filter, array('cn')),
|
||||
ldap_get_entries($link, $result),
|
||||
ldap_control_paged_result_response($link, $result, $cookie),
|
||||
ldap_control_paged_result($link, 20, true, $cookie),
|
||||
$result = ldap_search($link, $dn, $filter, array('cn')),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,62 @@
|
||||
bool(true)
|
||||
resource(%d) of type (ldap result)
|
||||
array(3) {
|
||||
["count"]=>
|
||||
int(2)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userA"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
[1]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userB"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
bool(true)
|
||||
resource(%d) of type (ldap result)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userC"
|
||||
}
|
||||
[0]=>
|
||||
string(2) "cn"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(37) "cn=userC,cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=person)");
|
||||
var_dump(ldap_count_entries($link, $result));
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
int(3)
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_count_entries($link));
|
||||
var_dump(ldap_count_entries($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
ldap_add($link, "dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
));
|
||||
|
||||
var_dump(
|
||||
ldap_delete($link, "dc=my-domain,dc=com"),
|
||||
@ldap_search($link, "dc=my-domain,dc=com", "(o=my-domain)")
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
bool(true)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_delete());
|
||||
var_dump(ldap_delete($link));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_delete($link, "dc=my-domain,dc=com", "Additional data"));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(
|
||||
ldap_delete($link, "weirdAttribute=val"),
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
);
|
||||
|
||||
// Deleting unexisting data
|
||||
var_dump(
|
||||
ldap_delete($link, "dc=my-domain,dc=com"),
|
||||
ldap_error($link),
|
||||
ldap_errno($link)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
?>
|
||||
@@ -0,0 +1,15 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
string(17) "Invalid DN syntax"
|
||||
int(34)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
string(14) "No such object"
|
||||
int(32)
|
||||
===DONE===
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// Too few args
|
||||
var_dump(ldap_err2str());
|
||||
|
||||
// Too many args
|
||||
var_dump(ldap_err2str(1, "Additional data"));
|
||||
|
||||
var_dump(ldap_err2str("weird"));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
@ldap_add($link, "badDN dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
));
|
||||
|
||||
var_dump(
|
||||
ldap_errno($link)
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,2 @@
|
||||
int(34)
|
||||
===DONE===
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
@ldap_add($link, "badDN dc=my-domain,dc=com", array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
));
|
||||
|
||||
var_dump(
|
||||
ldap_error($link)
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,2 @@
|
||||
string(17) "Invalid DN syntax"
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
ldap_first_attribute($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
string(11) "objectClass"
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_first_attribute($link));
|
||||
var_dump(ldap_first_attribute($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=person)");
|
||||
var_dump(
|
||||
$entry = ldap_first_entry($link, $result),
|
||||
ldap_get_values($link, $entry, 'sn')
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
resource(%d) of type (ldap result entry)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(7) "testSN%d"
|
||||
["count"]=>
|
||||
int(1)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_first_entry($link));
|
||||
var_dump(ldap_first_entry($link, $link, "Additional data"));
|
||||
var_dump(ldap_first_entry($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
ldap_add($link, "cn=userref,dc=my-domain,dc=com", array(
|
||||
"objectClass" => array("extensibleObject", "referral"),
|
||||
"cn" => "userref",
|
||||
"ref" => "cn=userA,dc=my-domain,dc=com",
|
||||
));
|
||||
ldap_set_option($link, LDAP_OPT_DEREF, LDAP_DEREF_NEVER);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(cn=*)");
|
||||
var_dump($ref = ldap_first_reference($link, $result));
|
||||
$refs = null;
|
||||
ldap_parse_reference($link, $ref, $refs);
|
||||
var_dump($refs);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
// Referral can only be removed with Manage DSA IT Control
|
||||
ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array(array("oid" => "2.16.840.1.113730.3.4.2")));
|
||||
ldap_delete($link, "cn=userref,dc=my-domain,dc=com");
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
resource(%d) of type (ldap result entry)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_first_reference($link));
|
||||
var_dump(ldap_first_reference($link, $link, "Additional data"));
|
||||
var_dump(ldap_first_reference($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=person)");
|
||||
var_dump(ldap_free_result($result));
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_free_result($link));
|
||||
var_dump(ldap_free_result($link, "Additional data"));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
ldap_get_attributes($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
array(7) {
|
||||
["objectClass"]=>
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "top"
|
||||
[1]=>
|
||||
string(8) "dcObject"
|
||||
[2]=>
|
||||
string(12) "organization"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectClass"
|
||||
["dc"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "dc"
|
||||
["o"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[2]=>
|
||||
string(1) "o"
|
||||
["count"]=>
|
||||
int(3)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_get_attributes($link));
|
||||
var_dump(ldap_get_attributes($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
ldap_get_dn($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
string(19) "dc=my-domain,dc=com"
|
||||
===DONE===
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_get_dn($link));
|
||||
var_dump(ldap_get_dn($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
var_dump(
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(o=my-domain)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(8) {
|
||||
["objectclass"]=>
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "top"
|
||||
[1]=>
|
||||
string(8) "dcObject"
|
||||
[2]=>
|
||||
string(12) "organization"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["dc"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "dc"
|
||||
["o"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[2]=>
|
||||
string(1) "o"
|
||||
["count"]=>
|
||||
int(3)
|
||||
["dn"]=>
|
||||
string(19) "dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_get_entries($link));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_get_entries($link, $link, "Additional data"));
|
||||
|
||||
// Bad parameter
|
||||
var_dump(ldap_get_entries($link, "string"));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
var_dump(
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(o=my-unexisting-domain)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,5 @@
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
$option = null;
|
||||
|
||||
$controls = array(
|
||||
array("oid" => "1.2.752.58.10.1", "iscritical" => true),
|
||||
array("oid" => "1.2.752.58.1.10", "value" => "magic"),
|
||||
);
|
||||
|
||||
ldap_set_option($link, LDAP_OPT_DEREF, LDAP_DEREF_NEVER);
|
||||
ldap_set_option($link, LDAP_OPT_SIZELIMIT, 123);
|
||||
ldap_set_option($link, LDAP_OPT_TIMELIMIT, 33);
|
||||
ldap_set_option($link, LDAP_OPT_NETWORK_TIMEOUT, 44);
|
||||
ldap_set_option($link, LDAP_OPT_REFERRALS, false);
|
||||
ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $controls);
|
||||
ldap_set_option($link, LDAP_OPT_CLIENT_CONTROLS, $controls);
|
||||
ldap_set_option($link, LDAP_OPT_RESTART, false);
|
||||
|
||||
var_dump(
|
||||
ldap_get_option($link, LDAP_OPT_DEREF, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_SIZELIMIT, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_TIMELIMIT, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_NETWORK_TIMEOUT, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_REFERRALS, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_RESTART, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $option),
|
||||
$option,
|
||||
ldap_get_option($link, LDAP_OPT_CLIENT_CONTROLS, $option),
|
||||
$option
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
bool(true)
|
||||
int(0)
|
||||
bool(true)
|
||||
int(123)
|
||||
bool(true)
|
||||
int(33)
|
||||
bool(true)
|
||||
int(44)
|
||||
bool(true)
|
||||
int(0)
|
||||
bool(true)
|
||||
int(0)
|
||||
bool(false)
|
||||
int(0)
|
||||
bool(false)
|
||||
int(0)
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
ldap_get_values_len($link, $entry, "o")
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,7 @@
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
["count"]=>
|
||||
int(1)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_get_values_len($link));
|
||||
var_dump(ldap_get_values_len($link, $entry));
|
||||
var_dump(ldap_get_values_len($link, $entry, "weirdAttribute", "Additional data"));
|
||||
|
||||
var_dump(ldap_get_values_len($link, $entry, "inexistantAttribute"));
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
var_dump(
|
||||
$result = ldap_list($link, "dc=my-domain,dc=com", "(objectClass=person)"),
|
||||
ldap_get_entries($link, $result)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,119 @@
|
||||
resource(%d) of type (ldap result)
|
||||
array(3) {
|
||||
["count"]=>
|
||||
int(2)
|
||||
[0]=>
|
||||
array(14) {
|
||||
["objectclass"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(6) "person"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userA"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "cn"
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN1"
|
||||
}
|
||||
[2]=>
|
||||
string(2) "sn"
|
||||
["userpassword"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(4) "oops"
|
||||
}
|
||||
[3]=>
|
||||
string(12) "userpassword"
|
||||
["telephonenumber"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(14) "xx-xx-xx-xx-xx"
|
||||
}
|
||||
[4]=>
|
||||
string(15) "telephonenumber"
|
||||
["description"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(6) "user A"
|
||||
}
|
||||
[5]=>
|
||||
string(11) "description"
|
||||
["count"]=>
|
||||
int(6)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
[1]=>
|
||||
array(12) {
|
||||
["objectclass"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(6) "person"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["cn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(5) "userB"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "cn"
|
||||
["sn"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(7) "testSN2"
|
||||
}
|
||||
[2]=>
|
||||
string(2) "sn"
|
||||
["userpassword"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(15) "oopsIDitItAgain"
|
||||
}
|
||||
[3]=>
|
||||
string(12) "userpassword"
|
||||
["description"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(6) "user B"
|
||||
}
|
||||
[4]=>
|
||||
string(11) "description"
|
||||
["count"]=>
|
||||
int(5)
|
||||
["dn"]=>
|
||||
string(28) "cn=userB,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$entry = array(
|
||||
"description" => "Domain description",
|
||||
);
|
||||
|
||||
var_dump(
|
||||
ldap_mod_add($link, "dc=my-domain,dc=com", $entry),
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(Description=Domain description)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
bool(true)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(10) {
|
||||
["objectclass"]=>
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "top"
|
||||
[1]=>
|
||||
string(8) "dcObject"
|
||||
[2]=>
|
||||
string(12) "organization"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["dc"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "dc"
|
||||
["o"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[2]=>
|
||||
string(1) "o"
|
||||
["description"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(18) "Domain description"
|
||||
}
|
||||
[3]=>
|
||||
string(11) "description"
|
||||
["count"]=>
|
||||
int(4)
|
||||
["dn"]=>
|
||||
string(19) "dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_mod_add());
|
||||
var_dump(ldap_mod_add($link));
|
||||
var_dump(ldap_mod_add($link, "dc=my-domain,dc=com"));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_mod_add($link, "dc=my-domain,dc=com", array(), "Additional data"));
|
||||
|
||||
// DN not found
|
||||
var_dump(ldap_mod_add($link, "dc=my-domain,dc=com", array()));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(ldap_mod_add($link, "weirdAttribute=val", array()));
|
||||
|
||||
$entry = array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
);
|
||||
|
||||
ldap_add($link, "dc=my-domain,dc=com", $entry);
|
||||
|
||||
$entry2 = $entry;
|
||||
$entry2["dc"] = "Wrong Domain";
|
||||
|
||||
var_dump(ldap_mod_add($link, "dc=my-domain,dc=com", $entry2));
|
||||
|
||||
$entry2 = $entry;
|
||||
$entry2["weirdAttribute"] = "weirdVal";
|
||||
|
||||
var_dump(ldap_mod_add($link, "dc=my-domain,dc=com", $entry2));
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$entry = array(
|
||||
"description" => "user A"
|
||||
);
|
||||
|
||||
var_dump(
|
||||
ldap_mod_del($link, "cn=userA,dc=my-domain,dc=com", $entry),
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(description=user A)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
bool(true)
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_mod_del());
|
||||
var_dump(ldap_mod_del($link));
|
||||
var_dump(ldap_mod_del($link, "dc=my-domain,dc=com"));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_mod_del($link, "dc=my-domain,dc=com", array(), "Additional data"));
|
||||
|
||||
// DN not found
|
||||
var_dump(ldap_mod_del($link, "dc=my-domain,dc=com", array()));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(ldap_mod_del($link, "weirdAttribute=val", array()));
|
||||
|
||||
// Invalid attributes
|
||||
var_dump(ldap_mod_del($link, "dc=my-domain,dc=com", array('dc')));
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,15 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$entry = array(
|
||||
"description" => "user X"
|
||||
);
|
||||
|
||||
var_dump(
|
||||
ldap_mod_replace($link, "cn=userA,dc=my-domain,dc=com", $entry),
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(description=user X)", array("description"))
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
bool(true)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(4) {
|
||||
["description"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(6) "user X"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "description"
|
||||
["count"]=>
|
||||
int(1)
|
||||
["dn"]=>
|
||||
string(28) "cn=userA,dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_mod_replace());
|
||||
var_dump(ldap_mod_replace($link));
|
||||
var_dump(ldap_mod_replace($link, "dc=my-domain,dc=com"));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_mod_replace($link, "dc=my-domain,dc=com", array(), "Additional data"));
|
||||
|
||||
// DN not found
|
||||
var_dump(ldap_mod_replace($link, "dc=my-domain,dc=com", array()));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(ldap_mod_replace($link, "weirdAttribute=val", array()));
|
||||
|
||||
// Invalid attributes
|
||||
var_dump(ldap_mod_replace($link, "dc=my-domain,dc=com", array('dc')));
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,15 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
|
||||
$entry = array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
"description" => "Domain description",
|
||||
);
|
||||
|
||||
var_dump(
|
||||
ldap_modify($link, "dc=my-domain,dc=com", $entry),
|
||||
ldap_get_entries(
|
||||
$link,
|
||||
ldap_search($link, "dc=my-domain,dc=com", "(Description=Domain description)")
|
||||
)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
bool(true)
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(10) {
|
||||
["objectclass"]=>
|
||||
array(4) {
|
||||
["count"]=>
|
||||
int(3)
|
||||
[0]=>
|
||||
string(3) "top"
|
||||
[1]=>
|
||||
string(8) "dcObject"
|
||||
[2]=>
|
||||
string(12) "organization"
|
||||
}
|
||||
[0]=>
|
||||
string(11) "objectclass"
|
||||
["dc"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[1]=>
|
||||
string(2) "dc"
|
||||
["o"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(9) "my-domain"
|
||||
}
|
||||
[2]=>
|
||||
string(1) "o"
|
||||
["description"]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(18) "Domain description"
|
||||
}
|
||||
[3]=>
|
||||
string(11) "description"
|
||||
["count"]=>
|
||||
int(4)
|
||||
["dn"]=>
|
||||
string(19) "dc=my-domain,dc=com"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
// Too few parameters
|
||||
var_dump(ldap_modify());
|
||||
var_dump(ldap_modify($link));
|
||||
var_dump(ldap_modify($link, "dc=my-domain,dc=com"));
|
||||
|
||||
// Too many parameters
|
||||
var_dump(ldap_modify($link, "dc=my-domain,dc=com", array(), "Additional data"));
|
||||
|
||||
// DN not found
|
||||
var_dump(ldap_modify($link, "dc=my-domain,dc=com", array()));
|
||||
|
||||
// Invalid DN
|
||||
var_dump(ldap_modify($link, "weirdAttribute=val", array()));
|
||||
|
||||
$entry = array(
|
||||
"objectClass" => array(
|
||||
"top",
|
||||
"dcObject",
|
||||
"organization"),
|
||||
"dc" => "my-domain",
|
||||
"o" => "my-domain",
|
||||
);
|
||||
|
||||
ldap_add($link, "dc=my-domain,dc=com", $entry);
|
||||
|
||||
$entry2 = $entry;
|
||||
$entry2["dc"] = "Wrong Domain";
|
||||
|
||||
var_dump(ldap_modify($link, "dc=my-domain,dc=com", $entry2));
|
||||
|
||||
$entry2 = $entry;
|
||||
$entry2["weirdAttribute"] = "weirdVal";
|
||||
|
||||
var_dump(ldap_modify($link, "dc=my-domain,dc=com", $entry2));
|
||||
?>
|
||||
===DONE===<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
|
||||
ldap_delete($link, "dc=my-domain,dc=com");
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
$attribute = ldap_first_attribute($link, $entry);
|
||||
var_dump(
|
||||
ldap_next_attribute($link, $entry),
|
||||
ldap_next_attribute($link, $entry),
|
||||
ldap_next_attribute($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,4 @@
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_search($link, "dc=my-domain,dc=com", "(objectclass=organization)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
ldap_next_attribute($link),
|
||||
ldap_next_attribute($link, $link),
|
||||
ldap_next_attribute($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
HipHop Warning: %a
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
insert_dummy_data($link);
|
||||
$result = ldap_list($link, "dc=my-domain,dc=com", "(objectClass=person)");
|
||||
$entry = ldap_first_entry($link, $result);
|
||||
var_dump(
|
||||
$entry = ldap_next_entry($link, $entry),
|
||||
ldap_get_values($link, $entry, 'sn'),
|
||||
$entry = ldap_next_entry($link, $entry)
|
||||
);
|
||||
?>
|
||||
===DONE===<?php
|
||||
include "connect.inc";
|
||||
|
||||
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
|
||||
remove_dummy_data($link);
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
resource(%d) of type (ldap result entry)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(7) "testSN%d"
|
||||
["count"]=>
|
||||
int(1)
|
||||
}
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require "connect.inc";
|
||||
|
||||
$link = ldap_connect($host, $port);
|
||||
var_dump(ldap_next_entry($link));
|
||||
var_dump(ldap_next_entry($link, $link, "Additional data"));
|
||||
var_dump(ldap_next_entry($link, $link));
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,7 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===DONE===
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário