You are here

function masquerade_user_validate in Masquerade 7

Validates user account form.

1 string reference to 'masquerade_user_validate'
masquerade_form_user_profile_form_alter in ./masquerade.module
Implements hook_form_FORM_ID_alter().

File

./masquerade.module, line 477
The masquerade module allows administrators to masquerade as other user.

Code

function masquerade_user_validate(&$form, $form_state) {
  if (isset($form_state['values']['masquerade_users'])) {
    $users = drupal_explode_tags($form_state['values']['masquerade_users']);
    foreach ($users as $username) {
      if (!_masquerade_user_load($username)) {
        form_set_error('masquerade_users', t('%user is not a valid user name.', array(
          '%user' => $username,
        )));
      }
    }
  }
}