You are here

function ldap_authorization_map_errors in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization.theme.inc \ldap_authorization_map_errors()
  2. 7.2 ldap_authorization/ldap_authorization.theme.inc \ldap_authorization_map_errors()
1 call to ldap_authorization_map_errors()
theme_ldap_authorization_test_results in ldap_authorization/ldap_authorization.theme.inc

File

ldap_authorization/ldap_authorization.theme.inc, line 104
theming functions for the LDAP authorization module.

Code

function ldap_authorization_map_errors($err_id, $consumer_conf_link) {
  $tokens = array(
    '%consumer_conf_link' => $consumer_conf_link,
  );
  switch ($err_id) {
    case LDAP_AUTHORIZATION_USER_LDAP_NOT_FOUND:
      $authorizations_text = t('LDAP entry for drupal user not found.', $tokens);
      break;
    case LDAP_AUTHORIZATION_USER_NOT_LDAP_AUTHENTICATED:
      $authorizations_text = t('LDAP Authorizations not applied because user is not
      authenticated via LDAP and configuration requires is (%consumer_conf_link).', $tokens);
      break;
    case LDAP_AUTHORIZATION_MAP_NOT_CONF_FOR_LOGON:
      $authorizations_text = t('LDAP Authorizations not configured to be executed on logon in  (%consumer_conf_link).', $tokens);
      break;
    case LDAP_AUTHORIZATION_NOT_APPLY_USER_1:
      $authorizations_text = t('LDAP Authorizations not applicable to user 1.', $tokens);
      break;
    case LDAP_AUTHORIZATION_SERVER_CONFIG_NOT_FOUND:
      $authorizations_text = t('Enabled LDAP server configuration not found for given ldap consumer type in (%consumer_conf_link).', $tokens);
      break;
    default:
      $authorizations_text = "Failed.";
  }
  return $authorizations_text;
}