You are here

function simple_ldap_user_requirements in Simple LDAP 7

Same name and namespace in other branches
  1. 7.2 simple_ldap_user/simple_ldap_user.install \simple_ldap_user_requirements()

Implements hook_requirements().

File

simple_ldap_user/simple_ldap_user.install, line 44
simple_ldap_user module installation.

Code

function simple_ldap_user_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break during installation.
  $t = get_t();
  if ($phase == 'runtime') {
    $expected = drupal_get_path('module', 'simple_ldap_user') . '/simple_ldap_user.password.inc';
    $password_inc = variable_get('password_inc');
    $requirements['password_inc'] = array(
      'title' => 'password_inc',
      'value' => $password_inc,
      'severity' => $password_inc == $expected ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      'description' => $t('Simple LDAP User requires overrides to some of the Drupal password hashing functions.') . ' ' . $t('If the password_inc variable is not set to the file provided by Simple LDAP User, LDAP authentication will not work.'),
    );
  }
  return $requirements;
}