- return true;
- }
-
- /**
- * Event handler for registration attempts; rejects the registration
- * if email field is missing.
- *
- * @param Action $action Action being executed
- *
- * @return bool hook result code
- */
- function onStartRegistrationTry($action)
- {
- $email = $action->trimmed('email');
-
- if (empty($email)) {
- $action->showForm(_m('You must provide an email address to register.'));
- return false;
+ $user = $author->getUser();
+ if (!$this->validated($user)) {
+ // TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
+ $msg = _m('You must validate your email address before posting.');
+ throw new ClientException($msg);