You are here

function realname_admin_general_submit in Real Name 6

File

./realname.admin.inc, line 137
The RealName module allows the admin to choose fields from the user profile that will be used to add a "realname" element (method) to a user object. Hook_user is used to automatically add this to any user object that is loaded.

Code

function realname_admin_general_submit($form, &$form_state) {
  variable_set('realname_nodeapi', $form_state['values']['realname_nodeapi']);
  variable_set('realname_myacct', $form_state['values']['realname_myacct']);
  variable_set('realname_search_enable', $form_state['values']['realname_search_enable']);
  variable_set('realname_user_disable', $form_state['values']['realname_user_disable']);
  variable_set('realname_search_login', $form_state['values']['realname_search_login']);
  variable_set('realname_theme', $form_state['values']['realname_theme']);
  variable_set('realname_max_username', $form_state['values']['realname_max_username']);
  variable_set('realname_notver', $form_state['values']['realname_notver']);
  variable_set('realname_use_title', $form_state['values']['realname_use_title']);
  variable_set('realname_view', $form_state['values']['realname_view']);

  // Did the admin change the search enable or user disable settings?
  if ($form_state['values']['original_search_enable'] != $form_state['values']['realname_search_enable'] || $form_state['values']['original_user_disable'] != $form_state['values']['realname_user_disable']) {

    // Yes, so we have to rebuild the menu.
    menu_rebuild();
    drupal_set_message(t('The menu router has been rebuilt.'));
    watchdog('RealName', 'User module search disabled.');
  }
  drupal_set_message(t('Configuration saved.'));
}