-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmoderated.php
87 lines (85 loc) · 4.06 KB
/
moderated.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
$mysqli = require_once __DIR__ . "/db.php";
session_start();
if (isset($_SESSION["user_id"])) {
$sql = "SELECT username FROM users WHERE id = {$_SESSION["user_id"]}";
$result = $mysqli->query($sql);
$user = $result->fetch_assoc();
}
require_once __DIR__ . "/api/internalFunctions.php";
if (!$user || !isUserModerated($_SESSION["user_id"])) {
header("Location: /");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<title>Matei's Homepage!</title>
<meta content="a cool website all about me, Matei!" property="og:title" />
<meta content="my website coded with HTML (html is awesome) and CSS (css is awesome) and with PHP (i love recursive acronyms). one secon gotta be SEO: Matei's Home Page Matei'sHomePage MateisHomePage" property="og:description" />
<meta content="https://mateishome.page" property="og:url" />
<meta content="https://mateishome.page/welcome.gif" property="og:image" />
<meta content="#24589E" data-react-helmet="true" name="theme-color" />
<?php include_once __DIR__ . "/applets/style.php";?></head>
<body>
<script>
if ( window !== window.parent )
{
window.location.replace("https://mateishome.page/dontputmeinaniframe!.html"); // The page is in an iframe
//window.location.replace("about:inducebrowsercrashforrealz"); // EVIL The page is in an iframe
}
</script>
<div class="page">
<?php
include_once __DIR__ . "/applets/navigation_bar.php"; // :3
?>
<br>
<div class="largeApplet">
<?php
$moderationInfo = json_decode(isUserModerated($_SESSION["user_id"]));
switch($moderationInfo->type) { // match block is php 8 only i swear im gonna crash out
case "1d": $banType = "Banned for 1 day"; break;
case "3d": $banType = "Banned for 3 days"; break;
case "7d": $banType = "Banned for 7 days"; break;
case "14d": $banType = "Banned for 14 days"; break;
case "30d": $banType = "Banned for 30 days"; break;
case "t": $banType = "Account terminated"; break;
case "ip": $banType = "IP Banned"; break;
default: $banType = "Unknown ban type";
}
?>
<h1><?php echo $banType; ?></h1>
<p class="smallMargins">You have been moderated by a MateisHomePage admin for the following reason:</p>
<?php echo $moderationInfo->reason; ?>
<?php if ($moderationInfo->moderatornote): ?>
<p class="smallMargins">The administrator who moderated you left this moderator note:</p>
<?php echo $moderationInfo->moderatornote; ?>
<?php elseif (!$moderationInfo->moderatornote): ?>
<p class="smallMargins">The administrator who moderated you did not leave a moderator note.</p>
<?php endif; ?>
<br>
<p>This moderation will expire on <strong><?php echo date("F j, Y, g:i a", strtotime($moderationInfo->expires)); ?></strong>. You will not be able to access any
MateisHomePage services until then while you are logged in.
<br>
If you believe that this decision was made in error, please contact <a href="mailto:[email protected]">[email protected]</a> via email.</p>
</div>
<br>
<button class="navigationButton" style="margin-bottom: 27.4px;"> <!-- for some reason <br> isnt working so margin-bottom woohooo!!!!! -->
<a href="/logout.php">Log out</a>
</button>
<?php if (!$_COOKIE['nomorejohn']): ?>
<div class="longApplet">
<div style="display: flex;">
<iframe src="https://john.citrons.xyz/embed?ref=mateishome.page" style="margin-left:auto;display:block;margin-right:auto;max-width:732px;width:100%;height:94px;border:none;" title="johnvertisement"></iframe>
<div>
<a href="nomorejohn.php">Click here</a> if you never want to see a johnvertisement again (for a decade or until you clear your cookies).</a>
</div>
</div>
</div>
<br>
<?php endif; ?>
</div>
</body>
</html>