<?php
session_start();
if (!empty($_SESSION['user_id']) && in_array($_SESSION['user_role'] ?? '', ['teacher', 'admin'], true)) {
    header('Location: dashboard/');
} else {
    header('Location: login.php');
}
exit;
