makes invites work for opt-out sites

This commit is contained in:
Hannes Mannerheim 2015-01-19 18:01:10 +01:00
parent 86ea303e4e
commit 778d75e6f0

View File

@ -224,8 +224,12 @@ class QvitterPlugin extends Plugin {
'qvitter'); 'qvitter');
} }
// if qvitter is opt-out, disable the default register page // if qvitter is opt-out, disable the default register page (if we don't have a valid invitation code)
if(self::settings('enabledbydefault')) { $code = $_POST['code'];
if(!empty($code)) {
$valid_code = Invitation::getKV('code', $code);
}
if(self::settings('enabledbydefault') && empty($valid_code)) {
$m->connect('main/register', $m->connect('main/register',
array('action' => 'qvitter')); array('action' => 'qvitter'));
} }