From 37716eebed08e8d07cbdae5422c1c2b9ff194ff0 Mon Sep 17 00:00:00 2001 From: Giraffaman Date: Fri, 5 Jan 2024 15:15:45 +0100 Subject: [PATCH] #23 - hide pools list from anonymous users --- ext/pools/main.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/pools/main.php b/ext/pools/main.php index e9f38cc6c..f867e8de4 100644 --- a/ext/pools/main.php +++ b/ext/pools/main.php @@ -227,8 +227,13 @@ public function onPageRequest(PageRequestEvent $event) $search = ""; $page_num = $event->try_page_num(0); } - $this->list_pools($page, $page_num, $search); - } elseif ($event->page_matches("pool")) { + if($user->is_logged_in()) { + $this->list_pools($page, $page_num, $search); + } else { + $errMessage = "You must be registered and logged in to view pools."; + $this->theme->display_error(401, "Error", $errMessage); + } + } elseif ($event->page_matches("pool")) { $pool_id = 0; $pool = [];