<?php
declare(strict_types=1);
require_once __DIR__ . '/../../authentication/api/connect.php';
require_auth();
$module=(string)($_GET['module']??'');
if(!preg_match('/^[a-z0-9-]{1,80}$/',$module)||!is_file(__DIR__.'/modules/'.$module.'.php')){
    http_response_code(404);
    echo 'Module page not found.';
    exit;
}
header('Location: '.app_path().'/shared/views/modules/'.$module.'.php',true,302);
exit;
