You are here

function ldap_user_requirements 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_requirements()

Implements hook_requirements().

File

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

Code

function ldap_user_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {

    // check for all $user->* fields created
    $missing_fields = ldap_user_update_check_user_fields(TRUE);
    if (count($missing_fields)) {
      $requirements['ldap_user']['title'] = t('User Fields for LDAP User Module Missing');
      $requirements['ldap_user']['severity'] = REQUIREMENT_ERROR;
      $requirements['ldap_user']['value'] = NULL;
      $requirements['ldap_user']['description'] = t('Fields are added to the
        Drupal User entity for LDAP User module functionality.  These fields should
        have been created in LDAP User update 7203. The following userfields are missing:') . theme('item_list', array(
        'items' => $missing_fields,
        'type' => 'ul',
        'title' => NULL,
      )) . t('Rerun update 7203 to correct this; it will not write over destroy existing fields.');
    }
  }

  // check that ldapauth not installed.
  return $requirements;
}