You are here

function ldap_authentication_menu_alter 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_menu_alter()
  2. 7 ldap_authentication/ldap_authentication.module \ldap_authentication_menu_alter()

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 104
This module injects itself into Drupal's Authentication stack.

Code

function ldap_authentication_menu_alter(&$items) {
  ldap_servers_module_load_include('inc', 'ldap_authentication', 'ldap_authentication');
  $items['user/password']['access callback'] = 'ldap_authentication_show_reset_pwd';
  $auth_conf = ldap_authentication_get_valid_conf();
  if (@$auth_conf->ldapUserHelpLinkUrl) {
    $items['user/ldaphelp'] = [
      'title' => $auth_conf->ldapUserHelpLinkText,
      'page callback' => 'drupal_goto',
      'page arguments' => [
        $auth_conf->ldapUserHelpLinkUrl,
      ],
      'access callback' => 'ldap_authentication_show_ldap_help_link',
      'type' => MENU_LOCAL_TASK,
    ];
  }
}