You are here

function login_destination_overview_form_submit in Login Destination 7

Submit handler for the login destination overview form.

This function update the login destination rule attribute like rules are enabled/disabled or its weight.

See also

login_destination_overview_form()

File

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

Code

function login_destination_overview_form_submit($form, &$form_state) {
  $element =& $form_state['values'];
  foreach (element_children($element) as $ldid) {
    if (isset($form[$ldid]['enabled'])) {
      $login_destination_rules[$ldid] = $element[$ldid];
      $login_destination_rules[$ldid]['ldid'] = $ldid;
    }
  }
  foreach ($login_destination_rules as $ldid => $login_destination_rule) {
    _login_destination_update_rules($login_destination_rule);
  }
  drupal_set_message(t('Your configuration has been saved.'), 'status');
}