You are here

function user_restrictions_user_restrictions_alter in User restrictions 7

Implements hook_user_restrictions_alter().

File

./user_restrictions.module, line 76
Specifies rules for restricting the data users can set for their accounts.

Code

function user_restrictions_user_restrictions_alter(&$denied, &$error, $context) {
  if ($context['type'] == 'mail' && $denied) {
    $error['field'] = 'mail';
    $error['message'] = t('The email address %email is not allowed.', array(
      '%email' => $context['mask'],
    ));
  }
  if ($context['type'] == 'name' && $denied) {
    $error['field'] = 'name';
    $error['message'] = t('The name %name is not allowed.', array(
      '%name' => $context['mask'],
    ));
  }
}