Révision 32700c57
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.install | ||
---|---|---|
9 | 9 |
* Implements hook_requirements(). |
10 | 10 |
*/ |
11 | 11 |
function ldap_authorization_requirements($phase) { |
12 |
$requirements = array();
|
|
12 |
$requirements = [];
|
|
13 | 13 |
|
14 | 14 |
if ($phase != "install" && db_field_exists('ldapauth', 'ldapgroups_in_dn')) { |
15 | 15 |
$requirements['ldap_authorization_ldap_integration']['title'] = t('LDAP Integration LDAP Groups Upgrade Concern'); |
... | ... | |
68 | 68 |
*/ |
69 | 69 |
function ldap_authorization_user_entity_fields() { |
70 | 70 |
|
71 |
$fields = array();
|
|
71 |
$fields = [];
|
|
72 | 72 |
|
73 | 73 |
return $fields; |
74 | 74 |
} |
... | ... | |
78 | 78 |
*/ |
79 | 79 |
function ldap_authorization_schema() { |
80 | 80 |
|
81 |
$schema['ldap_authorization'] = array(
|
|
82 |
'export' => array(
|
|
81 |
$schema['ldap_authorization'] = [
|
|
82 |
'export' => [
|
|
83 | 83 |
'key' => 'consumer_type', |
84 | 84 |
'key name' => 'Mapping ID', |
85 | 85 |
'identifier' => 'consumer_type', |
86 | 86 |
'primary key' => 'numeric_consumer_conf_id', |
87 |
'api' => array(
|
|
87 |
'api' => [
|
|
88 | 88 |
'owner' => 'ldap_authorization', |
89 | 89 |
'api' => 'ldap_authorization', |
90 | 90 |
'minimum_version' => 1, |
91 | 91 |
'current_version' => 1, |
92 |
),
|
|
93 |
),
|
|
92 |
],
|
|
93 |
],
|
|
94 | 94 |
|
95 | 95 |
'description' => "Data used to map users ldap entry to authorization rights.", |
96 |
'primary key' => array('numeric_consumer_conf_id'),
|
|
97 |
'foreign keys' => array(
|
|
98 |
'sid' => array(
|
|
96 |
'primary key' => ['numeric_consumer_conf_id'],
|
|
97 |
'foreign keys' => [
|
|
98 |
'sid' => [
|
|
99 | 99 |
'table' => 'ldap_servers', |
100 |
'columns' => array('sid' => 'sid'),
|
|
101 |
),
|
|
102 |
),
|
|
103 |
);
|
|
100 |
'columns' => ['sid' => 'sid'],
|
|
101 |
],
|
|
102 |
],
|
|
103 |
];
|
|
104 | 104 |
|
105 | 105 |
module_load_include('inc', 'ldap_servers', 'ldap_servers.functions'); |
106 | 106 |
module_load_include('php', 'ldap_authorization', 'LdapAuthorizationConsumerConfAdmin.class'); |
... | ... | |
121 | 121 |
function ldap_authorization_update_7100() { |
122 | 122 |
|
123 | 123 |
if (!db_field_exists('ldap_authorization', 'create_consumers')) { |
124 |
db_add_field('ldap_authorization', 'create_consumers', array(
|
|
124 |
db_add_field('ldap_authorization', 'create_consumers', [
|
|
125 | 125 |
'type' => 'int', |
126 | 126 |
'size' => 'tiny', |
127 | 127 |
'not null' => TRUE, |
128 | 128 |
'default' => 0, |
129 |
));
|
|
129 |
]);
|
|
130 | 130 |
return t('"create_consumers" field added to ldap_authorization table'); |
131 | 131 |
} |
132 | 132 |
else { |
... | ... | |
141 | 141 |
function ldap_authorization_update_7101() { |
142 | 142 |
|
143 | 143 |
if (!db_field_exists('ldap_authorization', 'derive_from_attr_use_first_attr')) { |
144 |
db_add_field('ldap_authorization', 'derive_from_attr_use_first_attr', array(
|
|
144 |
db_add_field('ldap_authorization', 'derive_from_attr_use_first_attr', [
|
|
145 | 145 |
'type' => 'int', |
146 | 146 |
'size' => 'tiny', |
147 | 147 |
'not null' => TRUE, |
148 | 148 |
'default' => 0, |
149 |
));
|
|
149 |
]);
|
|
150 | 150 |
return t('"derive_from_attr_use_first_attr" field added to ldap_authorization table'); |
151 | 151 |
} |
152 | 152 |
else { |
... | ... | |
161 | 161 |
function ldap_authorization_update_7102() { |
162 | 162 |
|
163 | 163 |
if (!db_field_exists('ldap_authorization', 'derive_from_entry_search_all')) { |
164 |
db_add_field('ldap_authorization', 'derive_from_entry_search_all', array(
|
|
164 |
db_add_field('ldap_authorization', 'derive_from_entry_search_all', [
|
|
165 | 165 |
'type' => 'int', |
166 | 166 |
'size' => 'tiny', |
167 | 167 |
'not null' => TRUE, |
168 | 168 |
'default' => 0, |
169 |
));
|
|
169 |
]);
|
|
170 | 170 |
return t('"derive_from_entry_search_all" field added to ldap_authorization table'); |
171 | 171 |
} |
172 | 172 |
else { |
... | ... | |
180 | 180 |
*/ |
181 | 181 |
function ldap_authorization_update_7103() { |
182 | 182 |
|
183 |
foreach (array('derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries') as $field_name) {
|
|
184 |
db_change_field('ldap_authorization', $field_name, $field_name, array(
|
|
183 |
foreach (['derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries'] as $field_name) {
|
|
184 |
db_change_field('ldap_authorization', $field_name, $field_name, [
|
|
185 | 185 |
'type' => 'text', |
186 | 186 |
'not null' => FALSE, |
187 |
));
|
|
187 |
]);
|
|
188 | 188 |
} |
189 | 189 |
|
190 | 190 |
} |
... | ... | |
195 | 195 |
*/ |
196 | 196 |
function ldap_authorization_update_7104() { |
197 | 197 |
|
198 |
foreach (array('derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries') as $field_name) {
|
|
199 |
db_change_field('ldap_authorization', $field_name, $field_name, array(
|
|
198 |
foreach (['derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries'] as $field_name) {
|
|
199 |
db_change_field('ldap_authorization', $field_name, $field_name, [
|
|
200 | 200 |
'type' => 'text', |
201 | 201 |
'not null' => FALSE, |
202 |
));
|
|
202 |
]);
|
|
203 | 203 |
} |
204 | 204 |
|
205 | 205 |
} |
... | ... | |
210 | 210 |
function ldap_authorization_update_7105() { |
211 | 211 |
|
212 | 212 |
if (!db_field_exists('ldap_authorization', 'derive_from_entry_user_ldap_attr')) { |
213 |
db_add_field('ldap_authorization', 'derive_from_entry_user_ldap_attr', array(
|
|
213 |
db_add_field('ldap_authorization', 'derive_from_entry_user_ldap_attr', [
|
|
214 | 214 |
'type' => 'varchar', |
215 | 215 |
'length' => 255, |
216 | 216 |
'default' => NULL, |
217 |
));
|
|
217 |
]);
|
|
218 | 218 |
return t('"derive_from_entry_user_ldap_attr" field added to ldap_authorization table'); |
219 | 219 |
} |
220 | 220 |
else { |
... | ... | |
229 | 229 |
function ldap_authorization_update_7106() { |
230 | 230 |
|
231 | 231 |
if (!db_field_exists('ldap_authorization', 'derive_from_attr_nested')) { |
232 |
db_add_field('ldap_authorization', 'derive_from_attr_nested', array(
|
|
232 |
db_add_field('ldap_authorization', 'derive_from_attr_nested', [
|
|
233 | 233 |
'type' => 'int', |
234 | 234 |
'size' => 'tiny', |
235 | 235 |
'not null' => TRUE, |
236 | 236 |
'default' => 0, |
237 |
));
|
|
237 |
]);
|
|
238 | 238 |
$msg = t('"derive_from_attr_nested" field added to ldap_authorization table'); |
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
if (!db_field_exists('ldap_authorization', 'derive_from_entry_nested')) { |
242 |
db_add_field('ldap_authorization', 'derive_from_entry_nested', array(
|
|
242 |
db_add_field('ldap_authorization', 'derive_from_entry_nested', [
|
|
243 | 243 |
'type' => 'int', |
244 | 244 |
'size' => 'tiny', |
245 | 245 |
'not null' => TRUE, |
246 | 246 |
'default' => 0, |
247 |
));
|
|
247 |
]);
|
|
248 | 248 |
$msg .= t('"derive_from_entry_nested" field added to ldap_authorization table'); |
249 | 249 |
} |
250 | 250 |
|
... | ... | |
259 | 259 |
$changes = ''; |
260 | 260 |
|
261 | 261 |
if (!db_field_exists('ldap_authorization', 'derive_from_entry_use_first_attr')) { |
262 |
db_add_field('ldap_authorization', 'derive_from_entry_use_first_attr', array(
|
|
262 |
db_add_field('ldap_authorization', 'derive_from_entry_use_first_attr', [
|
|
263 | 263 |
'type' => 'int', |
264 | 264 |
'size' => 'tiny', |
265 | 265 |
'not null' => TRUE, |
266 | 266 |
'default' => 0, |
267 |
));
|
|
267 |
]);
|
|
268 | 268 |
$changes .= t('"derive_from_entry_use_first_attr" field added to ldap_authorization table'); |
269 | 269 |
} |
270 | 270 |
|
... | ... | |
283 | 283 |
function ldap_authorization_update_7108() { |
284 | 284 |
|
285 | 285 |
if (!db_field_exists('ldap_authorization', 'derive_from_entry_entries_attr')) { |
286 |
db_add_field('ldap_authorization', 'derive_from_entry_entries_attr', array(
|
|
286 |
db_add_field('ldap_authorization', 'derive_from_entry_entries_attr', [
|
|
287 | 287 |
'type' => 'varchar', |
288 | 288 |
'length' => 255, |
289 | 289 |
'default' => NULL, |
290 |
));
|
|
290 |
]);
|
|
291 | 291 |
return t('"derive_from_entry_entries_attr" field added to ldap_authorization table'); |
292 | 292 |
} |
293 | 293 |
else { |
... | ... | |
306 | 306 |
$results = ''; |
307 | 307 |
|
308 | 308 |
if (!db_field_exists('ldap_authorization', 'useFirstAttrAsGroupId')) { |
309 |
db_add_field('ldap_authorization', 'useFirstAttrAsGroupId', array(
|
|
309 |
db_add_field('ldap_authorization', 'useFirstAttrAsGroupId', [
|
|
310 | 310 |
'type' => 'int', |
311 | 311 |
'size' => tiny, |
312 | 312 |
'not null' => TRUE, |
313 | 313 |
'default' => 0, |
314 |
));
|
|
314 |
]);
|
|
315 | 315 |
$results .= t('"useFirstAttrAsGroupId" field added to ldap_authorization table'); |
316 | 316 |
} |
317 | 317 |
|
318 | 318 |
if (!db_field_exists('ldap_authorization', 'searchAll')) { |
319 |
db_add_field('ldap_authorization', 'searchAll', array(
|
|
319 |
db_add_field('ldap_authorization', 'searchAll', [
|
|
320 | 320 |
'type' => 'int', |
321 | 321 |
'size' => tiny, |
322 | 322 |
'not null' => TRUE, |
323 | 323 |
'default' => 0, |
324 |
));
|
|
324 |
]);
|
|
325 | 325 |
$results .= t('"searchAll" field added to ldap_authorization table'); |
326 | 326 |
} |
327 | 327 |
} |
... | ... | |
331 | 331 |
*/ |
332 | 332 |
function ldap_authorization_update_7202() { |
333 | 333 |
|
334 |
$instance = array(
|
|
334 |
$instance = [
|
|
335 | 335 |
'field_name' => 'ldap_authorizations', |
336 | 336 |
'entity_type' => 'user', |
337 | 337 |
'bundle' => 'user', |
338 |
);
|
|
338 |
];
|
|
339 | 339 |
field_delete_instance($instance, TRUE); |
340 | 340 |
field_delete_field('ldap_authorizations'); |
341 | 341 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules