Ajout de création de user (fonctionnel), de suppression d'user (fonctionnel), et envoi de log (fonctionnel mais pas implémenté)

This commit is contained in:
Esteban
2026-06-08 11:07:19 +02:00
parent 9a1fbf1252
commit f58d981ddc
7 changed files with 210 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
// Fonction qui va ENVOYER des logs sur le webhook discord
function sendLog($action, $user="") {
$webhook = "https://discord.com/api/webhooks/1513460601056264242/JzPzMzbxWSGDzL-5Gfqa6tkzzaW74ZV9026-nSraOHS_dQF_YD1-N4S6M6IUv_kKoNhn";
$contenuLog = "**Nouvelle log du portfolio**\n\n";
$contenuLog .= "**Action :** " . $action . "\n";
if ($user != "") {
$contenuLog .= "**Utilisateur :** " . $user . "\n";
} else {
$contenuLog .= "**Utilisateur :** non défini". "\n";
}
$data = [
"content" => $contenuLog
];
$dataJson = json_encode($data);
$ch = curl_init($webhook); // On démarre une ressource curl
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataJson);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
}