diff --git a/lang/en/moodle.php b/lang/en/moodle.php index addc4f7a150ad..6844d5fd3a8ab 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -620,6 +620,8 @@ $string['emailenable'] = 'This email address is enabled'; $string['emailenableclick'] = 'Click here to re-enable all email being sent to this address'; $string['emailexists'] = 'This email address is already registered.'; +$string['emailexistssignuphint'] = 'Perhaps you created an account in the past? {$a}'; +$string['emailexistshintlink'] = 'Recover forgotten username or password'; $string['emailformat'] = 'Email format'; $string['emailcharset'] = 'Email charset'; $string['emailmustbereal'] = 'Note: your email address must be a real one'; diff --git a/lib/authlib.php b/lib/authlib.php index 4af4bcb0a6346..ae7261958c875 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -887,7 +887,9 @@ function signup_validate_data($data, $files) { $errors['email'] = get_string('invalidemail'); } else if ($DB->record_exists('user', array('email' => $data['email']))) { - $errors['email'] = get_string('emailexists').' '.get_string('newpassword').'?'; + $errors['email'] = get_string('emailexists') . ' ' . + get_string('emailexistssignuphint', 'moodle', + html_writer::link(new moodle_url('/login/forgot_password.php'), get_string('emailexistshintlink'))); } if (empty($data['email2'])) { $errors['email2'] = get_string('missingemail');