Passed
Push — master ( 69d941...0f6eba )
by Maxwell
02:19
created
updateinfo.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@
 block discarded – undo
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']);
Please login to merge, or discard this patch.
newnews.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 ('news', ?, ?, ?, '')");
18 18
                 $stmt->bind_param("sss", $title, $description, $_SESSION['user']);
19 19
 
Please login to merge, or discard this patch.
joingroup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
newgroup.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("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 `groups` (title, description, author) VALUES (?, ?, ?)");
18 18
                 $stmt->bind_param("sss", $name, $text, $_SESSION['user']);
19 19
                 $text = htmlspecialchars($_POST['description']);
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 1 patch
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.
adminpanel/dependencies.php 1 patch
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.
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.