<?php
require_once('config.php');

if (is_logged_in()) {
    log_action($_SESSION['user_id'], null, 'LOGOUT', 'User logged out');
}

// Destroy session
session_destroy();

// Redirect to login
header('Location: ' . BASE_URL . 'login.php');
exit;
