plateforme-corres2math/server_files/controllers/probleme.php

27 lines
694 B
PHP

<?php
$problem = htmlspecialchars($_GET["probleme"]);
if (!preg_match("#[0-4]#", $problem))
require_once "server_files/404.php";
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ADMIN)
require_once "server_files/403.php";
$has_error = false;
$error_message = null;
$teams = Team::getAllTeams($problem);
$validated_emails = [];
$not_validated_emails = [];
foreach ($teams as $team) {
if ($team->getValidationStatus() == ValidationStatus::VALIDATED)
$validated_emails = array_merge($validated_emails, $team->getAllEmails());
else
$not_validated_emails = array_merge($not_validated_emails, $team->getAllEmails());
}
require_once "server_files/views/probleme.php";