]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/register.php
fix 0.7.x 0.8.x merge conflict in register.php
[quix0rs-gnu-social.git] / actions / register.php
index 033cf557f8959d7ded047794425207e82a1b82ca..dcbbbdb6a6de9afb238715b7ff1cac3d78f40b7d 100644 (file)
@@ -382,6 +382,19 @@ class RegisterAction extends Action
 
     function showFormContent()
     {
+        $code = $this->trimmed('code');
+
+        $invite = null;
+
+        if ($code) {
+            $invite = Invitation::staticGet($code);
+        }
+
+        if (common_config('site', 'inviteonly') && !($code && $invite)) {
+            $this->clientError(_('Sorry, only invited people can register.'));
+            return;
+        }
+
         $this->elementStart('form', array('method' => 'post',
                                           'id' => 'form_register',
                                           'class' => 'form_settings',