You are here

function services_admin_settings_submit in Services 7

Same name and namespace in other branches
  1. 6.2 services_admin_browse.inc \services_admin_settings_submit()

File

./services_admin_browse.inc, line 310
@author Services Dev Team

Code

function services_admin_settings_submit($form, $form_state) {

  // Update the services oauth module variable *if needed*.
  $old_auth = variable_get('services_auth_module', '');
  $new_auth = $form_state['values']['auth_module'];
  if ($old_auth != $new_auth) {
    variable_set('services_auth_module', $new_auth);

    // Rebuild menu so that security-related menu items can be conditionally created.
    menu_rebuild();
    drupal_set_message(t('Changed authentication method'));
  }
  else {
    drupal_set_message(t('Updated authentication settings'));
  }

  // Allow the authorization module to handle submitted values.
  services_auth_invoke('security_settings_submit', $form_state);

  // Clear the services cache so that methods and resources are updated according to auth settings
  cache_clear_all('services:', 'cache', TRUE);
}