X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Finvite.php;h=ab43a2491d581edfb17120d50cbb32f02eb2b65c;hb=70fc32c5b93a6cd71cf33212ac792c38632bbdb3;hp=c793f582491035d752ae1b696f4a2bed8764ebd5;hpb=44343986c31b20158ef07438f85a6bf35b93a3ab;p=quix0rs-gnu-social.git diff --git a/actions/invite.php b/actions/invite.php index c793f58249..ab43a2491d 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 { @@ -35,7 +35,9 @@ class InviteAction extends CurrentUserDesignAction 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; @@ -214,7 +216,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". @@ -233,7 +235,7 @@ class InviteAction extends CurrentUserDesignAction common_root_url(), $personal, common_local_url('showstream', array('nickname' => $user->nickname)), - common_local_url('register', array('code' => $invite->code))); + common_local_url((!common_config('site', 'openidonly')) ? 'register' : 'openidlogin', array('code' => $invite->code))); mail_send($recipients, $headers, $body); }