function ldap_servers_update_7203 in Lightweight Directory Access Protocol (LDAP) 8.2
Same name and namespace in other branches
- 7.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 726 - Install, update and uninstall functions for the LDAP API module.
Code
function ldap_servers_update_7203() {
$schema = ldap_servers_schema();
$changes = array(
'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 (db_field_exists('ldap_servers', $old_field_name)) {
if (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);
}
}
}
}