2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once "server_files/config.php";
|
|
|
|
|
|
|
|
require_once "server_files/classes/Document.php";
|
2019-09-20 12:57:06 +00:00
|
|
|
require_once "server_files/classes/DocumentType.php";
|
2019-09-12 18:10:30 +00:00
|
|
|
require_once "server_files/classes/Phase.php";
|
2019-09-20 12:57:06 +00:00
|
|
|
require_once "server_files/classes/Question.php";
|
2019-09-16 22:04:45 +00:00
|
|
|
require_once "server_files/classes/Reason.php";
|
2019-09-09 23:48:52 +00:00
|
|
|
require_once "server_files/classes/Role.php";
|
|
|
|
require_once "server_files/classes/SchoolClass.php";
|
|
|
|
require_once "server_files/classes/Team.php";
|
|
|
|
require_once "server_files/classes/User.php";
|
|
|
|
require_once "server_files/classes/ValidationStatus.php";
|
2019-09-16 22:04:45 +00:00
|
|
|
require_once "server_files/classes/Video.php";
|
2019-09-09 23:48:52 +00:00
|
|
|
require_once "server_files/services/mail.php";
|
|
|
|
require_once "server_files/utils.php";
|
|
|
|
require_once "server_files/model.php";
|
|
|
|
|
|
|
|
loadUserValues();
|
|
|
|
|
|
|
|
if (!isset($_GET["path"]))
|
|
|
|
require_once "server_files/403.php";
|
|
|
|
|
|
|
|
$path = $_GET["path"];
|
|
|
|
|
|
|
|
$ROUTES = [];
|
|
|
|
|
|
|
|
# URL paths
|
|
|
|
|
|
|
|
$ROUTES["^(|accueil|index|accueil\.php|accueil\.html|accueil\.py|index\.php|index\.html|index\.py)$"] = ["server_files/controllers/index.php"];
|
2019-09-23 22:41:53 +00:00
|
|
|
$ROUTES["^ajouter-equipe$"] = ["server_files/controllers/ajouter_equipe.php"];
|
|
|
|
$ROUTES["^ajouter-admin$"] = ["server_files/controllers/ajouter_admin.php"];
|
2019-09-18 22:46:32 +00:00
|
|
|
$ROUTES["^calendrier/(modifier)$"] = ["server_files/controllers/calendrier.php", "edit"];
|
|
|
|
$ROUTES["^calendrier/?$"] = ["server_files/controllers/calendrier.php"];
|
2019-09-23 22:12:33 +00:00
|
|
|
$ROUTES["^commenter-echange-4$"] = ["server_files/controllers/commenter_echange.php"];
|
2019-09-16 22:19:01 +00:00
|
|
|
$ROUTES["^confirmer-mail/([a-z0-9]*)/?$"] = ["server_files/controllers/confirmer_mail.php", "token"];
|
2019-09-09 23:48:52 +00:00
|
|
|
$ROUTES["^connexion/(confirmation-mail)/?$"] = ["server_files/controllers/connexion.php", "confirmation-mail"];
|
2019-09-16 22:19:01 +00:00
|
|
|
$ROUTES["^connexion/(mdp-oublie)/?$"] = ["server_files/controllers/connexion.php", "mdp_oublie"];
|
2019-09-09 23:48:52 +00:00
|
|
|
$ROUTES["^connexion/(reinitialiser_mdp)/(.*)/?$"] = ["server_files/controllers/connexion.php", "reset_password", "token"];
|
|
|
|
$ROUTES["^connexion/?$"] = ["server_files/controllers/connexion.php"];
|
|
|
|
$ROUTES["^deconnexion/?$"] = ["server_files/controllers/deconnexion.php"];
|
2019-09-12 18:10:30 +00:00
|
|
|
$ROUTES["^envoyer-video-1$"] = ["server_files/controllers/envoyer_video.php"];
|
2019-09-09 23:48:52 +00:00
|
|
|
$ROUTES["^equipe/([A-Z]{3})/?$"] = ["server_files/controllers/equipe.php", "trigram"];
|
|
|
|
$ROUTES["^file/([a-z0-9]{64})/?$"] = ["server_files/controllers/view_file.php", "file_id"];
|
|
|
|
$ROUTES["^informations/([0-9]*)/.*?$"] = ["server_files/controllers/informations.php", "id"];
|
|
|
|
$ROUTES["^inscription/?$"] = ["server_files/controllers/inscription.php"];
|
2019-09-16 22:19:01 +00:00
|
|
|
$ROUTES["^mon-compte/?$"] = ["server_files/controllers/mon_compte.php"];
|
|
|
|
$ROUTES["^mon-equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"];
|
|
|
|
$ROUTES["^mon-equipe/?$"] = ["server_files/controllers/mon_equipe.php"];
|
2019-09-20 12:57:06 +00:00
|
|
|
$ROUTES["^poser-questions-2$"] = ["server_files/controllers/poser_questions.php"];
|
2019-09-12 10:18:15 +00:00
|
|
|
$ROUTES["^probleme/([1-4])/?$"] = ["server_files/controllers/probleme.php", "probleme"];
|
2019-09-23 22:41:53 +00:00
|
|
|
$ROUTES["^rejoindre-equipe/?$"] = ["server_files/controllers/rejoindre_equipe.php"];
|
2019-09-21 18:39:40 +00:00
|
|
|
$ROUTES["^repondre-questions-3$"] = ["server_files/controllers/repondre_questions.php"];
|
2019-09-16 22:19:01 +00:00
|
|
|
$ROUTES["^videos-solutions/?$"] = ["server_files/controllers/videos_solutions.php"];
|
2019-09-09 23:48:52 +00:00
|
|
|
|
|
|
|
# Assets files
|
|
|
|
|
|
|
|
$ROUTES["^favicon\.ico$"] = ["assets/favicon.ico", "image/x-icon"];
|
2019-09-10 18:25:26 +00:00
|
|
|
$ROUTES["^logo\.png"] = ["assets/logo.png", "image/png"];
|
2019-09-09 23:48:52 +00:00
|
|
|
$ROUTES["^style\.css$"] = ["assets/style.css", "text/css"];
|
|
|
|
|
|
|
|
foreach ($ROUTES as $route => $file) {
|
|
|
|
if (preg_match('#' . $route . '#', $path, $matches)) {
|
|
|
|
for ($i = 1; $i < sizeof($file); ++$i)
|
|
|
|
$_GET[$file[$i]] = $matches[$i];
|
|
|
|
|
|
|
|
if (!preg_match("#php$#", $file[0])) {
|
|
|
|
header("Content-Type: " . $file[1]);
|
|
|
|
readfile($file[0]);
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @noinspection PhpIncludeInspection */
|
|
|
|
require $file[0];
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once "server_files/404.php";
|