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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user