<?php
require 'db.php';
require 'functions.php';

if (isLoggedIn() && currentRole() === 'rnduser') {
    logActivity($pdo, 'rnduser', currentUserId(), 'logout', 'rnduser', currentUserId(), 'RND user logged out');
}
$_SESSION = [];
session_destroy();
header('Location: rnd_login.php');
exit;
