You are here

function login_destination_edit_form_submit in Login Destination 7

Process the contact category edit page form submission.

File

./login_destination.admin.inc, line 539
Admin page callback file for the Login Destination module.

Code

function login_destination_edit_form_submit($form, &$form_state) {
  $form_state['values']['triggers'] = serialize(array_filter($form_state['values']['triggers']));
  $form_state['values']['roles'] = serialize(array_filter($form_state['values']['roles']));
  if (empty($form_state['values']['id'])) {
    drupal_write_record('login_destination', $form_state['values']);
  }
  else {
    drupal_write_record('login_destination', $form_state['values'], array(
      'id',
    ));
  }
  drupal_set_message(t('Login destination to %destination has been saved.', array(
    '%destination' => $form_state['values']['destination'],
  )));
  $form_state['redirect'] = 'admin/config/people/login-destination';
}