<?php
session_start();
require_once __DIR__ . '/../../app/config/db.php';
$pdo = crm_pdo();

if (!isset($_SESSION['user_id'])) {
        header('Location: /gopools/public/auth/login.php');
            exit;
}

$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ? AND active = 1");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();

if (!$user) {
        session_destroy();
            header('Location: /gopools/public/auth/login.php');
                exit;
}

