function user_limit_validate in User Limit 7
Same name and namespace in other branches
- 6 user_limit.module \user_limit_validate()
Ensure that the entered user limit is a positive integer.
1 string reference to 'user_limit_validate'
- user_limit_form_user_admin_settings_alter in ./
user_limit.module - Implements hook_FORM_ID_alter().
File
- ./
user_limit.module, line 107 - The User Limit module limits the number of users that can be registered on a Drupal site.
Code
function user_limit_validate($element, &$form_state) {
$user_limit = (int) $element['#value'];
if (!is_numeric($element['#value']) || $user_limit < 0) {
form_error($element, t('User limit must be a positive integer (1, 2, 3...).'));
}
}