<?php
session_start();

// Check if we are currently impersonating someone
if (isset($_SESSION['original_user_id'])) {
    // Restore the original user's session
    $_SESSION['user_id'] = $_SESSION['original_user_id'];
    unset($_SESSION['original_user_id']);
}

// Redirect back to the main dashboard
header('Location: dashboard.php');
exit;
