You are here

function ldap_authorization_uninstall in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization.install \ldap_authorization_uninstall()
  2. 6 ldap_authorization/ldap_authorization.install \ldap_authorization_uninstall()

Implements hook_uninstall().

File

ldap_authorization/ldap_authorization.install, line 47
Install, update and uninstall functions for the LDAP authorization module.

Code

function ldap_authorization_uninstall() {
  foreach (ldap_authorization_user_entity_fields() as $field_id => $field_conf) {
    $instance = field_info_instance($field_conf['instance']['entity_type'], $field_conf['instance']['field_name'], $field_conf['instance']['bundle']);
    if ($instance) {
      field_delete_instance($instance);
    }
    $field_info = field_info_field($field_conf['field']['field_name']);
    if ($field_info) {
      field_delete_field($field_conf['field']['field_name']);
    }
  }
  module_load_include('inc', 'ldap_servers', 'ldap_servers.user_data_remove');
  batch_set(ldap_severs_user_data_setup_batch());
  $batch =& batch_get();
}