You are here

function ldap_user_grab_password_validate in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.4 ldap_user/ldap_user.module \ldap_user_grab_password_validate()
  2. 8.2 ldap_user/ldap_user.module \ldap_user_grab_password_validate()
  3. 8.3 ldap_user/ldap_user.module \ldap_user_grab_password_validate()

Store password from logon forms in ldap_user_ldap_provision_pwd static variable for use in provisioning to ldap.

6 string references to 'ldap_user_grab_password_validate'
ldap_user_form_password_policy_password_tab_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter(). for password_policy_password_tab.
ldap_user_form_user_login_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter(). for user_login_form.
ldap_user_form_user_login_block_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter(). for user_login_block.
ldap_user_form_user_pass_reset_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter(). for user-pass-reset form. Useful for sites where this is the form ID for a user to intially set their password (user clicks an emailed registration link, is prompted to set their password).
ldap_user_form_user_profile_form_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter(). for user_register_form.

... See full list

File

ldap_user/ldap_user.module, line 501
Module for the LDAP User Entity.

Code

function ldap_user_grab_password_validate($form, &$form_state) {

  // This is not a login form but profile form and user is inserting password to update email.
  if (!empty($form_state['values']['current_pass_required_values'])) {
    if (!empty($form_state['values']['current_pass']) && empty($form_state['values']['pass'])) {
      ldap_user_ldap_provision_pwd('set', $form_state['values']['current_pass']);
    }
    elseif (!empty($form_state['values']['pass'])) {
      ldap_user_ldap_provision_pwd('set', $form_state['values']['pass']);
    }
  }
  elseif (!empty($form_state['values']['pass'])) {
    ldap_user_ldap_provision_pwd('set', $form_state['values']['pass']);
  }
}