<?php
/**
 * Logout from all devices
 * Clears all sessions for the current user
 */

require_once '../config/config.php';

requireAdmin();

$pdo = getDB();
$userId = $_SESSION['user_id'];

// In a production system, you would have a sessions table
// Delete all sessions for this user
// For now, just change password hash to invalidate all sessions
// Or implement a proper session management table

// Clear current session
session_destroy();

// Redirect to login
header('Location: ../login.php?msg=logged_out_all');
exit;
?>