You are here

function lingotek_setup_account_settings_form_submit in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.setup.inc \lingotek_setup_account_settings_form_submit()
  2. 7.2 lingotek.setup.inc \lingotek_setup_account_settings_form_submit()
  3. 7.3 lingotek.setup.inc \lingotek_setup_account_settings_form_submit()
  4. 7.4 lingotek.setup.inc \lingotek_setup_account_settings_form_submit()
  5. 7.6 lingotek.setup.inc \lingotek_setup_account_settings_form_submit()

Account Settings (for Current Users) - Form Processing

File

./lingotek.setup.inc, line 287

Code

function lingotek_setup_account_settings_form_submit($form, $form_state) {
  $login_id = $form_state['values']['lingotek_lid'];
  $password = $form_state['values']['lingotek_pid'];

  // Validate the Account
  list($success, $msg) = lingotek_list_community_integrations($login_id, $password);
  if ($success == FALSE) {
    drupal_set_message(check_plain($msg), 'error');
  }
  else {

    // Login Successful:  Valid Account
    $_SESSION['lingotek_setup_path'] = array(
      'admin/config/lingotek/account-settings',
    );
    drupal_set_message(t('Your account settings have been saved.'));
    variable_set('lingotek_login_id', $login_id);
    variable_set('lingotek_password', $password);
    drupal_goto('admin/config/lingotek/community-select');
  }

  // END:  Valid Login
}