Don't allow Twitter registration if site is invite only

This commit is contained in:
Zach Copley 2011-09-17 14:47:35 -07:00
parent 985f52ce60
commit 6c43967e8c

View File

@ -385,41 +385,44 @@ class TwitterauthorizationAction extends Action
$this->hidden('tw_fields_screen_name', $this->tw_fields['screen_name']); $this->hidden('tw_fields_screen_name', $this->tw_fields['screen_name']);
$this->hidden('tw_fields_name', $this->tw_fields['fullname']); $this->hidden('tw_fields_name', $this->tw_fields['fullname']);
$this->elementStart('fieldset'); // Don't allow new account creation if site is flagged as invite only
$this->hidden('token', common_session_token()); if (common_config('site', 'inviteonly') == false) {
$this->element('legend', null, $this->elementStart('fieldset');
// TRANS: Fieldset legend. $this->hidden('token', common_session_token());
_m('Create new account')); $this->element('legend', null,
$this->element('p', null, // TRANS: Fieldset legend.
// TRANS: Sub form introduction text. _m('Create new account'));
_m('Create a new user with this nickname.')); $this->element('p', null,
$this->elementStart('ul', 'form_data'); // TRANS: Sub form introduction text.
_m('Create a new user with this nickname.'));
$this->elementStart('ul', 'form_data');
// Hook point for captcha etc // Hook point for captcha etc
Event::handle('StartRegistrationFormData', array($this)); Event::handle('StartRegistrationFormData', array($this));
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Field label. // TRANS: Field label.
$this->input('newname', _m('New nickname'), $this->input('newname', _m('New nickname'),
($this->username) ? $this->username : '', ($this->username) ? $this->username : '',
// TRANS: Field title for nickname field. // TRANS: Field title for nickname field.
_m('1-64 lowercase letters or numbers, no punctuation or spaces.')); _m('1-64 lowercase letters or numbers, no punctuation or spaces.'));
$this->elementEnd('li'); $this->elementEnd('li');
$this->elementStart('li'); $this->elementStart('li');
// TRANS: Field label. // TRANS: Field label.
$this->input('email', _m('LABEL','Email'), $this->getEmail(), $this->input('email', _m('LABEL','Email'), $this->getEmail(),
// TRANS: Field title for e-mail address field. // TRANS: Field title for e-mail address field.
_m('Used only for updates, announcements, '. _m('Used only for updates, announcements, '.
'and password recovery')); 'and password recovery'));
$this->elementEnd('li'); $this->elementEnd('li');
// Hook point for captcha etc // Hook point for captcha etc
Event::handle('EndRegistrationFormData', array($this)); Event::handle('EndRegistrationFormData', array($this));
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Button text for creating a new StatusNet account in the Twitter connect page. // TRANS: Button text for creating a new StatusNet account in the Twitter connect page.
$this->submit('create', _m('BUTTON','Create')); $this->submit('create', _m('BUTTON','Create'));
$this->elementEnd('fieldset'); $this->elementEnd('fieldset');
}
$this->elementStart('fieldset'); $this->elementStart('fieldset');
$this->element('legend', null, $this->element('legend', null,