function ldap_servers_update_7203 in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_servers/ldap_servers.install \ldap_servers_update_7203()
Make all schema field names lowercase in ldap server to deal with cronic case sensitivity issues.
File
- ldap_servers/
ldap_servers.install, line 776 - Install, update and uninstall functions for the LDAP API module.
Code
function ldap_servers_update_7203() {
$schema = ldap_servers_schema();
$changes = [
'testingDrupalUserDn' => 'testing_drupal_user_dn',
'group_object_category' => 'grp_object_cat',
'groupFunctionalityUnused' => 'grp_unused',
'groupNested' => 'grp_nested',
'groupUserMembershipsAttrExists' => 'grp_user_memb_attr_exists',
'groupUserMembershipsAttr' => 'grp_user_memb_attr',
'groupMembershipsAttr' => 'grp_memb_attr',
'groupMembershipsAttrMatchingUserAttr' => 'grp_memb_attr_match_user_attr',
'groupDeriveFromDn' => 'grp_derive_from_dn',
'groupDeriveFromDnAttr' => 'grp_derive_from_dn_attr',
'groupTestGroupDn' => 'grp_test_grp_dn',
'groupTestGroupDnWriteable' => 'grp_test_grp_dn_writeable',
];
foreach ($changes as $old_field_name => $new_field_name) {
$field_schema = $schema['ldap_servers']['fields'][$new_field_name];
if (ldap_servers_db_field_exists('ldap_servers', $old_field_name)) {
if (ldap_servers_db_field_exists('ldap_servers', $new_field_name)) {
db_drop_field('ldap_servers', $old_field_name);
}
else {
db_change_field('ldap_servers', $old_field_name, $new_field_name, $field_schema);
}
}
}
}