@@ -43,12 +43,12 @@ |
||
| 43 | 43 | <body> |
| 44 | 44 | <?php require(__DIR__ . "/important/header.php"); ?> |
| 45 | 45 | <div class="container"> |
| 46 | - <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>";}?> |
|
| 46 | + <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>"; }?> |
|
| 47 | 47 | To enable 2FA, scan the following QR code with your authenticator app:<br><br> |
| 48 | 48 | <img src="<?php echo $totp->getQrCodeUri( |
| 49 | 49 | 'https://api.qrserver.com/v1/create-qr-code/?data=[DATA]&size=300x300&ecc=M&qzone=1&format=png', |
| 50 | 50 | '[DATA]' |
| 51 | - );?>"><br><br> |
|
| 51 | + ); ?>"><br><br> |
|
| 52 | 52 | Or use the following string: <b><?php echo $secret; ?></b><br> |
| 53 | 53 | Then type the 6-digit code your app generates below and click 'Submit':<br><br> |
| 54 | 54 | <form method="post" enctype="multipart/form-data"> |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $target_dir = __DIR__ . "/musicfiles/"; |
| 18 | 18 | $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); |
| 19 | 19 | $uploadOk = 1; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | echo 'file with the same name already exists<hr>'; |
| 24 | 24 | $uploadOk = 0; |
| 25 | 25 | } |
| 26 | - if($imageFileType != "ogg" && $imageFileType != "mp3") { |
|
| 26 | + if ($imageFileType != "ogg" && $imageFileType != "mp3") { |
|
| 27 | 27 | echo 'unsupported file type. must be ogg or mp3<hr>'; |
| 28 | 28 | $uploadOk = 0; |
| 29 | 29 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $stmt = $conn->prepare("SELECT * FROM files WHERE id = 27"); |
| 20 | 20 | $stmt->execute(); |
| 21 | 21 | $result = $stmt->get_result(); |
| 22 | - while($row = $result->fetch_assoc()) { |
|
| 22 | + while ($row = $result->fetch_assoc()) { |
|
| 23 | 23 | echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 24 | <small> |
| 25 | 25 | <a href='view.php?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br> |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $stmt = $conn->prepare("SELECT * FROM files WHERE id = 1"); |
| 39 | 39 | $stmt->execute(); |
| 40 | 40 | $result = $stmt->get_result(); |
| 41 | - while($row = $result->fetch_assoc()) { |
|
| 41 | + while ($row = $result->fetch_assoc()) { |
|
| 42 | 42 | echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='pfp/" . getPFP($row['author'], $conn) . "'> |
| 43 | 43 | <small> |
| 44 | 44 | <a href='view.php?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br> |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $target_dir = __DIR__ . "/gamefiles/"; |
| 18 | 18 | $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); |
| 19 | 19 | $uploadOk = 1; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | echo 'file with the same name already exists<hr>'; |
| 24 | 24 | $uploadOk = 0; |
| 25 | 25 | } |
| 26 | - if($imageFileType != "swf") { |
|
| 26 | + if ($imageFileType != "swf") { |
|
| 27 | 27 | echo 'unsupported file type. must be swf<hr>'; |
| 28 | 28 | $uploadOk = 0; |
| 29 | 29 | } |
@@ -12,18 +12,18 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(isset($_GET['id'])) { |
|
| 15 | + if (isset($_GET['id'])) { |
|
| 16 | 16 | $stmt = $conn->prepare("SELECT * FROM files WHERE author = ? AND id = ?"); |
| 17 | 17 | $stmt->bind_param("si", $_SESSION['user'], $_GET['id']); |
| 18 | 18 | $stmt->execute(); |
| 19 | 19 | $result = $stmt->get_result(); |
| 20 | - if($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.'); |
|
| 20 | + if ($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.'); |
|
| 21 | 21 | } else { |
| 22 | 22 | header("Location: index.php"); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if(@$_POST['submit']) { |
|
| 26 | - if(isset($_SESSION['user'])) { |
|
| 25 | + if (@$_POST['submit']) { |
|
| 26 | + if (isset($_SESSION['user'])) { |
|
| 27 | 27 | $stmt = $conn->prepare("UPDATE files SET title = ?, extrainfo = ? WHERE id = ?"); |
| 28 | 28 | $stmt->bind_param("ssi", $title, $description, $_GET['id']); |
| 29 | 29 | $title = htmlspecialchars($_POST['title']); |
@@ -17,7 +17,9 @@ |
||
| 17 | 17 | $stmt->bind_param("si", $_SESSION['user'], $_GET['id']); |
| 18 | 18 | $stmt->execute(); |
| 19 | 19 | $result = $stmt->get_result(); |
| 20 | - if($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.'); |
|
| 20 | + if($result->num_rows === 0) { |
|
| 21 | + die('Item doesnt exist or item isnt made by you.'); |
|
| 22 | + } |
|
| 21 | 23 | } else { |
| 22 | 24 | header("Location: index.php"); |
| 23 | 25 | } |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $stmt = $conn->prepare("INSERT INTO files (type, title, extrainfo, author, filename) VALUES ('news', ?, ?, ?, '')"); |
| 18 | 18 | $stmt->bind_param("sss", $title, $description, $_SESSION['user']); |
| 19 | 19 | |
@@ -2,13 +2,13 @@ |
||
| 2 | 2 | require(__DIR__ . "/func/func.php"); |
| 3 | 3 | require(__DIR__ . "/func/conn.php"); |
| 4 | 4 | |
| 5 | -if(isset($_SESSION['user'])) { |
|
| 6 | - if(isset($_GET['id'])) { |
|
| 5 | +if (isset($_SESSION['user'])) { |
|
| 6 | + if (isset($_GET['id'])) { |
|
| 7 | 7 | $stmt = $conn->prepare("SELECT * FROM `groups` WHERE id = ?"); |
| 8 | 8 | $stmt->bind_param("i", $_GET['id']); |
| 9 | 9 | $stmt->execute(); |
| 10 | 10 | $result = $stmt->get_result(); |
| 11 | - if($result->num_rows === 0) { |
|
| 11 | + if ($result->num_rows === 0) { |
|
| 12 | 12 | die("Group doesn't exist"); |
| 13 | 13 | } |
| 14 | 14 | $stmt->close(); |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | <?php require(__DIR__ . "/important/header.php"); ?> |
| 22 | 22 | <div class="container"> |
| 23 | 23 | <h1>2-Factor Authentication</h1> |
| 24 | - 2FA status: <?php if ($otpstatus) {echo "enabled";} else {echo "disabled";}?><br> |
|
| 25 | - <?php if ($otpstatus) {echo "Backup code: " . $result->fetch_assoc()['otpbackupcode'];} ?><br><br> |
|
| 24 | + 2FA status: <?php if ($otpstatus) {echo "enabled"; } else {echo "disabled"; }?><br> |
|
| 25 | + <?php if ($otpstatus) {echo "Backup code: " . $result->fetch_assoc()['otpbackupcode']; } ?><br><br> |
|
| 26 | 26 | <button> |
| 27 | 27 | <?php if ($otpstatus) { ?> |
| 28 | 28 | <a href="/disable2fa">Disable 2FA</a> |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 16 | - if(isset($_SESSION['user'])) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | + if (isset($_SESSION['user'])) { |
|
| 17 | 17 | $target_dir = __DIR__ . "/videos/"; |
| 18 | 18 | $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); |
| 19 | 19 | $uploadOk = 1; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | echo 'file with the same name already exists<hr>'; |
| 24 | 24 | $uploadOk = 0; |
| 25 | 25 | } |
| 26 | - if($imageFileType != "mp4") { |
|
| 26 | + if ($imageFileType != "mp4") { |
|
| 27 | 27 | echo 'unsupported file type. must be swf<hr>'; |
| 28 | 28 | $uploadOk = 0; |
| 29 | 29 | } |