function _cas_roles_preg_validate in CAS roles 7.2
Same name and namespace in other branches
- 8 cas_roles.admin.inc \_cas_roles_preg_validate()
- 6 cas_roles.admin.inc \_cas_roles_preg_validate()
- 7 cas_roles.module \_cas_roles_preg_validate()
Validate the regular expression field.
2 string references to '_cas_roles_preg_validate'
- cas_roles_admin_settings in ./
cas_roles.admin.inc - Administrative settings form.
- cas_roles_og_admin_settings in cas_roles_og/
cas_roles_og.admin.inc - Administrative settings form.
File
- ./
cas_roles.module, line 207 - Allows user account and profile attributes to be automatically populated using tokens. Provides basic tokens for attributes returned by the CAS server.
Code
function _cas_roles_preg_validate($element, &$form_state, $form) {
if (!empty($element['#value']) && @preg_match($element['#value'], "CAS") === FALSE) {
form_error($element, t('This field is not a valid preg pattern.'));
}
}