<?php

session_start();

require_once "../env.inc.php";
require_once "../access.inc.php";
require_once "../conf.inc.php";
require_once DIR_PHP_LAYOUTS . "header.php";

if (cron::ifLocalHost()) {
        // Email d'assignation
        cron::sendMailAssignDocument();
        
} else {
    header('HTTP/1.0 401 Unauthorized');
    header('Content-Type: text/html; charset=utf-8');
    echo '  <!DOCTYPE html>
            <html lang="fr">
            <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <title>403 Accès Interdit</title>
                <style>
                    body {
                        font-family: Arial, sans-serif;
                        background-color: #f8d7da;
                        color: #721c24;
                        text-align: center;
                        padding: 50px;
                    }
                    h1 {
                        font-size: 2em;
                    }
                </style>
            </head>
            <body>
                <h1>403 Accès Interdit</h1>
            </body>
            </html>';
    exit();
}
