feat: add campsites link to members area menu with membership access control

- Replace 'Coming Soon!' with 'Campsites' link in Members Area dropdown
- Add membership verification check to campsites.php
- Redirect non-logged-in users to login page
- Redirect non-members to index page
- Only active members can access campsites feature
This commit is contained in:
twotalesanimation
2025-12-04 23:01:28 +02:00
parent 32651ed433
commit b52c46b67c
2 changed files with 13 additions and 1 deletions

View File

@@ -299,7 +299,7 @@ if ($headerStyle === 'light') {
<?php if ($is_member) : ?> <?php if ($is_member) : ?>
<li class="dropdown"><a href="#">Members Area</a> <li class="dropdown"><a href="#">Members Area</a>
<ul> <ul>
<li><a href="#">Coming Soon!</a></li> <li><a href="campsites">Campsites</a></li>
</ul> </ul>
</li> </li>
<?php endif; ?> <?php endif; ?>

View File

@@ -3,6 +3,18 @@ $headerStyle = 'light';
$rootPath = dirname(dirname(dirname(__DIR__))); $rootPath = dirname(dirname(dirname(__DIR__)));
include_once($rootPath . '/header.php'); include_once($rootPath . '/header.php');
// Check if user has active membership
if (!isset($_SESSION['user_id'])) {
header('Location: login');
exit;
}
$is_member = getUserMemberStatus($_SESSION['user_id']);
if (!$is_member) {
header('Location: index');
exit;
}
$conn = openDatabaseConnection(); $conn = openDatabaseConnection();
$stmt = $conn->prepare("SELECT * FROM campsites"); $stmt = $conn->prepare("SELECT * FROM campsites");
$stmt->execute(); $stmt->execute();