You are here

function _ldap_authentication_err_text in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authentication/ldap_authentication.inc \_ldap_authentication_err_text()
  2. 7.2 ldap_authentication/ldap_authentication.inc \_ldap_authentication_err_text()
1 call to _ldap_authentication_err_text()
_ldap_authentication_user_login_authenticate_validate in ldap_authentication/ldap_authentication.inc
user form validation will take care of username, pwd fields

File

ldap_authentication/ldap_authentication.inc, line 535
ldap_authn provides authentication against ldap server.

Code

function _ldap_authentication_err_text($error) {
  $msg = t('unknown error: ' . $error);
  switch ($error) {
    case LDAP_AUTHENTICATION_RESULT_FAIL_CONNECT:
      $msg = "Failed to connect to ldap server";
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_BIND:
      $msg = "Failed to bind to ldap server";
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_FIND:
      $msg = t('Sorry, unrecognized username or password.');
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_DISALLOWED:
      $msg = "User disallowed";
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_CREDENTIALS:
      $msg = t('Sorry, unrecognized username or password.');
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_GENERIC:
      $msg = t('Sorry, unrecognized username or password.');
      break;
    case LDAP_AUTHENTICATION_RESULT_FAIL_SERVER:
      $msg = t('Authentication Server or Configuration Error.');
      break;
  }
  return $msg;
}