You are here

function ldap_authentication_profile_update_form_submit in Lightweight Directory Access Protocol (LDAP) 7.2

Form submit handler for updating the profile.

See also

ldap_authentication_profile_update_form()

File

ldap_authentication/ldap_authentication.pages.inc, line 52
User-facing page callbacks for the LDAP Authentication module.

Code

function ldap_authentication_profile_update_form_submit($form, &$form_state) {
  global $user;
  if (user_save($user, [
    'mail' => $form_state['values']['mail'],
  ])) {

    // Prevents the cached setting from being used again.
    unset($_SESSION['ldap_authentication_template']);
    $form_state['redirect'] = isset($_GET['next']) ? $_GET['next'] : '<front>';
    drupal_set_message(t('Your profile has been updated.'));
  }
}