function advuser_filter_form_validate in Advanced User 5.2
Same name and namespace in other branches
- 6.2 advuser_filters.inc \advuser_filter_form_validate()
Validate values entered.
File
- ./
advuser_filters.inc, line 222 - Advanced user module allows you to select users based on an advanced set of filtering and apply actions to block, unblock, delete or email the selected users.
Code
function advuser_filter_form_validate($fid, &$fval) {
$ret = FALSE;
if ($fid == 'advuser_filter_form') {
switch ($fval['filter']) {
case 'last_access':
switch (strtolower($fval['last_access'])) {
case 'never':
$fval['last_access'] = 0;
$ret = TRUE;
break;
case '0':
$ret = TRUE;
break;
default:
if (!empty($fval['last_access']) && strtotime($fval['last_access']) <= 0) {
form_set_error('date', t('You have to specify a valid date to filter by Accessed.'));
$ret = FALSE;
}
else {
$fval['last_access'] = strtotime($fval['last_access']);
$ret = TRUE;
}
break;
}
break;
case 'created':
if (!empty($fval['created']) && strtotime($fval['created']) <= 0) {
form_set_error('date', t('You have to specify a valid date to filter by Created.'));
$ret = FALSE;
}
else {
$fval['created'] = strtotime($fval['created']);
$ret = TRUE;
}
break;
}
}
return $ret;
}