X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Finvite.php;h=788130c5825e4989a9e7f93fc6baf0270fe184bd;hb=affe00276a008038e8a8b37b3812215e382fe98e;hp=7e52cdbcc6af6d20b88be1944f038a306d999c0c;hpb=0b3bd63a30fa9d47e5bf7e63e58b74ceffe36049;p=quix0rs-gnu-social.git diff --git a/actions/invite.php b/actions/invite.php index 7e52cdbcc6..788130c582 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 Action +class InviteAction extends CurrentUserDesignAction { var $mode = null; var $error = null; @@ -35,7 +35,9 @@ class InviteAction extends Action function handle($args) { parent::handle($args); - if (!common_logged_in()) { + if (!common_config('invite', 'enabled')) { + $this->clientError(_('Invites have been disabled.')); + } else if (!common_logged_in()) { $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), common_config('site', 'name'))); return; @@ -96,6 +98,12 @@ class InviteAction extends Action $this->showPage(); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('addresses'); + } + function title() { if ($this->mode == 'sent') { @@ -214,7 +222,7 @@ class InviteAction extends Action $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".