<?php
/**
 * @intranet-file index.php
 * @intranet-file-version 2026.03.13.1
 * @intranet-file-date 2026-03-13
 * @intranet-file-owner CSIF Intranet
 */
ini_set('session.gc_maxlifetime', '3600');
session_start();
require_once __DIR__ . '/common/url.php';
require_once __DIR__ . '/common/user_preferences.php';

if (isset($_SESSION['username'])) {
    if (!intranet_enforce_session_timeout()) {
        header('Location: ' . login_url('expired=1'));
        exit();
    }
    header('Location: ' . app_url('dashboard.php'));
} else {
    header('Location: ' . login_url());
}
exit;
