diff options
Diffstat (limited to 'includes/pages')
-rw-r--r-- | includes/pages/admin_log.php | 8 | ||||
-rw-r--r-- | includes/pages/guest_login.php | 12 | ||||
-rw-r--r-- | includes/pages/user_atom.php | 3 |
3 files changed, 14 insertions, 9 deletions
diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index 03c9abb0..694b1d5a 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -17,12 +17,10 @@ function admin_log() if (request()->has('keyword')) { $filter = strip_request_item('keyword'); } - $log_entries_source = LogEntries_filter($filter); + $log_entries = LogEntries_filter($filter); - $log_entries = []; - foreach ($log_entries_source as $log_entry) { + foreach ($log_entries as &$log_entry) { $log_entry['date'] = date('d.m.Y H:i', $log_entry['timestamp']); - $log_entries[] = $log_entry; } return page_with_title(admin_log_title(), [ @@ -33,7 +31,7 @@ function admin_log() ]), table([ 'date' => 'Time', - 'nick' => 'Angel', + 'level' => 'Type', 'message' => 'Log Entry' ], $log_entries) ]); 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([ diff --git a/includes/pages/user_atom.php b/includes/pages/user_atom.php index 2991bdbf..c9d9398e 100644 --- a/includes/pages/user_atom.php +++ b/includes/pages/user_atom.php @@ -1,7 +1,6 @@ <?php use Engelsystem\Database\DB; -use Engelsystem\Http\Request; /** * Publically available page to feed the news to feed readers @@ -45,7 +44,7 @@ function user_atom() */ function make_atom_entries_from_news($news_entries) { - $request = Request::getInstance(); + $request = app('request'); $html = '<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Engelsystem</title> |