Adding this (optional) feature to 1.4 stable because it seems quite
a few people really need it.
This commit is contained in:
+8
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user