diff --git a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php index e1855505683114504c46ccddccf8de89e8ebc942..48c592d8fd2344e52009e742534d545f131f710b 100644 --- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php @@ -104,7 +104,7 @@ function testSiteMaintenance() { $edit = array( 'name' => $this->user->getUsername(), ); - $this->drupalPostForm('user/password', $edit, t('Email new password')); + $this->drupalPostForm('user/password', $edit, t('Submit')); $mails = $this->drupalGetMails(); $start = strpos($mails[0]['body'], 'user/reset/'. $this->user->id()); $path = substr($mails[0]['body'], $start, 66 + strlen($this->user->id())); diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index a322b09df04477e808f4c22fca787b688ebd8562..7cf5ad6e2e8fa67ed03050da26c3bf55d367b720 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -134,8 +134,16 @@ public function form(array $form, FormStateInterface $form_state) { if (!$pass_reset) { $protected_values['mail'] = $form['account']['mail']['#title']; $protected_values['pass'] = $this->t('Password'); - $request_new = $this->l($this->t('Request new password'), new Url('user.pass', array(), array('attributes' => array('title' => $this->t('Request new password via email.'))))); - $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.', array('%mail' => $protected_values['mail'], '%pass' => $protected_values['pass'], '!request_new' => $request_new)); + $request_new = $this->l($this->t('Reset your password'), new Url('user.pass', + array(), array('attributes' => array('title' => $this->t('Send password reset instructions via e-mail.')))) + ); + $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.', + array( + '%mail' => $protected_values['mail'], + '%pass' => $protected_values['pass'], + '!request_new' => $request_new, + ) + ); } // The user must enter their current password to change to a new one. diff --git a/core/modules/user/src/Form/UserPasswordForm.php b/core/modules/user/src/Form/UserPasswordForm.php index 4d5a012a0ac4dfa7a682334508a4462c32ac1e2f..48b55711f08bf8fc3ce6f3ffc7417331ebb58ca4 100644 --- a/core/modules/user/src/Form/UserPasswordForm.php +++ b/core/modules/user/src/Form/UserPasswordForm.php @@ -92,15 +92,20 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['name']['#value'] = $user->getEmail(); $form['mail'] = array( '#prefix' => '<p>', - '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the email.', array('%email' => $user->getEmail())), + '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the email.', array('%email' => $user->getEmail())), '#suffix' => '</p>', ); } else { + $form['mail'] = array( + '#prefix' => '<p>', + '#markup' => $this->t('Password reset instructions will be sent to your registered e-mail address.'), + '#suffix' => '</p>', + ); $form['name']['#default_value'] = $this->getRequest()->query->get('name'); } $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Email new password')); + $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Submit')); return $form; } diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php index 350a19eebaf74e79178d357e4d695799312c599b..47177a52f4b1c041ca6276cec3927b1ceb19b573 100644 --- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php +++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php @@ -55,9 +55,9 @@ public function build() { ), ))); } - $items['request_password'] = \Drupal::l(t('Request new password'), new Url('user.pass', array(), array( + $items['request_password'] = \Drupal::l(t('Reset your password'), new Url('user.pass', array(), array( 'attributes' => array( - 'title' => t('Request new password via email.'), + 'title' => t('Send password reset instructions via e-mail.'), 'class' => array('request-password-link'), ), ))); diff --git a/core/modules/user/src/Tests/UserAccountLinksTests.php b/core/modules/user/src/Tests/UserAccountLinksTests.php index 06cac88409a2a3a92d3be56e725111048bf04d04..f9fd4e9502f6591b3f9d9533834a39b9d951c878 100644 --- a/core/modules/user/src/Tests/UserAccountLinksTests.php +++ b/core/modules/user/src/Tests/UserAccountLinksTests.php @@ -131,7 +131,7 @@ function testAccountPageTitles() { $this->assertTitle('Create new account' . $title_suffix, "Page title of /user/register is 'Create new account' for anonymous users."); $this->drupalGet('user/password'); - $this->assertTitle('Request new password' . $title_suffix, "Page title of /user/register is 'Request new password' for anonymous users."); + $this->assertTitle('Reset your password' . $title_suffix, "Page title of /user/register is 'Reset your password' for anonymous users."); // Check the page title for registered users is "My Account" in menus. $this->drupalLogin($this->drupalCreateUser()); diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index b0f91be72d524ad3709d555247fb3041a5351a8b..c8a1f4be1dd62931b8b888361a6e3f9f2d207893 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -63,14 +63,14 @@ function testUserPasswordReset() { $this->drupalGet('user/password'); $edit = array('name' => $this->randomMachineName(32)); - $this->drupalPostForm(NULL, $edit, t('Email new password')); + $this->drupalPostForm(NULL, $edit, t('Submit')); $this->assertText(t('Sorry, @name is not recognized as a username or an email address.', array('@name' => $edit['name'])), 'Validation error message shown when trying to request password for invalid account.'); $this->assertEqual(count($this->drupalGetMails(array('id' => 'user_password_reset'))), 0, 'No email was sent when requesting a password for an invalid account.'); // Reset the password by username via the password reset page. $edit['name'] = $this->account->getUsername(); - $this->drupalPostForm(NULL, $edit, t('Email new password')); + $this->drupalPostForm(NULL, $edit, t('Submit')); // Verify that the user was sent an email. $this->assertMail('to', $this->account->getEmail(), 'Password email sent to user.'); @@ -109,7 +109,7 @@ function testUserPasswordReset() { // Count email messages before to compare with after. $before = count($this->drupalGetMails(array('id' => 'user_password_reset'))); $edit = array('name' => $this->account->getEmail()); - $this->drupalPostForm(NULL, $edit, t('Email new password')); + $this->drupalPostForm(NULL, $edit, t('Submit')); $this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'Email sent when requesting password reset using email address.'); // Create a password reset link as if the request time was 60 seconds older than the allowed limit. diff --git a/core/modules/user/user.links.task.yml b/core/modules/user/user.links.task.yml index 507c7de78add24dba02ff288d2a0ca797b8e71bb..9d9661da1724cb478d459795a15379296a5d4b13 100644 --- a/core/modules/user/user.links.task.yml +++ b/core/modules/user/user.links.task.yml @@ -21,7 +21,7 @@ user.register: user.pass: route_name: user.pass base_route: user.page - title: 'Request new password' + title: 'Reset your password' # Other authentication methods may add pages below user/login/. user.login: route_name: user.login diff --git a/core/modules/user/user.routing.yml b/core/modules/user/user.routing.yml index d071113e9ef9a1aab895dddc90071fd9764f50f0..e96c76c85ead42df6b2ae25cd30444b018dd472e 100644 --- a/core/modules/user/user.routing.yml +++ b/core/modules/user/user.routing.yml @@ -119,7 +119,7 @@ user.pass: path: '/user/password' defaults: _form: '\Drupal\user\Form\UserPasswordForm' - _title: 'Request new password' + _title: 'Reset your password' requirements: _access: 'TRUE' options: