diff options
author | Jeffery To <jeffery.to@gmail.com> | 2009-06-14 16:17:22 +0800 |
---|---|---|
committer | Jeffery To <jeffery.to@gmail.com> | 2009-06-14 16:17:22 +0800 |
commit | 6d308f6ffe3f894c60fafaea3ceaef86d30dfe1d (patch) | |
tree | 8cea1b246bfb704c76d67e519d4ce3b0fccf5844 /actions | |
parent | 77c94c44a622052366dcc03fee522232672d71d9 (diff) |
Adds $config['invite']['enabled'] to enable/disable invites.
The invite function may not applicable for private and/or closed installs. This adds a configuration option to enable/disable invites (defaulting to enabled), hides the "Invite" nav item when necessary, and adds a check to actions/invite.php.
Note that I haven't tried the Facebook application so I didn't add any checks to actions/facebookinvite.php.
Diffstat (limited to 'actions')
-rw-r--r-- | actions/invite.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actions/invite.php b/actions/invite.php index 7e52cdbcc..9631f7a7f 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -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; |