Révision 32700c57
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ldap/ldap_help/ldap_test_script/config.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* test script for testing ldap functionality outside of Drupal |
|
6 |
* |
|
5 |
* Test script for testing ldap functionality outside of Drupal. |
|
7 | 6 |
*/ |
8 | 7 |
|
9 |
die('Move this script outside of Drupal and uncomment the die statement in config.inc to run.'); // remove this line after moving out the scripts outside of drupal root. |
|
8 |
// Remove this line after moving out the scripts outside of drupal root. |
|
9 |
die('Move this script outside of Drupal and uncomment the die statement in config.inc to run.'); |
|
10 | 10 |
|
11 |
/** |
|
12 |
* |
|
13 |
*/ |
|
11 | 14 |
function ldap_help_config() { |
12 | 15 |
|
13 |
// these variables are just for convenience, they can be hard coded directly into the $config array
|
|
16 |
// These variables are just for convenience, they can be hard coded directly into the $config array.
|
|
14 | 17 |
$provision_root = 'ou=test,ou=drupal,dc=ad,dc=mycollege,dc=edu'; |
15 | 18 |
$query_root = 'dc=ad,dc=mycollege,dc=edu'; |
16 | 19 |
$user_root = 'ou=people,dc=mycollege,dc=edu'; |
... | ... | |
18 | 21 |
$bind_pwd = 'password'; |
19 | 22 |
$server_address = 'ad.mycollege.edu'; |
20 | 23 |
|
21 |
$config = array(
|
|
22 |
'servers' => array(
|
|
23 |
'default test' => array(
|
|
24 |
$config = [
|
|
25 |
'servers' => [
|
|
26 |
'default test' => [
|
|
24 | 27 |
'server_address' => $server_address, |
25 | 28 |
'server_port' => 389, |
26 | 29 |
'server_tls' => FALSE, |
27 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, // LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON |
|
30 |
// LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON. |
|
31 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, |
|
28 | 32 |
'server_base_dn' => $user_root, |
29 | 33 |
'server_bind_dn' => $bind_user, |
30 | 34 |
'server_bind_pw' => $bind_pwd, |
31 |
'test_queries' => array(
|
|
32 |
'user' => array(
|
|
35 |
'test_queries' => [
|
|
36 |
'user' => [
|
|
33 | 37 |
'filter' => 'cn=jbarclay', |
34 |
'show_attr' => array('dn', 'cn', 'displayname', 'sn', 'givenname', 'mail', 'samaccountname', 'email'),
|
|
35 |
),
|
|
36 |
),
|
|
37 |
'test_provisions' => array(),
|
|
38 |
),
|
|
39 |
'query test' => array(
|
|
38 |
'show_attr' => ['dn', 'cn', 'displayname', 'sn', 'givenname', 'mail', 'samaccountname', 'email'],
|
|
39 |
],
|
|
40 |
],
|
|
41 |
'test_provisions' => [],
|
|
42 |
],
|
|
43 |
'query test' => [
|
|
40 | 44 |
'server_address' => $server_address, |
41 | 45 |
'server_port' => 389, |
42 | 46 |
'server_tls' => FALSE, |
43 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, // LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON |
|
47 |
// LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON. |
|
48 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, |
|
44 | 49 |
'server_base_dn' => $query_root, |
45 | 50 |
'server_bind_dn' => $bind_user, |
46 | 51 |
'server_bind_pw' => $bind_pwd, |
47 |
'test_queries' => array(
|
|
48 |
'group' => array(
|
|
52 |
'test_queries' => [
|
|
53 |
'group' => [
|
|
49 | 54 |
'filter' => 'cn=ed-it-nag', |
50 |
'show_attr' => array('dn', 'cn', 'samaccountname'),
|
|
51 |
),
|
|
52 |
),
|
|
53 |
'test_provisions' => array(),
|
|
54 |
),
|
|
55 |
'provision test' => array(
|
|
55 |
'show_attr' => ['dn', 'cn', 'samaccountname'],
|
|
56 |
],
|
|
57 |
],
|
|
58 |
'test_provisions' => [],
|
|
59 |
],
|
|
60 |
'provision test' => [
|
|
56 | 61 |
'server_address' => $server_address, |
57 | 62 |
'server_port' => 389, |
58 | 63 |
'server_tls' => FALSE, |
59 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, // LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON |
|
64 |
// LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT OR LDAP_SERVERS_BIND_METHOD_ANON. |
|
65 |
'server_bind_method' => LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT, |
|
60 | 66 |
'server_base_dn' => $provision_root, |
61 | 67 |
'server_bind_dn' => $bind_user, |
62 | 68 |
'server_bind_pw' => $bind_pwd, |
63 |
'test_queries' => array(),
|
|
64 |
'test_provisions' => array(
|
|
65 |
'simple_user' => array(
|
|
69 |
'test_queries' => [],
|
|
70 |
'test_provisions' => [
|
|
71 |
'simple_user' => [
|
|
66 | 72 |
'delete_if_exists' => TRUE, |
67 | 73 |
'find_filter' => "distinguishedName=cn=ed-drupal-user-17,$provision_root", |
68 | 74 |
'dn' => "cn=ed-drupal-user-17, $provision_root", |
69 |
'attr' => array(
|
|
75 |
'attr' => [
|
|
70 | 76 |
"displayName" => "Drupal User", |
71 | 77 |
"cn" => 'ed-drupal-user-17', |
72 | 78 |
"samaccountname" => 'ed-drupal-user-17', |
73 |
"objectclass" => array(
|
|
79 |
"objectclass" => [
|
|
74 | 80 |
"top", "person", "organizationalPerson", "user", |
75 |
),
|
|
81 |
],
|
|
76 | 82 |
"description" => "test user", |
77 | 83 |
'mail' => 'ed-drupal-user-17@blah.com', |
78 | 84 |
'givenName' => 'Drupal', |
79 | 85 |
'sn' => 'User', |
80 | 86 |
'distinguishedName' => "cn=ed-drupal-user-17,$provision_root", |
81 |
),
|
|
82 |
),
|
|
83 |
'simple_group' => array(
|
|
87 |
],
|
|
88 |
],
|
|
89 |
'simple_group' => [
|
|
84 | 90 |
'delete_if_exists' => TRUE, |
85 | 91 |
'find_filter' => "distinguishedName=cn=ed-drupal-group2,$provision_root", |
86 | 92 |
'dn' => "cn=ed-drupal-group2,$provision_root", |
87 |
'attr' => array(
|
|
93 |
'attr' => [
|
|
88 | 94 |
"cn" => 'ed-drupal-group2', |
89 | 95 |
"sAMAccountName" => 'ed-drupal-group2', |
90 | 96 |
'instanceType' => '4', |
91 |
"objectClass" => array(
|
|
97 |
"objectClass" => [
|
|
92 | 98 |
"top", "group", |
93 |
),
|
|
99 |
],
|
|
94 | 100 |
'name' => 'ed-drupal-group2', |
95 | 101 |
'distinguishedName' => "cn=ed-drupal-group2,$provision_root", |
96 |
),
|
|
97 |
),
|
|
98 |
),
|
|
99 |
),
|
|
100 |
),
|
|
101 |
);
|
|
102 |
],
|
|
103 |
],
|
|
104 |
],
|
|
105 |
],
|
|
106 |
],
|
|
107 |
];
|
|
102 | 108 |
|
103 | 109 |
return $config; |
104 | 110 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules