1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
*
|
5
|
*/
|
6
|
|
7
|
module_load_include('php', 'og', 'module'); // for og constants
|
8
|
|
9
|
function ldap_test_ldap_authorization_data() {
|
10
|
|
11
|
$empty_mappings = array(
|
12
|
'from' => '',
|
13
|
'user_entered' => '',
|
14
|
'normalized' => '',
|
15
|
'simplified' => '',
|
16
|
'valid' => '',
|
17
|
'error_message' => '',
|
18
|
);
|
19
|
$OG_AUTHENTICATED_ROLE = 'member'; // cant use constant OG_AUTHENTICATED_ROLE here
|
20
|
$conf['og_group2']['og_group'] = array(
|
21
|
|
22
|
'sid' => 'activedirectory1',
|
23
|
'consumerType' => 'og_group',
|
24
|
'consumerModule' => 'ldap_authorization_og_group',
|
25
|
|
26
|
'description' => 'Hogwarts AD',
|
27
|
'status' => 1,
|
28
|
'onlyApplyToLdapAuthenticated' => 1,
|
29
|
|
30
|
'mappings' => array(
|
31
|
array(
|
32
|
'from' => 'cn=students,ou=groups,dc=hogwarts,dc=edu',
|
33
|
'user_entered' => 'students',
|
34
|
'normalized' => 'node:students:' . $OG_AUTHENTICATED_ROLE,
|
35
|
'simplified' => '',
|
36
|
'valid' => '',
|
37
|
'error_message' => '',
|
38
|
),
|
39
|
array(
|
40
|
'from' => 'cn=faculty,ou=groups,dc=hogwarts,dc=edu',
|
41
|
'user_entered' => 'faculty',
|
42
|
'normalized' => 'node:faculty:' . $OG_AUTHENTICATED_ROLE,
|
43
|
'simplified' => '',
|
44
|
'valid' => '',
|
45
|
'error_message' => '',
|
46
|
),
|
47
|
array(
|
48
|
'from' => 'cn=gryffindor,ou=groups,dc=hogwarts,dc=edu',
|
49
|
'user_entered' => 'gryffindor',
|
50
|
'normalized' => 'node:gryffindor:' . $OG_AUTHENTICATED_ROLE,
|
51
|
'simplified' => '',
|
52
|
'valid' => '',
|
53
|
'error_message' => '',
|
54
|
),
|
55
|
array(
|
56
|
'from' => 'cn=users,ou=groups,dc=hogwarts,dc=edu',
|
57
|
'user_entered' => 'users',
|
58
|
'normalized' => 'node:users:' . $OG_AUTHENTICATED_ROLE,
|
59
|
'simplified' => '',
|
60
|
'valid' => '',
|
61
|
'error_message' => '',
|
62
|
),
|
63
|
),
|
64
|
|
65
|
'useMappingsAsFilter' => 1,
|
66
|
|
67
|
'synchOnLogon' => 1,
|
68
|
|
69
|
'revokeLdapProvisioned' => 1,
|
70
|
'createConsumers' => 0,
|
71
|
'regrantLdapProvisioned' => 1,
|
72
|
|
73
|
);
|
74
|
|
75
|
$conf['og_group15']['og_group'] = $conf['og_group2']['og_group'];
|
76
|
$conf['og_group15']['og_group']['mappings'] = array(
|
77
|
array(
|
78
|
'from' => 'cn=students,ou=groups,dc=hogwarts,dc=edu',
|
79
|
'user_entered' => 'group-name=students,role-name=member',
|
80
|
'simplified' => '',
|
81
|
'valid' => '',
|
82
|
'error_message' => '',
|
83
|
),
|
84
|
array(
|
85
|
'from' => 'cn=faculty,ou=groups,dc=hogwarts,dc=edu',
|
86
|
'user_entered' => 'group-name=faculty,role-name=member',
|
87
|
'simplified' => '',
|
88
|
'valid' => '',
|
89
|
'error_message' => '',
|
90
|
),
|
91
|
array(
|
92
|
'from' => 'cn=gryffindor,ou=groups,dc=hogwarts,dc=edu',
|
93
|
'user_entered' => 'group-name=gryffindor,role-name=member',
|
94
|
'simplified' => '',
|
95
|
'valid' => '',
|
96
|
'error_message' => '',
|
97
|
),
|
98
|
array(
|
99
|
'from' => 'cn=users,ou=groups,dc=hogwarts,dc=edu',
|
100
|
'user_entered' => 'group-name=users,role-name=member',
|
101
|
'simplified' => '',
|
102
|
'valid' => '',
|
103
|
'error_message' => '',
|
104
|
),
|
105
|
);
|
106
|
|
107
|
|
108
|
$conf['drupal_role_default']['drupal_role'] = array(
|
109
|
|
110
|
'sid' => 'activedirectory1',
|
111
|
'consumerType' => 'drupal_role',
|
112
|
'consumerModule' => 'ldap_authorization_drupal_role',
|
113
|
|
114
|
'description' => 'Hogwarts AD',
|
115
|
'status' => 1,
|
116
|
'onlyApplyToLdapAuthenticated' => 1,
|
117
|
|
118
|
'mappings' => array(
|
119
|
array(
|
120
|
'from' => 'cn=students,ou=groups,dc=hogwarts,dc=edu',
|
121
|
'user_entered' => 'students',
|
122
|
'normalized' => 'students',
|
123
|
'simplified' => 'students',
|
124
|
'valid' => TRUE,
|
125
|
'error_message' => '',
|
126
|
),
|
127
|
array(
|
128
|
'from' => 'cn=faculty,ou=groups,dc=hogwarts,dc=edu',
|
129
|
'user_entered' => 'administrator',
|
130
|
'normalized' => 'administrator',
|
131
|
'simplified' => 'administrator',
|
132
|
'valid' => TRUE,
|
133
|
'error_message' => '',
|
134
|
),
|
135
|
array(
|
136
|
'from' => 'gryffindor',
|
137
|
'user_entered' => 'gryffindor',
|
138
|
'normalized' => 'gryffindor',
|
139
|
'simplified' => 'gryffindor',
|
140
|
'valid' => TRUE,
|
141
|
'error_message' => '',
|
142
|
),
|
143
|
array(
|
144
|
'from' => 'cn=users,ou=groups,dc=hogwarts,dc=edu',
|
145
|
'user_entered' => 'users',
|
146
|
'normalized' => 'users',
|
147
|
'simplified' => 'users',
|
148
|
'valid' => TRUE,
|
149
|
'error_message' => '',
|
150
|
),
|
151
|
),
|
152
|
|
153
|
|
154
|
'useMappingsAsFilter' => 0,
|
155
|
|
156
|
'synchOnLogon' => 1,
|
157
|
|
158
|
'revokeLdapProvisioned' => 1,
|
159
|
'createConsumers' => 1,
|
160
|
'regrantLdapProvisioned' => 1,
|
161
|
);
|
162
|
|
163
|
$conf['drupal_role_authentication_test']['drupal_role'] = array(
|
164
|
'sid' => 'activedirectory1',
|
165
|
'consumerType' => 'drupal_role',
|
166
|
'consumerModule' => 'ldap_authorization_drupal_role',
|
167
|
|
168
|
'description' => 'Hogwarts AD',
|
169
|
'status' => 1,
|
170
|
'onlyApplyToLdapAuthenticated' => 1,
|
171
|
|
172
|
'mappings' => array(
|
173
|
array(
|
174
|
'from' => 'cn=students,ou=groups,dc=hogwarts,dc=edu',
|
175
|
'user_entered' => 'students',
|
176
|
'normalized' => 'node:students:' . $OG_AUTHENTICATED_ROLE,
|
177
|
'simplified' => 'students',
|
178
|
'valid' => TRUE,
|
179
|
'error_message' => '',
|
180
|
),
|
181
|
array(
|
182
|
'from' => 'gryffindor',
|
183
|
'user_entered' => 'gryffindor',
|
184
|
'normalized' => 'node:gryffindor:' . $OG_AUTHENTICATED_ROLE,
|
185
|
'simplified' => 'gryffindor',
|
186
|
'valid' => TRUE,
|
187
|
'error_message' => '',
|
188
|
),
|
189
|
array(
|
190
|
'from' => 'cn=users,ou=groups,dc=hogwarts,dc=edu',
|
191
|
'user_entered' => 'users',
|
192
|
'normalized' => 'node:users:' . $OG_AUTHENTICATED_ROLE,
|
193
|
'simplified' => 'users',
|
194
|
'valid' => TRUE,
|
195
|
'error_message' => '',
|
196
|
),
|
197
|
),
|
198
|
|
199
|
'useMappingsAsFilter' => 1,
|
200
|
|
201
|
'synchOnLogon' => 1,
|
202
|
|
203
|
'revokeLdapProvisioned' => 1,
|
204
|
'createConsumers' => 1,
|
205
|
'regrantLdapProvisioned' => 1,
|
206
|
);
|
207
|
|
208
|
return $conf;
|
209
|
}
|