summaryrefslogtreecommitdiff
path: root/includes/pages/guest_login.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-12 14:41:23 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commitc33940f64a1e5b59afd700010247382f5b7b2df3 (patch)
tree453b8810c90cd78e75a1425a4f4f002e585d121a /includes/pages/guest_login.php
parent951828a4f1175f99666a48629ea125640cc7c598 (diff)
Moved permission checks to Authenticator class
Diffstat (limited to 'includes/pages/guest_login.php')
-rw-r--r--includes/pages/guest_login.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index e1c6dfa4..2df09d79 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -39,7 +39,6 @@ function logout_title()
*/
function guest_register()
{
- global $privileges;
$authUser = auth()->user();
$tshirt_sizes = config('tshirt_sizes');
$enable_tshirt_size = config('enable_tshirt_size');
@@ -71,7 +70,7 @@ function guest_register()
}
}
- if (!in_array('register', $privileges) || (!$authUser && !config('registration_enabled'))) {
+ if (!auth()->can('register') || (!$authUser && !config('registration_enabled'))) {
error(__('Registration is disabled.'));
return page_with_title(register_title(), [
@@ -472,9 +471,7 @@ function guest_login()
*/
function get_register_hint()
{
- global $privileges;
-
- if (in_array('register', $privileges) && config('registration_enabled')) {
+ if (auth()->can('register') && config('registration_enabled')) {
return join('', [
'<p>' . __('Please sign up, if you want to help us!') . '</p>',
buttons([