You are here

function ldap_user_install in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_user/ldap_user.install \ldap_user_install()

Implements hook_install().

File

ldap_user/ldap_user.install, line 46
Install, update and uninstall functions for the LDAP User module.

Code

function ldap_user_install() {
  foreach (ldap_user_user_entity_fields() as $field_id => $field_conf) {
    $field_info = field_info_field($field_id);
    if (!$field_info) {
      field_create_field($field_conf['field']);
      field_create_instance($field_conf['instance']);
    }
  }

  // make ldap user weight slightly less than other ldap modules so it can load
  // user's associated ldap data first and save on ldap queries.
  db_query("UPDATE {system} SET weight = -1 WHERE name = 'ldap_user'");
  _ldap_user_install_update_authmap();
}