From 5607aacd16385d7d60b9f0669e7a56fc35ae38b9 Mon Sep 17 00:00:00 2001
From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com>
Date: Fri, 30 Jan 2026 17:29:50 +0100
Subject: [PATCH] Account deleted flag
---
.../admin/user/[id]/_components/forms.tsx | 23 +++++++++++++++++++
apps/hub/app/(app)/admin/user/page.tsx | 3 +++
packages/database/prisma/schema/log.prisma | 13 ++++++-----
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/apps/hub/app/(app)/admin/user/[id]/_components/forms.tsx b/apps/hub/app/(app)/admin/user/[id]/_components/forms.tsx
index 25789965..486fef70 100644
--- a/apps/hub/app/(app)/admin/user/[id]/_components/forms.tsx
+++ b/apps/hub/app/(app)/admin/user/[id]/_components/forms.tsx
@@ -691,6 +691,29 @@ export const AdminForm = ({
)}
+ {user.isDeleted && (
+
+
+
+ {openBans.map((ban) => (
+
+
Account gelöscht
+
+ ))}
+ {openTimebans.map((timeban) => (
+
+
+ Dieser Account ist als gelöscht markiert, der Nutzer kann sich nicht mehr
+ anmelden.
+
+
+ ))}
+
+
+ Achtung! Die Strafe(n) sind aktiv, die Rechte des Nutzers müssen nicht angepasst werden!
+
+
+ )}
{(user.CanonicalUser || (user.Duplicates && user.Duplicates.length > 0)) && (
diff --git a/apps/hub/app/(app)/admin/user/page.tsx b/apps/hub/app/(app)/admin/user/page.tsx
index 5ba79384..6672f938 100644
--- a/apps/hub/app/(app)/admin/user/page.tsx
+++ b/apps/hub/app/(app)/admin/user/page.tsx
@@ -63,6 +63,9 @@ const AdminUserPage = () => {
if (activePenaltys.length > 0) {
return AKTIVE STRAFE;
}
+ if (props.row.original.isDeleted) {
+ return GELÖSCHT;
+ }
if (props.row.original.permissions.length === 0) {
return Keine;
} else if (props.row.original.permissions.includes("ADMIN_USER_ADVANCED")) {
diff --git a/packages/database/prisma/schema/log.prisma b/packages/database/prisma/schema/log.prisma
index 59911faf..ad83484e 100644
--- a/packages/database/prisma/schema/log.prisma
+++ b/packages/database/prisma/schema/log.prisma
@@ -4,14 +4,14 @@ model Log {
userId String?
browser String?
deviceId String?
- ip String?
- field String?
- oldValue String?
- newValue String?
+ ip String?
+ field String?
+ oldValue String?
+ newValue String?
timestamp DateTime @default(now())
-
User User? @relation(fields: [userId], references: [id], onDelete: Cascade)
+
@@map(name: "logs")
}
@@ -19,4 +19,5 @@ enum LOG_TYPE {
LOGIN
PROFILE_CHANGE
REGISTER
-}
\ No newline at end of file
+ ACCOUNT_DELETED
+}