<?php
session_start();

function restrictAccess($allowedUserTypes) {
    if (!isset($_SESSION['utype']) || !in_array($_SESSION['utype'], $allowedUserTypes)) {
        // Redirect to a forbidden page or login page
        header("Location: ./logout.php");
        exit();
    }
}
?>