public UserPasswordForm::submitForm(array &$form, FormStateInterface $form_state)
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- core/modules/user/src/Form/UserPasswordForm.php, line 135
Class
- UserPasswordForm
- Provides a user password reset form.
Namespace
Drupal\user\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 | public function submitForm( array & $form , FormStateInterface $form_state ) { $langcode = $this ->languageManager->getCurrentLanguage()->getId(); $account = $form_state ->getValue( 'account' ); // Mail one time login URL and instructions using current language. $mail = _user_mail_notify( 'password_reset' , $account , $langcode ); if (! empty ( $mail )) { $this ->logger( 'user' )->notice( 'Password reset instructions mailed to %name at %email.' , array ( '%name' => $account ->getUsername(), '%email' => $account ->getEmail())); drupal_set_message( $this ->t( 'Further instructions have been sent to your email address.' )); } $form_state ->setRedirect( 'user.page' ); } |
Please login to continue.