X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Finvite.php;h=d0ed64ec9079449ec3d9013973aab5e912257a6b;hb=7ef6c9da437b504f949dc3d7d8c05f8abe36baae;hp=bdea4807d8a2f2ac0f7f8c1043d35c6d56d6595d;hpb=6c28a07cf58120e271de6e0c9c89a1f9a6d0101e;p=quix0rs-gnu-social.git diff --git a/actions/invite.php b/actions/invite.php index bdea4807d8..d0ed64ec90 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } class InviteAction extends CurrentUserDesignAction { @@ -68,7 +68,7 @@ class InviteAction extends CurrentUserDesignAction foreach ($addresses as $email) { $email = trim($email); - if (!Validate::email($email, true)) { + if (!Validate::email($email, common_config('email', 'check_domain'))) { $this->showForm(sprintf(_('Invalid email address: %s'), $email)); return; } @@ -98,6 +98,12 @@ class InviteAction extends CurrentUserDesignAction $this->showPage(); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('addresses'); + } + function title() { if ($this->mode == 'sent') { @@ -122,7 +128,7 @@ class InviteAction extends CurrentUserDesignAction $this->element('p', null, _('You are already subscribed to these users:')); $this->elementStart('ul'); foreach ($this->already as $other) { - $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email)); } $this->elementEnd('ul'); } @@ -130,7 +136,7 @@ class InviteAction extends CurrentUserDesignAction $this->element('p', null, _('These people are already users and you were automatically subscribed to them:')); $this->elementStart('ul'); foreach ($this->subbed as $other) { - $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email)); } $this->elementEnd('ul'); } @@ -216,7 +222,7 @@ class InviteAction extends CurrentUserDesignAction $recipients = array($email); $headers['From'] = mail_notify_from(); - $headers['To'] = $email; + $headers['To'] = trim($email); $headers['Subject'] = sprintf(_('%1$s has invited you to join them on %2$s'), $bestname, $sitename); $body = sprintf(_("%1\$s has invited you to join them on %2\$s (%3\$s).\n\n".