You are here

function services_admin_settings_submit in Services 6.2

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

Submit callback for services_admin_settings().

File

./services_admin_browse.inc, line 365
Browser thru all services and servers.

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('Changed authentication method');
  }
  else {
    drupal_set_message('Updated authentication settings');
  }

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

  // Apply the content permissions setting.
  variable_set('services_use_content_permissions', $form_state['values']['services_use_content_permissions']);

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