function gauth_account_edit_form_validate in Google Auth 7
Same name and namespace in other branches
- 7.2 gauth.admin.inc \gauth_account_edit_form_validate()
Validate handler for adding a new account to google auth accounts.
File
- ./
gauth.admin.inc, line 168 - Administration pages for Google OAuth settings.
Code
function gauth_account_edit_form_validate($form, &$form_state) {
$accounts = gauth_account_load();
$accounts = array_keys($accounts);
if (in_array($form_state['values']['name'], $accounts)) {
if (!isset($form_state['values']['id'])) {
form_set_error('name', t('Name already in use. Please choose a unique name for the account'));
}
}
}