You are here

function ldap_authentication_show_ldap_help_link in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authentication/ldap_authentication.module \ldap_authentication_show_ldap_help_link()
  2. 7 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 485
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;
  }
  elseif ($auth_conf->authenticationMode == LDAP_AUTHENTICATION_MIXED) {
    return ldap_authentication_ldap_authenticated($user);
  }
  elseif ($auth_conf->authenticationMode == LDAP_AUTHENTICATION_EXCLUSIVE) {
    if ($user->uid == 0 || ldap_authentication_ldap_authenticated($user)) {
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
}