You are here

function user_restrictions_user_profile_form_validate in User restrictions 7

Form validation handler for user_profile_form().

See also

user_profile_form()

1 string reference to 'user_restrictions_user_profile_form_validate'
user_restrictions_form_user_profile_form_alter in ./user_restrictions.module
Implements hook_form_FORM_ID_alter() for user_profile_form().

File

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

Code

function user_restrictions_user_profile_form_validate($form, &$form_state) {
  $account = $form_state['user'];
  if (user_access('bypass user restriction rules') || user_access('bypass user restriction rules', $account)) {
    return;
  }
  $error = UserRestrictions::check($form_state, 'profile');
  if ($error['message']) {
    form_set_error($error['field'], $error['message']);
  }
}