You are here

function ldap_user_grab_password_validate in Lightweight Directory Access Protocol (LDAP) 8.3

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. 7.2 ldap_user/ldap_user.module \ldap_user_grab_password_validate()

Alter password form through validation.

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

5 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().
ldap_user_form_user_form_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter().
ldap_user_form_user_login_block_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter().
ldap_user_form_user_login_form_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter().
ldap_user_form_user_register_form_alter in ldap_user/ldap_user.module
Implements hook_form_FORM_ID_alter().

File

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

Code

function ldap_user_grab_password_validate($form, FormState &$form_state) {

  // This is not a login form but profile form and user is inserting password
  // to update email.
  if (!empty($form_state
    ->getValue('current_pass_required_values'))) {
    if (!empty($form_state
      ->getValue('current_pass')) && empty($form_state
      ->getValue('pass'))) {
      CredentialsStorage::storeUserPassword($form_state
        ->getValue('current_pass'));
    }
  }
  elseif (!empty($form_state
    ->getValue('pass'))) {
    CredentialsStorage::storeUserPassword($form_state
      ->getValue('pass'));
  }
}