You are here

function username_enumeration_prevention_menu_alter in Username Enumeration Prevention 6

Same name and namespace in other branches
  1. 7 username_enumeration_prevention.module \username_enumeration_prevention_menu_alter()

Implements hook_menu_alter(). Disable the callback for the views module when users don't have access user profiles permission.

File

./username_enumeration_prevention.module, line 30
Main file for the Username Enumeration Prevention. Adds the required functionality for removing the reset password error message. Also, if views is installed restricts the callback function to work only for users with the access user profiles permission.

Code

function username_enumeration_prevention_menu_alter(&$items) {

  // disable views callback when user does not have permission to access user profiles.
  $items['admin/views/ajax/autocomplete/user']['access arguments'] = array(
    'access user profiles',
  );
}