You are here

function ldap_authentication_show_ldap_help_link in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authentication/ldap_authentication.module \ldap_authentication_show_ldap_help_link()
  2. 7.2 ldap_authentication/ldap_authentication.module \ldap_authentication_show_ldap_help_link()
1 string reference to 'ldap_authentication_show_ldap_help_link'
ldap_authentication_menu_alter in ldap_authentication/ldap_authentication.module
Implements hook_menu_alter(). since menu items are cached, only useful to add or alter callbacks for ldap authentication driven menu items.

File

ldap_authentication/ldap_authentication.module, line 381
This module injects itself into Drupal's Authentication stack.

Code

function ldap_authentication_show_ldap_help_link($user = NULL) {
  global $user;
  if (!($auth_conf = ldap_authentication_get_valid_conf())) {
    return FALSE;
  }
  if ($auth_conf->authenticationMode == LDAP_AUTHENTICATION_MIXED) {
    return ldap_authentication_ldap_authenticated($user);

    // LDAP_authen.login_forms.MM.*  // show ldap help only if ldap authenticated in mixed mode
  }
  elseif ($auth_conf->authenticationMode == LDAP_AUTHENTICATION_EXCLUSIVE) {
    if ($user->uid == 0 || ldap_authentication_ldap_authenticated($user)) {

      // LDAP_authen.login_forms.EM.anon, LDAP_authen.login_forms.EM.ldap
      return TRUE;
    }
    else {
      return FALSE;

      // LDAP_authen.login_forms.EM.user1, LDAP_authen.login_forms.EM.drupal
    }
  }
}