You are here

function _cas_roles_preg_validate in CAS roles 8

Same name and namespace in other branches
  1. 6 cas_roles.admin.inc \_cas_roles_preg_validate()
  2. 7.2 cas_roles.module \_cas_roles_preg_validate()
  3. 7 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.admin.inc, line 82
Provides settings pages for the CAS Attributes module.

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.'));
  }
}