Skip to content

Commit

Permalink
#23 - hide pools list from anonymous users
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraffaman committed Jan 5, 2024
1 parent ad943e8 commit 37716ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ext/pools/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down

0 comments on commit 37716ee

Please sign in to comment.