You are here

function shib_auth_custom_data_validate in Shibboleth Authentication 6.4

Same name and namespace in other branches
  1. 7.4 shib_auth_forms.inc \shib_auth_custom_data_validate()

Form validator - require to fill all of the fields

Parameters

form form identifier:

form_state $form_state contains all of the data of the form:

File

./shib_auth_forms.inc, line 206
Drupal forms of the Shibboleth authentication module.

Code

function shib_auth_custom_data_validate($form, &$form_state) {
  if (shib_auth_config('enable_custom_mail')) {
    if ($form_state['values']['custom_mail'] == '') {
      form_set_error('', t('You have to fill the \'E-mail\' field.'));
    }
  }
  if (shib_auth_config('define_username')) {
    if ($form_state['values']['custom_username'] == '') {
      form_set_error('', t('You have to fill the \'Username\' field.'));
    }
  }
  if (shib_auth_config('terms_accept')) {
    if ($form_state['values']['accept'] == FALSE) {
      form_set_error('', t('You have to accept Terms of Use to proceed.'));
    }
  }
}