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