<?php
session_start();
if (!isset($_SESSION['user_id'])) {
    $_SESSION['error'] = "Anda harus login terlebih dahulu!";
    header("Location: ../../login");
    exit();
}

if ($_SESSION['role'] !== 'user') {
    exit();
}

?>