You are here

function commons_admin_save_fullname in Drupal Commons 7.3

Save the full name of the first user.

1 string reference to 'commons_admin_save_fullname'
commons_form_install_configure_form_alter in ./commons.profile
Implements hook_form_FORM_ID_alter() for install_configure_form().

File

./commons.profile, line 143
Enables modules and site configuration for a Commons site installation.

Code

function commons_admin_save_fullname($form_id, &$form_state) {
  $values = $form_state['values'];
  if (!empty($values['field_name_first']) || !empty($values['field_name_last'])) {
    $account = user_load(1);
    $account->field_name_first[LANGUAGE_NONE][0]['value'] = $values['field_name_first'];
    $account->field_name_last[LANGUAGE_NONE][0]['value'] = $values['field_name_last'];
    user_save($account);
    realname_update($account);
  }
}