You are here

function gauth_user_services_edit_form_validate in Google Auth 7

Same name and namespace in other branches
  1. 7.2 gauth_user/gauth_user.admin.inc \gauth_user_services_edit_form_validate()

Validate handler for adding a new account to google auth services accounts.

File

gauth_user/gauth_user.admin.inc, line 169
Administration pages for Google Auth User Services.

Code

function gauth_user_services_edit_form_validate($form, &$form_state) {
  $accounts = gauth_user_services_load();
  $accounts = array_keys($accounts);
  if (in_array($form_state['values']['name'], $accounts)) {
    if (!isset($form_state['values']['is_new'])) {
      form_set_error('name', t('Name already in use. Please choose a unique name for the services account'));
    }
  }
}