- if (!common_logged_in()) {
- $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'),
+ 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.'),