We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 2019d32b authored by Evan Prodromou's avatar Evan Prodromou

let other validity checks go through first

parent 55ebddb5
...@@ -52,18 +52,20 @@ class DomainWhitelistPlugin extends Plugin ...@@ -52,18 +52,20 @@ class DomainWhitelistPlugin extends Plugin
return true; return true;
} }
function onStartValidateUserEmail($user, $email, &$valid) function onEndValidateUserEmail($user, $email, &$valid)
{ {
if (!$this->matchesWhitelist($email)) { if ($valid) { // it's otherwise valid
$whitelist = $this->getWhitelist(); if (!$this->matchesWhitelist($email)) {
if (count($whitelist) == 1) { $whitelist = $this->getWhitelist();
$message = sprintf(_("Email address must be in this domain: %s"), if (count($whitelist) == 1) {
$whitelist[0]); $message = sprintf(_("Email address must be in this domain: %s"),
} else { $whitelist[0]);
$message = sprintf(_("Email address must be in one of these domains: %s"), } else {
implode(', ', $whitelist)); $message = sprintf(_("Email address must be in one of these domains: %s"),
implode(', ', $whitelist));
}
throw new ClientException($message);
} }
throw new ClientException($message);
} }
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment