summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/register.php4
-rw-r--r--config.php.sample3
-rw-r--r--lib/common.php3
3 files changed, 8 insertions, 2 deletions
diff --git a/actions/register.php b/actions/register.php
index 6ac283059..d97e3a18a 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -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();
diff --git a/config.php.sample b/config.php.sample
index 9eb628d2f..da791f6f0 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -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';
diff --git a/lib/common.php b/lib/common.php
index f92f08b7d..69714be1d 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -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