function restrict_by_ip_user_profile_validate in Restrict Login or Role Access by IP Address 7.3
Same name and namespace in other branches
- 8.4 restrict_by_ip.module \restrict_by_ip_user_profile_validate()
- 6.3 restrict_by_ip.module \restrict_by_ip_user_profile_validate()
Custom validation function for the user_profile_form page.
1 string reference to 'restrict_by_ip_user_profile_validate'
- restrict_by_ip_form_alter in ./
restrict_by_ip.module - Implmentation of hook_form_alter().
File
- ./
restrict_by_ip.module, line 367 - Allows the admin to select which ip addresses role or a user can login from for this site Some of the code below is taken from the cck_ipaddress_module
Code
function restrict_by_ip_user_profile_validate($form, &$form_state) {
if (strlen($form_state['values']['restrict_by_ip_address']) > 0) {
$ret = _restrict_by_ip_validate_ip($form_state['values']['restrict_by_ip_address']);
if ($ret['result'] == FALSE) {
form_set_error('restrict_by_ip_address', t(implode('<br />', $ret['messages'])));
}
}
}