@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/../important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | 16 | $register = require(__DIR__ . "/../func/upload.php"); |
| 17 | 17 | $register("song", ["ogg", "mp3"], $conn); |
| 18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <body> |
| 13 | 13 | <?php require(__DIR__ . "/../important/header.php"); |
| 14 | 14 | |
| 15 | - if(@$_POST['submit']) { |
|
| 15 | + if (@$_POST['submit']) { |
|
| 16 | 16 | $register = require(__DIR__ . "/../func/upload.php"); |
| 17 | 17 | $register("image", ["gif", "png", "jpg", "jpeg"], $conn); |
| 18 | 18 | } |
@@ -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="/2fa/disable">Disable 2FA</a> |
@@ -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"> |
@@ -99,7 +99,9 @@ |
||
| 99 | 99 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 100 | 100 | $stmt->execute(); |
| 101 | 101 | $result = $stmt->get_result(); |
| 102 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 102 | + if($result->num_rows === 0) { |
|
| 103 | + echo('There are no users.'); |
|
| 104 | + } |
|
| 103 | 105 | while($row = $result->fetch_assoc()) { |
| 104 | 106 | $id = 1; |
| 105 | 107 | echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/dynamic/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>"; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <a href="/media">Featured</a><br> |
| 41 | 41 | <?php |
| 42 | - if(isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; } |
|
| 42 | + if (isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; } |
|
| 43 | 43 | ?> |
| 44 | 44 | </div> |
| 45 | 45 | <br> |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $stmt = $conn->prepare("SELECT * FROM files WHERE type='review' AND status='y' ORDER BY id DESC LIMIT 1"); |
| 50 | 50 | $stmt->execute(); |
| 51 | 51 | $result = $stmt->get_result(); |
| 52 | - while($row = $result->fetch_assoc()) { |
|
| 52 | + while ($row = $result->fetch_assoc()) { |
|
| 53 | 53 | echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 54 | 54 | <small> |
| 55 | 55 | <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br> |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $stmt = $conn->prepare("SELECT * FROM files WHERE type='news' AND status='y' ORDER BY id DESC LIMIT 1"); |
| 66 | 66 | $stmt->execute(); |
| 67 | 67 | $result = $stmt->get_result(); |
| 68 | - while($row = $result->fetch_assoc()) { |
|
| 68 | + while ($row = $result->fetch_assoc()) { |
|
| 69 | 69 | echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 70 | 70 | <small> |
| 71 | 71 | <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'>[" . $row['agerating'] . "] <i>" . $row['title'] . "</a></i></span><br> |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC"); |
| 82 | 82 | $stmt->execute(); |
| 83 | 83 | $result = $stmt->get_result(); |
| 84 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 85 | - while($row = $result->fetch_assoc()) { |
|
| 84 | + if ($result->num_rows === 0) echo('There are no users.'); |
|
| 85 | + while ($row = $result->fetch_assoc()) { |
|
| 86 | 86 | $id = 1; |
| 87 | 87 | echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/dynamic/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>"; |
| 88 | 88 | $id = $id + 1; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $stmt = $conn->prepare("SELECT * FROM files WHERE type='image' AND status='y' ORDER BY id DESC LIMIT 6"); |
| 100 | 100 | $stmt->execute(); |
| 101 | 101 | $result = $stmt->get_result(); |
| 102 | - while($row = $result->fetch_assoc()) { |
|
| 102 | + while ($row = $result->fetch_assoc()) { |
|
| 103 | 103 | echo "<div style='display: inline-block;' class='notegray'> |
| 104 | 104 | <a href='/view?id=" . $row['id'] . "'><img style='width: 7.5em;height: 7.5em;' src='/dynamic/image/" . $row['filename'] . "'> |
| 105 | 105 | <br><center><b>" . htmlspecialchars($row['title']) . "</b><br><span style='color: gray;'>By " . $row['author'] . "</span></center> |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | $stmt = $conn->prepare("SELECT * FROM `groups` ORDER BY id DESC"); |
| 19 | 19 | $stmt->execute(); |
| 20 | 20 | $result = $stmt->get_result(); |
| 21 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 22 | - while($row = $result->fetch_assoc()) { |
|
| 21 | + if ($result->num_rows === 0) echo('There are no users.'); |
|
| 22 | + while ($row = $result->fetch_assoc()) { |
|
| 23 | 23 | echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 24 | <small> |
| 25 | 25 | <a href='/view/group?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>" . $row['title'] . "</a></i></span><br> |
@@ -18,7 +18,9 @@ |
||
| 18 | 18 | $stmt = $conn->prepare("SELECT * FROM `groups` ORDER BY id DESC"); |
| 19 | 19 | $stmt->execute(); |
| 20 | 20 | $result = $stmt->get_result(); |
| 21 | - if($result->num_rows === 0) echo('There are no users.'); |
|
| 21 | + if($result->num_rows === 0) { |
|
| 22 | + echo('There are no users.'); |
|
| 23 | + } |
|
| 22 | 24 | while($row = $result->fetch_assoc()) { |
| 23 | 25 | echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 24 | 26 | <small> |
@@ -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 | $stmt = $conn->prepare("INSERT INTO files (type, title, extrainfo, author, filename) VALUES ('review', ?, ?, ?, '')"); |
| 18 | 18 | $stmt->bind_param("sss", $title, $description, $_SESSION['user']); |
| 19 | 19 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $stmt->execute(); |
| 35 | 35 | $result = $stmt->get_result(); |
| 36 | 36 | |
| 37 | - while($row = $result->fetch_assoc()) { |
|
| 37 | + while ($row = $result->fetch_assoc()) { |
|
| 38 | 38 | echo "<br><img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'> |
| 39 | 39 | <small> |
| 40 | 40 | <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | return function($type, $allowedFileTypes, $conn) { |
| 3 | - if(isset($_SESSION['user'])) { |
|
| 3 | + if (isset($_SESSION['user'])) { |
|
| 4 | 4 | $fileType = strtolower(pathinfo($_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION)); |
| 5 | 5 | $target_dir = __DIR__ . "/../dynamic/" . $type . "/"; |
| 6 | 6 | $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]) . "." . $fileType; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $movedFile = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - if(!in_array($fileType, $allowedFileTypes)) { |
|
| 18 | + if (!in_array($fileType, $allowedFileTypes)) { |
|
| 19 | 19 | echo 'unsupported file type. must be one of ' . join(", ", $allowedFileTypes) . '<hr>'; |
| 20 | 20 | $uploadOk = false; |
| 21 | 21 | } |
@@ -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='/dynamic/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='/dynamic/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> |