function term_permissions_validate in Taxonomy Term Permissions 6
Same name and namespace in other branches
- 7 term_permissions.module \term_permissions_validate()
Validation function to ensure that the selected user exists.
Parameters
$form: The current form array.
$form_state: The state of the current form.
1 string reference to 'term_permissions_validate'
- term_permissions_form_alter in ./
term_permissions.module - Implementation of hook_form_alter()
File
- ./
term_permissions.module, line 153 - Allows access to terms in a vocabulary to be limited by user or role.
Code
function term_permissions_validate($form, &$form_state) {
if (!empty($form_state['values']['access']['user'])) {
$allowed_users = drupal_explode_tags($form_state['values']['access']['user']);
foreach ($allowed_users as $name) {
if (!user_load(array(
'name' => $name,
))) {
form_set_error('search_user', t('The user %name does not exist.', array(
'%user' => $name,
)));
}
}
}
}