forked from GNUsocial/gnu-social
Merge commit 'jeff-themovie/invite-enabled' into 0.8.x
* commit 'jeff-themovie/invite-enabled': Adds $config['invite']['enabled'] to enable/disable invites.
This commit is contained in:
commit
b10dba2798
7
README
7
README
@ -1081,6 +1081,13 @@ debug: if turned on, this will make the XMPP library blurt out all of
|
||||
public: an array of JIDs to send _all_ notices to. This is useful for
|
||||
participating in third-party search and archiving services.
|
||||
|
||||
invite
|
||||
------
|
||||
|
||||
For configuring invites.
|
||||
|
||||
enabled: Whether to allow users to send invites. Default true.
|
||||
|
||||
tag
|
||||
---
|
||||
|
||||
|
@ -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;
|
||||
|
@ -86,6 +86,9 @@ $config['sphinx']['port'] = 3312;
|
||||
// $config['xmpp']['public'][] = 'someindexer@example.net';
|
||||
// $config['xmpp']['debug'] = false;
|
||||
|
||||
// Turn off invites
|
||||
// $config['invite']['enabled'] = false;
|
||||
|
||||
// Default locale info
|
||||
// $config['site']['timezone'] = 'Pacific/Auckland';
|
||||
// $config['site']['language'] = 'en_NZ';
|
||||
|
@ -422,11 +422,13 @@ class Action extends HTMLOutputter // lawsuit
|
||||
$this->menuItem(common_local_url('smssettings'),
|
||||
_('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
|
||||
}
|
||||
$this->menuItem(common_local_url('invite'),
|
||||
_('Invite'),
|
||||
sprintf(_('Invite friends and colleagues to join you on %s'),
|
||||
common_config('site', 'name')),
|
||||
false, 'nav_invitecontact');
|
||||
if (common_config('invite', 'enabled')) {
|
||||
$this->menuItem(common_local_url('invite'),
|
||||
_('Invite'),
|
||||
sprintf(_('Invite friends and colleagues to join you on %s'),
|
||||
common_config('site', 'name')),
|
||||
false, 'nav_invitecontact');
|
||||
}
|
||||
$this->menuItem(common_local_url('logout'),
|
||||
_('Logout'), _('Logout from the site'), false, 'nav_logout');
|
||||
}
|
||||
|
@ -175,6 +175,8 @@ $config =
|
||||
'host' => null, # only set if != server
|
||||
'debug' => false, # print extra debug info
|
||||
'public' => array()), # JIDs of users who want to receive the public stream
|
||||
'invite' =>
|
||||
array('enabled' => true),
|
||||
'sphinx' =>
|
||||
array('enabled' => false,
|
||||
'server' => 'localhost',
|
||||
|
@ -213,12 +213,14 @@ class FacebookAction extends Action
|
||||
array('href' => 'index.php', 'title' => _('Home')), _('Home'));
|
||||
$this->elementEnd('li');
|
||||
|
||||
$this->elementStart('li',
|
||||
array('class' =>
|
||||
($this->action == 'facebookinvite') ? 'current' : 'facebook_invite'));
|
||||
$this->element('a',
|
||||
array('href' => 'invite.php', 'title' => _('Invite')), _('Invite'));
|
||||
$this->elementEnd('li');
|
||||
if (common_config('invite', 'enabled')) {
|
||||
$this->elementStart('li',
|
||||
array('class' =>
|
||||
($this->action == 'facebookinvite') ? 'current' : 'facebook_invite'));
|
||||
$this->element('a',
|
||||
array('href' => 'invite.php', 'title' => _('Invite')), _('Invite'));
|
||||
$this->elementEnd('li');
|
||||
}
|
||||
|
||||
$this->elementStart('li',
|
||||
array('class' =>
|
||||
|
@ -100,7 +100,7 @@ class SubGroupNav extends Widget
|
||||
$this->user->nickname),
|
||||
$action == 'usergroups',
|
||||
'nav_usergroups');
|
||||
if (!is_null($cur) && $this->user->id === $cur->id) {
|
||||
if (common_config('invite', 'enabled') && !is_null($cur) && $this->user->id === $cur->id) {
|
||||
$this->out->menuItem(common_local_url('invite'),
|
||||
_('Invite'),
|
||||
sprintf(_('Invite friends and colleagues to join you on %s'),
|
||||
|
@ -273,11 +273,13 @@ class FBConnectPlugin extends Plugin
|
||||
$action->menuItem(common_local_url('smssettings'),
|
||||
_('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
|
||||
}
|
||||
$action->menuItem(common_local_url('invite'),
|
||||
_('Invite'),
|
||||
sprintf(_('Invite friends and colleagues to join you on %s'),
|
||||
common_config('site', 'name')),
|
||||
false, 'nav_invitecontact');
|
||||
if (common_config('invite', 'enabled')) {
|
||||
$action->menuItem(common_local_url('invite'),
|
||||
_('Invite'),
|
||||
sprintf(_('Invite friends and colleagues to join you on %s'),
|
||||
common_config('site', 'name')),
|
||||
false, 'nav_invitecontact');
|
||||
}
|
||||
|
||||
// Need to override the Logout link to make it do FB stuff
|
||||
if (!empty($fbuid)) {
|
||||
|
Loading…
Reference in New Issue
Block a user