Custom Username Validation is a 'on-site-build' settings and I think there should be a new perm to allow the access to the configuration. Also, in 1.4 hook_perm has been added, so it does not add new complexity.
Also, it would be good to have this setting in 'admin/user' instead of 'admin/settings' since. 'admin/settings' use to have a lot of things in big sites and 'admin/user' already have all the user options in core.

/**
 * Implementation of hook_perm().
 */
function custom_username_validation_perm() {
  return array('administer custom username validation');
}

/**
* Implementation of hook_menu().
*/
function custom_username_validation_menu() {
  $items = array();

  $items['admin/user/custom_username_validation'] = array(
    'title' => t('Custom username validation'),
    'description' => t('Set username pattern to match and an error message on matching fail'),
    'access callback' => 'user_access',
    'access arguments' => array('administer custom username validation'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('custom_username_validation_admin'),
    'type' => MENU_NORMAL_ITEM,
  );

  return $items;
}

Comments

Schneck’s picture

Assigned: Unassigned » Schneck
Status: Active » Fixed

Good point, I changed that, please check out the release 1.5

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.