Passed
Push — master ( 8c060d...7ff734 )
by Maxwell
01:56
created
files.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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='/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>
Please login to merge, or discard this patch.
adminpanel/ban.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn) == "admin") {
7 7
             $stmt = $conn->prepare("DELETE FROM users WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
adminpanel/deny.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn) == "admin") {
7 7
             $stmt = $conn->prepare("UPDATE files SET status = 'd' WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
adminpanel/index.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isAdmin($_SESSION['user'], $conn) == "admin") {
6 6
         echo "<h1>Welcome</h1>";
7 7
     } else {
8 8
         die("not a admin");
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
     $stmt = $conn->prepare("SELECT * FROM files WHERE status = 'n'");
34 34
     $stmt->execute();
35 35
     $result = $stmt->get_result();
36
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
37
-    while($row = $result->fetch_assoc()) {
36
+    if ($result->num_rows === 0) echo('There are no items waiting for approval.');
37
+    while ($row = $result->fetch_assoc()) {
38 38
         echo "" . $row['title'] . " by " . $row['author'] . " @ " . $row['date'] . " | <a href='approve.php?id=" . $row['id'] . "'>Approve</a> | <a href='deny.php?id=" . $row['id'] . "'>Deny</a><br>";
39 39
     }
40 40
 ?>
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
46 46
     $stmt->execute();
47 47
     $result = $stmt->get_result();
48
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
49
-    while($row = $result->fetch_assoc()) {
48
+    if ($result->num_rows === 0) echo('There are no items waiting for approval.');
49
+    while ($row = $result->fetch_assoc()) {
50 50
         echo "<a href='/index.php?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>";
51 51
     }
52 52
 ?>
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
     $stmt = $conn->prepare("SELECT * FROM files WHERE status = 'n'");
34 34
     $stmt->execute();
35 35
     $result = $stmt->get_result();
36
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
36
+    if($result->num_rows === 0) {
37
+        echo('There are no items waiting for approval.');
38
+    }
37 39
     while($row = $result->fetch_assoc()) {
38 40
         echo "" . $row['title'] . " by " . $row['author'] . " @ " . $row['date'] . " | <a href='approve.php?id=" . $row['id'] . "'>Approve</a> | <a href='deny.php?id=" . $row['id'] . "'>Deny</a><br>";
39 41
     }
@@ -45,7 +47,9 @@  discard block
 block discarded – undo
45 47
     $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
46 48
     $stmt->execute();
47 49
     $result = $stmt->get_result();
48
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
50
+    if($result->num_rows === 0) {
51
+        echo('There are no items waiting for approval.');
52
+    }
49 53
     while($row = $result->fetch_assoc()) {
50 54
         echo "<a href='/index.php?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>";
51 55
     }
Please login to merge, or discard this patch.
adminpanel/dependencies.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
     $stmt->bind_param("s", $user);
8 8
     $stmt->execute();
9 9
     $result = $stmt->get_result();
10
-    if($result->num_rows === 0) return "user doesn't exist";
11
-    while($row = $result->fetch_assoc()) {
12
-        if($row['rank'] == "Admin" || $row['rank'] == "Owner") {
10
+    if ($result->num_rows === 0) return "user doesn't exist";
11
+    while ($row = $result->fetch_assoc()) {
12
+        if ($row['rank'] == "Admin" || $row['rank'] == "Owner") {
13 13
             return "admin";
14 14
         } else {
15 15
             return "not admin";
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@
 block discarded – undo
7 7
     $stmt->bind_param("s", $user);
8 8
     $stmt->execute();
9 9
     $result = $stmt->get_result();
10
-    if($result->num_rows === 0) return "user doesn't exist";
10
+    if($result->num_rows === 0) {
11
+        return "user doesn't exist";
12
+    }
11 13
     while($row = $result->fetch_assoc()) {
12 14
         if($row['rank'] == "Admin" || $row['rank'] == "Owner") {
13 15
             return "admin";
Please login to merge, or discard this patch.
adminpanel/approve.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn) == "admin") {
7 7
             $stmt = $conn->prepare("UPDATE files SET status = 'y' WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
uploadchiptune.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
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__ . "/midis/";
18 18
                 $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
19 19
                 $uploadOk = 1;
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
                     echo 'file with the same name already exists<hr>';
24 24
                     $uploadOk = 0;
25 25
                 }
26
-                if($imageFileType != "xm" && $imageFileType != "mod" && $imageFileType != "s3m" && $imageFileType != "it") {
26
+                if ($imageFileType != "xm" && $imageFileType != "mod" && $imageFileType != "s3m" && $imageFileType != "it") {
27 27
                     echo 'unsupported file type. must be .xm, .mod, .s3m, or .it<hr>';
28 28
                     $uploadOk = 0;
29 29
                 }
Please login to merge, or discard this patch.
newreview.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
login.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
                 if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET["r_login"])) {
17 17
                     $error = "The page you tried to access requires you to be logged in.";
18 18
                 }
19
-                if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
20
-                    if(isset($_POST['remember'])) {
19
+                if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
20
+                    if (isset($_POST['remember'])) {
21 21
                         $rememberMe = true;
22 22
                     } else {
23 23
                         $rememberMe = false;
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
                     $stmt->bind_param("s", $_POST['username']);
27 27
                     $stmt->execute();
28 28
                     $result = $stmt->get_result();
29
-                    if(!mysqli_num_rows($result)){ { $error = "incorrect username or password"; goto skip; } }
29
+                    if (!mysqli_num_rows($result)) { { $error = "incorrect username or password"; goto skip; } }
30 30
                     
31 31
                     $row = $result->fetch_assoc();
32 32
                     $hash = $row['password'];
33 33
                     
34
-                    if(!password_verify($_POST['password'], $hash)) {
34
+                    if (!password_verify($_POST['password'], $hash)) {
35 35
                         $error = "incorrect username or password"; goto skip;
36 36
                     }
37 37
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                     if (isset($result['otpsecret'])) {
43 43
                         $otp = true;
44 44
                         if (isset($_POST['totp'])) {
45
-                            if ($_POST['totp'] === $result['otpbackupcode']) {goto skip2fa;}
45
+                            if ($_POST['totp'] === $result['otpbackupcode']) {goto skip2fa; }
46 46
                             require("vendor/autoload.php");
47 47
                             $totp = OTPHP\TOTP::create($result['otpsecret']);
48 48
                             if (!$totp->verify($_POST['totp'])) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                     }
57 57
                     skip2fa:
58 58
 
59
-                    if($rememberMe) {
59
+                    if ($rememberMe) {
60 60
                         session_write_close();
61 61
                         session_set_cookie_params("2678400");
62 62
                         ini_set('session.gc_maxlifetime', 2678400);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 } 
71 71
                 skip:
72 72
 
73
-                if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } 
73
+                if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } 
74 74
             ?>
75 75
             <form method="post">
76 76
                 <input required placeholder="Username" type="text" name="username"><br>
Please login to merge, or discard this patch.