X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Finvite.php;h=9522cac900158638d3797f0497e81958ba6fc485;hb=271881d4dc391e22c15f9797abfb22476c784256;hp=e9adb3b7f93255cca5aa0234566857416a1b42c0;hpb=37994e3ff124fa2456c7dcf59970ca97d8db83ff;p=quix0rs-gnu-social.git diff --git a/actions/invite.php b/actions/invite.php index e9adb3b7f9..9522cac900 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -19,6 +19,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +// @todo XXX: Add documentation. class InviteAction extends CurrentUserDesignAction { var $mode = null; @@ -53,9 +54,10 @@ class InviteAction extends CurrentUserDesignAction function sendInvitations() { - # CSRF protection + // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->showForm(_('There was a problem with your session token. Try again, please.')); return; } @@ -71,7 +73,14 @@ class InviteAction extends CurrentUserDesignAction foreach ($addresses as $email) { $email = trim($email); - if (!Validate::email($email, common_config('email', 'check_domain'))) { + $valid = null; + + if (Event::handle('StartValidateEmailInvite', array($user, $email, &$valid))) { + $valid = Validate::email($email, common_config('email', 'check_domain')); + Event::handle('EndValidateEmailInvite', array($user, $email, &$valid)); + } + + if (!$valid) { // TRANS: Form validation message when providing an e-mail address that does not validate. // TRANS: %s is an invalid e-mail address. $this->showForm(sprintf(_('Invalid email address: %s.'), $email)); @@ -217,7 +226,7 @@ class InviteAction extends CurrentUserDesignAction $this->textarea('addresses', _('Email addresses'), $this->trimmed('addresses'), // TRANS: Tooltip for field label for a list of e-mail addresses. - _('Addresses of friends to invite (one per line)')); + _('Addresses of friends to invite (one per line).')); $this->elementEnd('li'); $this->elementStart('li'); // TRANS: Field label for a personal message to send to invitees. @@ -287,10 +296,4 @@ class InviteAction extends CurrentUserDesignAction mail_send($recipients, $headers, $body); } - - function showLocalNav() - { - $nav = new SubGroupNav($this, common_current_user()); - $nav->show(); - } }