check for valid email on invite
This commit is contained in:
parent
d3215adfa1
commit
122b38f354
@ -80,10 +80,19 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
$email = trim($email);
|
$email = trim($email);
|
||||||
$valid = null;
|
$valid = null;
|
||||||
|
|
||||||
if (Event::handle('StartValidateEmailInvite', array($user, $email, &$valid))) {
|
try {
|
||||||
|
|
||||||
|
if (Event::handle('StartValidateUserEmail', array(null, $email, &$valid))) {
|
||||||
$valid = Validate::email($email, common_config('email', 'check_domain'));
|
$valid = Validate::email($email, common_config('email', 'check_domain'));
|
||||||
|
Event::handle('EndValidateUserEmail', array(null, $email, &$valid));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($valid) {
|
||||||
|
if (Event::handle('StartValidateEmailInvite', array($user, $email, &$valid))) {
|
||||||
|
$valid = true;
|
||||||
Event::handle('EndValidateEmailInvite', array($user, $email, &$valid));
|
Event::handle('EndValidateEmailInvite', array($user, $email, &$valid));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$valid) {
|
if (!$valid) {
|
||||||
// TRANS: Form validation message when providing an e-mail address that does not validate.
|
// TRANS: Form validation message when providing an e-mail address that does not validate.
|
||||||
@ -91,6 +100,10 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
$this->showForm(sprintf(_('Invalid email address: %s.'), $email));
|
$this->showForm(sprintf(_('Invalid email address: %s.'), $email));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} catch (ClientException $e) {
|
||||||
|
$this->showForm($e->getMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->already = array();
|
$this->already = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user