You are here

function PartyUserDataSetUIAttach::action_form_validate in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_user/includes/party_user.data_ui.inc \PartyUserDataSetUIAttach::action_form_validate()

Form validation for the action form.

Overrides PartyDefaultDataSetUIAttach::action_form_validate

File

modules/party_user/includes/party_user.data_ui.inc, line 45
Provides classes for UI actions on the user data set.

Class

PartyUserDataSetUIAttach
The 'attach' action: attach an existing entity.

Code

function action_form_validate($form, &$form_state) {

  // Validate the user name.
  $account = user_load_by_name($form_state['values']['user']);
  if (!$account) {
    form_set_error('user', t('The username %name does not exist.', array(
      '%name' => $form_state['values']['user'],
    )));
  }
}