Adding this (optional) feature to 1.4 stable because it seems quite

a few people really need it.
This commit is contained in:
moodler
2004-09-07 02:50:03 +00:00
parent 7c2e85f1bd
commit a50ded84ea
5 changed files with 63 additions and 2 deletions
+8 -2
View File
@@ -246,15 +246,21 @@ function find_form_errors(&$user, &$usernew, &$err) {
if (empty($usernew->country))
$err["country"] = get_string("missingcountry");
if (! validate_email($usernew->email))
if (! validate_email($usernew->email)) {
$err["email"] = get_string("invalidemail");
else if ($otheruser = get_record("user", "email", $usernew->email)) {
} else if ($otheruser = get_record("user", "email", $usernew->email)) {
if ($otheruser->id <> $user->id) {
$err["email"] = get_string("emailexists");
}
}
if (empty($err["email"]) and !isadmin()) {
if ($error = email_is_not_allowed($usernew->email)) {
$err["email"] = $error;
}
}
$user->email = $usernew->email;
return count($err);