You are here

function bakery_pull_form_submit in Bakery Single Sign-On System 6.2

Same name and namespace in other branches
  1. 7.2 bakery.module \bakery_pull_form_submit()
  2. 7.3 bakery.pages.inc \bakery_pull_form_submit()

If the request succeeds, go to the user page. Otherwise, show an error.

File

./bakery.module, line 1836

Code

function bakery_pull_form_submit($form, &$form_state) {
  $result = bakery_request_account($form_state['values']['name'], $form_state['values']['or_email']);
  if ($result === FALSE) {
    drupal_set_message(t("Pulling account %name failed: maybe there is a typo or they don't exist on the master site.", array(
      '%name' => $form_state['values']['name'],
    )), 'error');
  }
  else {
    $form_state['redirect'] = 'user/' . $result;
  }
}