]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
let admins prevent registration
authorEvan Prodromou <evan@prodromou.name>
Thu, 24 Jul 2008 23:55:08 +0000 (19:55 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 24 Jul 2008 23:55:08 +0000 (19:55 -0400)
darcs-hash:20080724235508-84dde-8bac4d9dd772adb9f27d083b3d0b6ed5b7526dbf.gz

actions/register.php
config.php.sample
lib/common.php

index 6ac28305953fc7b1644c48bdcb297ea984cf1fff..d97e3a18af2c2807286251a2f18100877441b0ec 100644 (file)
@@ -24,7 +24,9 @@ class RegisterAction extends Action {
        function handle($args) {
                parent::handle($args);
 
-               if (common_logged_in()) {
+               if (common_config('site', 'closed')) {
+                       common_user_error(_('Registration not allowed.'));
+               } else if (common_logged_in()) {
                        common_user_error(_('Already logged in.'));
                } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                        $this->try_register();
index 9eb628d2f61427bc15172c1aa8b0483d151c6bef..da791f6f03eac11364ea406aeecf6743f99d8ce1 100644 (file)
@@ -23,6 +23,9 @@ $config['site']['path'] = 'laconica';
 #Brought by...
 #$config['site']['broughtby'] = 'Individual or Company';
 #$config['site']['broughtbyurl'] = 'http://example.net/';
+#If you don't want to let users register (say, for a one-person install)
+#Crude but effective -- register everybody, then lock down
+#$config['site']['closed'] = true;
 
 # If you want logging sent to a file instead of syslog
 #$config['site']['logfile'] = '/tmp/laconica.log';
index f92f08b7d6d4718b7a82a623422c2ecdfc50b4e5..69714be1d0c9347b94c78b468adc58c65c16e70c 100644 (file)
@@ -50,7 +50,8 @@ $config =
                      array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL,
                          'broughtby' => NULL,
                          'timezone' => 'UTC',
-                         'broughtbyurl' => NULL),
+                         'broughtbyurl' => NULL,
+                         'closed' => false),
                'syslog' =>
                array('appname' => 'laconica', # for syslog
                          'priority' => 'debug'), # XXX: currently ignored