diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-20 12:18:08 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-20 12:18:08 +0200 |
commit | 945fcb079a219fa29e8f6ee1afc3f1c0c5c822cb (patch) | |
tree | 7f03157616509fe583b1b0aea6e2d06c53bd9c89 /includes/pages/guest_login.php | |
parent | c6ef1120f82839cbb9d5abee12ab3e4803d5e2cd (diff) |
Added registration_enabled configuration
Diffstat (limited to 'includes/pages/guest_login.php')
-rw-r--r-- | includes/pages/guest_login.php | 12 |
1 files changed, 10 insertions, 2 deletions
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('', [ '<p>' . _('Please sign up, if you want to help us!') . '</p>', buttons([ |