You are here

function commerce_kickstart_custom_setting in Commerce Kickstart 7.2

Validate callback; Populate the admin account mail, user and password with custom values.

1 string reference to 'commerce_kickstart_custom_setting'
commerce_kickstart_form_install_configure_form_alter in ./commerce_kickstart.profile
Implements hook_form_alter().

File

./commerce_kickstart.profile, line 108

Code

function commerce_kickstart_custom_setting(&$form, &$form_state) {
  $form_state['values']['account']['mail'] = $form_state['values']['site_mail'];

  // Use our custom values only the corresponding checkbox is checked.
  if ($form_state['values']['override_account_informations'] == TRUE) {
    if ($form_state['input']['pass']['pass1'] == $form_state['input']['pass']['pass2']) {
      $form_state['values']['account']['name'] = $form_state['values']['name'];
      $form_state['values']['account']['pass'] = $form_state['input']['pass']['pass1'];
    }
    else {
      form_set_error('pass', st('The specified passwords do not match.'));
    }
  }
}