Loading password_policy.module +2 −1 Original line number Diff line number Diff line Loading @@ -311,9 +311,10 @@ function _password_policy_user_profile_form_update_fields(array &$form, FormStat // Update if both current and new password fields are filled out. Depending // on policy settings, user may be allowed to use same password again. if ($uid && ($current_pass || $form_state->get('user_pass_reset')) && $new_pass) { $date = \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE); $form_state->setValue( 'field_last_password_reset', [['value' => new DrupalDateTime()]] [['value' => $date]] ); $form_state->setValue('field_password_expiration', ['value' => '0']); $form_state->setValue('field_pending_expire_sent', ['value' => '0']); Loading Loading
password_policy.module +2 −1 Original line number Diff line number Diff line Loading @@ -311,9 +311,10 @@ function _password_policy_user_profile_form_update_fields(array &$form, FormStat // Update if both current and new password fields are filled out. Depending // on policy settings, user may be allowed to use same password again. if ($uid && ($current_pass || $form_state->get('user_pass_reset')) && $new_pass) { $date = \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE); $form_state->setValue( 'field_last_password_reset', [['value' => new DrupalDateTime()]] [['value' => $date]] ); $form_state->setValue('field_password_expiration', ['value' => '0']); $form_state->setValue('field_pending_expire_sent', ['value' => '0']); Loading