function _cas_roles_preg_validate in CAS roles 7
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.2 cas_roles.module \_cas_roles_preg_validate()
Validate the regular expression field.
1 string reference to '_cas_roles_preg_validate'
- cas_roles_admin_settings in ./
cas_roles.admin.inc - Administrative settings form.
File
- ./
cas_roles.module, line 239 - 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.'));
}
}