From f9ebba15577b725a6a5068147bb912a8e282e490 Mon Sep 17 00:00:00 2001 From: Loris BALOCCHI Date: Fri, 14 Jun 2024 17:33:40 +0200 Subject: [PATCH] fix: Update include paths for Discord webhooks in login, register, and new event pages --- account/login/login.php | 2 +- account/register/register.php | 2 +- events/new/eventCreate.php | 2 +- {views => tools}/discordWebhookLogin.php | 0 {views => tools}/discordWebhookNewEvent.php | 0 {views => tools}/discordWebhookRegister.php | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename {views => tools}/discordWebhookLogin.php (100%) rename {views => tools}/discordWebhookNewEvent.php (100%) rename {views => tools}/discordWebhookRegister.php (100%) diff --git a/account/login/login.php b/account/login/login.php index 9c04fcf..b59df73 100644 --- a/account/login/login.php +++ b/account/login/login.php @@ -50,7 +50,7 @@ if (!$result) { // Utilistation d'un Webhook Discord pour notifier l'administrateur de la //connexion des utilisateurs [fork de : https://stackoverflow.com/a/73547248] - include ($_SERVER['DOCUMENT_ROOT'] . '/views/discordWebhookLogin.php'); + include ($_SERVER['DOCUMENT_ROOT'] . '/tools/discordWebhookLogin.php'); header("Location: /?res=login-succeeded"); die(); diff --git a/account/register/register.php b/account/register/register.php index 91ac227..7399ff4 100644 --- a/account/register/register.php +++ b/account/register/register.php @@ -74,7 +74,7 @@ if (!$resultAddUser) { echo "

Mot de passe : " . $password . "

"; echo "

Mot de passe hashé : " . $hashedPassword . "

"; echo "

Rôle : " . $role . "

"; - include ($_SERVER['DOCUMENT_ROOT'] . '/views/discordWebhookRegister.php'); + include ($_SERVER['DOCUMENT_ROOT'] . '/tools/discordWebhookRegister.php'); header("Location: /?res=login-succeeded"); die(); } else { diff --git a/events/new/eventCreate.php b/events/new/eventCreate.php index fea88a4..f22d5d8 100644 --- a/events/new/eventCreate.php +++ b/events/new/eventCreate.php @@ -40,7 +40,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($result) { echo "

L'évènement a bien été créé.

"; - include ($_SERVER['DOCUMENT_ROOT'] . '/views/discordWebhookNewEvent.php'); + include ($_SERVER['DOCUMENT_ROOT'] . '/tools/discordWebhookNewEvent.php'); header("Location: /events/new?result=event-creation-succeded"); } else { echo "

Une erreur est survenue lors de la création de l'évènement. Erreur : " . mysqli_error($db) . "

"; diff --git a/views/discordWebhookLogin.php b/tools/discordWebhookLogin.php similarity index 100% rename from views/discordWebhookLogin.php rename to tools/discordWebhookLogin.php diff --git a/views/discordWebhookNewEvent.php b/tools/discordWebhookNewEvent.php similarity index 100% rename from views/discordWebhookNewEvent.php rename to tools/discordWebhookNewEvent.php diff --git a/views/discordWebhookRegister.php b/tools/discordWebhookRegister.php similarity index 100% rename from views/discordWebhookRegister.php rename to tools/discordWebhookRegister.php