diff --git a/svelte/src/admin_panel/IPBans.svelte b/svelte/src/admin_panel/IPBans.svelte index 721b89a..25c1b4b 100644 --- a/svelte/src/admin_panel/IPBans.svelte +++ b/svelte/src/admin_panel/IPBans.svelte @@ -172,8 +172,8 @@ onMount(get_bans); {formatDate(offence.ban_time, true, true, false)} {formatDate(offence.expire_time, true, true, false)} - {#if offence.file_public_id} - + {#if offence.file_link} + {offence.file_name} {/if} diff --git a/svelte/src/admin_panel/Router.svelte b/svelte/src/admin_panel/Router.svelte index 4177a54..c8d6f24 100644 --- a/svelte/src/admin_panel/Router.svelte +++ b/svelte/src/admin_panel/Router.svelte @@ -8,6 +8,7 @@ import UserManagement from "./UserManagement.svelte"; import EmailReporters from "./EmailReporters.svelte"; import MollieSettlements from "./MollieSettlements.svelte"; import PayPalTaxes from "./PayPalTaxes.svelte"; +import UserBans from "./UserBans.svelte"; let pages = [ { @@ -35,6 +36,11 @@ let pages = [ title: "IP Bans", icon: "remove_circle", component: IPBans, + }, { + path: "/admin/user_bans", + title: "User Bans", + icon: "person_remove", + component: UserBans, }, { path: "/admin/user_management", title: "User Management", diff --git a/svelte/src/admin_panel/UserBans.svelte b/svelte/src/admin_panel/UserBans.svelte new file mode 100644 index 0000000..d3fb359 --- /dev/null +++ b/svelte/src/admin_panel/UserBans.svelte @@ -0,0 +1,153 @@ + + + + +
+
+
+ Bans {rows.length} +
+
+ Offences {total_offences} +
+
+ +
+ + {#each rows as row (row.address)} + +
+
+ {row.username}
+ {row.user_id} +
+
+ Offences
+ {row.offences.length} +
+
+ Date
+ {formatDate(row.offences[0].ban_time, false, false, false)} +
+ +
+
+ + + + + + + + + {#each row.offences as offence (offence.ban_time)} + + + + + + + + {/each} +
ReasonReporterBan timeExpire timeFile
{offence.reason}{offence.reporter}{formatDate(offence.ban_time, true, true, false)}{formatDate(offence.expire_time, true, true, false)} + {#if offence.file_link} + + {offence.file_name} + + {/if} +
+
+
+ {/each} +
+ + diff --git a/svelte/src/home_page/AddressReputation.svelte b/svelte/src/home_page/AddressReputation.svelte index 1ede31a..3946c87 100644 --- a/svelte/src/home_page/AddressReputation.svelte +++ b/svelte/src/home_page/AddressReputation.svelte @@ -3,7 +3,7 @@ import { onMount } from "svelte"; import Expandable from "../util/Expandable.svelte"; import { formatDate } from "../util/Formatting.svelte"; -let result = false; +let result = null; let offences = 0 onMount(async () => { @@ -13,24 +13,71 @@ onMount(async () => { throw new Error(resp.text()); } result = await resp.json() - offences = result.offences.length } catch (err) { console.error(err); } }) -{#if result !== false && offences > 0} + +{#if result !== null && result.user_banned}
-
- {#if result.banned === true} +
+ Your account has been banned, click for details +
+

+ Your user account has been banned from uploading to + pixeldrain due to violation of the + content policy. Below is a list of + files originating from your account which have been blocked: +

+ +
+ + + + + + + + {#each result.user_offences as offence (offence.ban_time)} + + + + + + + {/each} +
FileReasonBan dateExpiry date
+ {#if offence.file_link} + + {offence.file_name} + + {/if} + {offence.reason}{formatDate(offence.ban_time, false, false, false)}{formatDate(offence.expire_time, false, false, false)}
+
+

+ If you would like to dispute your account you can mail me at + support@pixeldrain.com. Please do not mail unless you have a + good reason. If you do not provide a valid reason why the ban + should be reversed your e-mail will be ignored. And do not + forget to put your username ({window.user.username}) in the + e-mail. +

+ +
+{:else if result !== null && result.ip_offences.length > 0} +
+ +
+ {#if result.ip_banned} Your IP address has been banned, click for details {:else} Your IP address has received a copyright strike, click for details {/if}
- {#if result.banned === true} + {#if result.ip_banned}

Your IP address ({result.address}) has been banned from uploading to pixeldrain due to violation of the @@ -56,11 +103,11 @@ onMount(async () => { Ban date Expiry date - {#each result.offences as offence (offence.ban_time)} + {#each result.ip_offences as offence (offence.ban_time)} - {#if offence.file_public_id} - + {#if offence.file_link} + {offence.file_name} {/if} @@ -102,6 +149,8 @@ onMount(async () => {

{/if} + +