diff --git a/assets/css/styles.css b/assets/css/styles.css index e162b18..a4e4833 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -136,7 +136,7 @@ body { margin-top: 20px; } -.accept-button, .reject-button { +.accept-button, .reject-button, .delete-button { font-size: 16px; border: none; border-radius: 5px; @@ -144,7 +144,7 @@ body { margin: 0 10px; } -.accept-button .offset, .reject-button .offset { +.offset { padding: 10px 20px; } @@ -213,4 +213,11 @@ body { .submit-button:hover { background-color: #5b6eae; +} + +.warning-ping { + font-weight: bold; + text-transform: uppercase; + margin: 10px 10px; + color: red; } \ No newline at end of file diff --git a/case.php b/case.php index 62230e4..8c14c5b 100644 --- a/case.php +++ b/case.php @@ -152,13 +152,13 @@ function getContrastColor($hexColor)
Eingesendet am: getDate()); ?>
Everyone-Ping: pingsEveryone() ? "Ja" : "Nein"; ?> + class="accent">Everyone-Ping: ">pingsEveryone() ? "Ja" : "Nein"; ?>
Status:
>Nutzer-Status: isBlocked() ? "blockiert " : "nicht blockiert "; ?> isModerator()) { ?>
@@ -177,7 +177,21 @@ class="isBlocked() ? "reject" : "accept"; ?>-button"> - isProcessed()) { ?> + isProcessed() && !$as->inBotGuild()) { + + ?> + +
+ +
+ + isProcessed() && $as->inBotGuild()) { ?>

@@ -201,7 +218,7 @@ class="reject-button offset">Ablehnen User Avatar
-
getUsername(); ?>
+
getUsername(); if($as->isModerator()) { ?> (Moderator)

Discord-ID: getDiscordId(); ?>
diff --git a/php/request.inc.php b/php/request.inc.php index 862fdb2..1605f89 100644 --- a/php/request.inc.php +++ b/php/request.inc.php @@ -413,7 +413,7 @@ function getDate() return substr($haystack, 0, $length) === $needle; } - function rejectRequest(User $login, $reason, $create_thread): bool + function rejectRequest(User $login, $reason, $create_thread, $silent): bool { $this->request['reason'] = $this->testInput($reason); @@ -424,18 +424,18 @@ function rejectRequest(User $login, $reason, $create_thread): bool $dmEmbed = $this->generateDMEmbed(false, $login); $delete = $login->deleteMessage(getenv("GUILD_DEVMARKT_REQUEST_CHANNEL"), $this->getMessageID()); - if (!$delete) { - echo 'Alte Nachricht konnte nicht gelöscht werden[ignore]'; - } if (!$this->updateRequest("abgelehnt", $login->getDiscordID(), $dateProcessed, $this->getMessageID())) { return false; } - if (!$at->sendDMMessage(null, $dmEmbed, false, null)) { - echo 'Nutzer nimmt keine DM-Nachrichten an. Persönlich kontaktieren! Case'; - $acceptsDMs = false; - } - if($create_thread) { + if(!$silent) { + + if (!$at->sendDMMessage(null, $dmEmbed, false, null)) { + echo 'Nutzer nimmt keine DM-Nachrichten an. Persönlich kontaktieren! Case'; + $acceptsDMs = false; + } + + if($create_thread) { $thread_id = $this->getApplicant()->createRejectThread(); @@ -460,6 +460,7 @@ function rejectRequest(User $login, $reason, $create_thread): bool } + } } $devmarktRequestEmbed = $this->generateProcessedEmbed(false, $login, $acceptsDMs); diff --git a/process.php b/process.php index 8315067..5771c2a 100644 --- a/process.php +++ b/process.php @@ -36,8 +36,10 @@ $request->acceptRequest($login); } else if ($action == "decline") { if (isset($_POST['reason'])) { - $request->rejectRequest($login, $_POST['reason'], true); + $request->rejectRequest($login, $_POST['reason'], true, false); } + } else if($action == "silent-decline") { + $request->rejectRequest($login, "Nutzer nicht mehr auf dem DevCord" ,false, true); } } @@ -89,9 +91,8 @@ $at = new User($st['by_discord_id']); - if(!$at->inBotGuild()) { - echo 'Nutzer ist nicht mehr auf dem Discord.'; - exit(); + if(!$at->inBotGuild() && $status == "angenommen") { + header('Location: case.php?req_id=' . $req_id . "&msg=left"); } if ($status == 'angenommen') { @@ -104,17 +105,19 @@ ]); if(json_decode($req->getBody())->premium_tier >= 2 || in_array("PARTNERED", json_decode($req->getBody())->features)) { - $request->rejectRequest($login, $_POST['reason'], true); + $request->rejectRequest($login, $_POST['reason'], true, false); return; } - $request->rejectRequest($login, $_POST['reason'], false); + $request->rejectRequest($login, $_POST['reason'], false, false); } else { - $request->rejectRequest($login, $_POST['reason'],false); + $request->rejectRequest($login, $_POST['reason'],false, false); } } else { include('reason.php'); } + } else if($status == 'silent-decline') { + $request->rejectRequest($login, "Nutzer nicht mehr auf dem Discord", false, true); } }