function user_limit_validate in User Limit 6
Same name and namespace in other branches
- 7 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 - Implementation of hook_FORM_ID_alter().
File
- ./
user_limit.module, line 184 - Everything related to User Limit. There are no include files.
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...).'));
}
}