Closed (fixed)
Project:
Custom username validation
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
28 Jun 2010 at 12:31 UTC
Updated:
2 Aug 2010 at 10:30 UTC
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
Comment #1
Schneck commentedGood point, I changed that, please check out the release 1.5