Skip to content

Commit

Permalink
MDL-59929 signup: inprove usability when duplicate email entered
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Aug 24, 2017
1 parent 9eb3c17 commit 2b2967e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 3 additions & 1 deletion lib/authlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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').' <a href="forgot_password.php">'.get_string('newpassword').'?</a>';
$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');
Expand Down

0 comments on commit 2b2967e

Please sign in to comment.