From 945fcb079a219fa29e8f6ee1afc3f1c0c5c822cb Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 20 Sep 2017 12:18:08 +0200 Subject: Added registration_enabled configuration --- includes/pages/guest_login.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'includes/pages/guest_login.php') diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 9179c6c4..0577951f 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -33,7 +33,7 @@ function logout_title() */ function guest_register() { - global $user; + global $user, $privileges; $tshirt_sizes = config('tshirt_sizes'); $enable_tshirt_size = config('enable_tshirt_size'); $min_password_length = config('min_password_length'); @@ -75,6 +75,14 @@ function guest_register() } } + if (!in_array('register', $privileges) || (!isset($user) && !config('registration_enabled'))) { + error(_('Registration is disabled.')); + + return page_with_title(register_title(), [ + msg(), + ]); + } + if ($request->has('submit')) { $valid = true; @@ -496,7 +504,7 @@ function get_register_hint() { global $privileges; - if (in_array('register', $privileges)) { + if (in_array('register', $privileges) && config('registration_enabled')) { return join('', [ '

' . _('Please sign up, if you want to help us!') . '

', buttons([ -- cgit v1.2.3-54-g00ecf