You are here

function miniorange_saml_customer_setup_submit in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

Handle submit for customer setup.

1 string reference to 'miniorange_saml_customer_setup_submit'
miniorange_saml_customer_setup in ./miniorange_saml_customer_setup.inc

File

./miniorange_saml_customer_setup.inc, line 167
Contains form for customer setup.

Code

function miniorange_saml_customer_setup_submit(&$form, $form_state) {
  $username = $form['miniorange_saml_customer_setup_username']['#value'];
  if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
    drupal_set_message('Please enter the valid Email', 'error');
    return;
  }
  $phone = $form['miniorange_saml_customer_setup_phone']['#value'];
  $password = $form['miniorange_saml_customer_setup_password']['#value']['pass1'];
  if (empty($username) || empty($password)) {
    drupal_set_message(t('The <b>Email Address</b> and <b>Password</b> fields are mandatory.'), 'error');
    return;
  }
  elseif (strlen($password) < 6) {
    drupal_set_message(t('The length of <b>Password</b> field must be atleast 6.'), 'error');
    return;
  }
  Utilities::customer_setup_submit($username, $phone, $password);
}