diff --git a/.htaccess b/.htaccess index 5c45ecf..f11ae5e 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,5 @@ -ErrorDocument 403 /tfjm/403.php -ErrorDocument 404 /tfjm/404.php +ErrorDocument 403 /tfjm/server_files/403.php +ErrorDocument 404 /tfjm/server_files/404.php Options +FollowSymlinks Options -Indexes diff --git a/403.php b/403.php deleted file mode 100644 index 5bb2466..0000000 --- a/403.php +++ /dev/null @@ -1,18 +0,0 @@ - - -

Vous n'êtes pas autorisé à accéder à cette page.

- - \ No newline at end of file diff --git a/404.php b/404.php deleted file mode 100644 index 8541945..0000000 --- a/404.php +++ /dev/null @@ -1,18 +0,0 @@ - - -

Cette page n'existe pas.

- - \ No newline at end of file diff --git a/server_files/403.php b/server_files/403.php new file mode 100644 index 0000000..77bc30d --- /dev/null +++ b/server_files/403.php @@ -0,0 +1,12 @@ +Vous n'êtes pas autorisé à accéder à cette page."; + +include "footer.php"; + +exit(); \ No newline at end of file diff --git a/server_files/404.php b/server_files/404.php new file mode 100644 index 0000000..b47428f --- /dev/null +++ b/server_files/404.php @@ -0,0 +1,12 @@ +Cette page n'existe pas."; + +include "footer.php"; + +exit(); \ No newline at end of file diff --git a/server_files/config.php b/server_files/config.php index 18db43f..c90bb7a 100644 --- a/server_files/config.php +++ b/server_files/config.php @@ -56,13 +56,3 @@ function echo_date($date = NULL, $with_time = false) { return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date)); } - -function error403() { - include "../403.php"; -} - -function error404() { - include "../404.php"; -} - -?> diff --git a/server_files/equipe.php b/server_files/equipe.php index bb40602..fff9af4 100644 --- a/server_files/equipe.php +++ b/server_files/equipe.php @@ -11,7 +11,7 @@ if (isset($_POST["validate"])) { $team_data = $DB->query("SELECT * FROM `teams` WHERE `trigram` = '$trigram' AND `year` = $YEAR;")->fetch(); if ($team_data === false) - error404(); + include "404.php"; $tournament_data = $DB->query("SELECT `name`, `date_start` FROM `tournaments` WHERE `id` = '" . $team_data["tournament"] . "' AND `year` = '$YEAR';")->fetch(); diff --git a/server_files/informations.php b/server_files/informations.php index be15241..237d49b 100644 --- a/server_files/informations.php +++ b/server_files/informations.php @@ -3,14 +3,14 @@ include "config.php"; if (!isset($_SESSION["role"]) || $_SESSION["role"] != "ORGANIZER" && $_SESSION["role"] != "ADMIN") { - error403(); + include "403.php"; } $id = $_GET["id"]; $user_data = $DB->query("SELECT * FROM `users` WHERE `id` = $id;")->fetch(); if ($user_data === false) { - error404(); + include "404.php"; } $team_data = false;