Completed
Pull Request — master (#71)
by Sam
11:59
created
views/steam/dashboard.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 								</div>
42 42
 							</div>
43 43
 						</li>
44
-			<?php }elseif ($row['type'] == 'waste') { ?>
44
+			<?php } elseif ($row['type'] == 'waste') { ?>
45 45
 						<li class="list-danger">
46 46
 							<i class=" fa fa-ellipsis-v"></i>
47 47
 							<div class="task-title">
Please login to merge, or discard this patch.
views/steam/life/dashboard.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,8 @@  discard block
 block discarded – undo
272 272
                                     </tbody>
273 273
                                 </table>
274 274
                                 <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>';
275
-                            } else echo $lang['noHouse'] ?>
275
+                            } else {
276
+                                echo $lang['noHouse'] ?>
276 277
                         </div>
277 278
                     </div>
278 279
                 <?php } if ($player->playerid == $_SESSION['playerid']) { ?>
@@ -281,6 +282,7 @@  discard block
 block discarded – undo
281 282
                         <?php
282 283
                             $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8";
283 284
                             }
285
+                            }
284 286
                             $result_of_query = $db_link->query($sql);
285 287
                             if ($result_of_query->num_rows > 0) {
286 288
                                 $veh = $result_of_query->fetch_object();
Please login to merge, or discard this patch.
views/steam/life/cars.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,13 +10,17 @@  discard block
 block discarded – undo
10 10
     $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%';";
11 11
     $result_of_query = $db_link->query($sql);
12 12
     $total_records = mysqli_num_rows($result_of_query);
13
-    if ($pageNum > $total_records) $pageNum = $total_records;
13
+    if ($pageNum > $total_records) {
14
+        $pageNum = $total_records;
15
+    }
14 16
     $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%'" . $max . " ;";
15 17
 } else {
16 18
     $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "';";
17 19
     $result_of_query = $db_link->query($sql);
18 20
     $total_records = mysqli_num_rows($result_of_query);
19
-    if ($pageNum > $total_records) $pageNum = $total_records;
21
+    if ($pageNum > $total_records) {
22
+        $pageNum = $total_records;
23
+    }
20 24
     $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' " . $max . " ;";
21 25
 }
22 26
 $result_of_query = $db_link->query($sql);
@@ -74,4 +78,6 @@  discard block
 block discarded – undo
74 78
     </table>
75 79
 </div>
76 80
 <?php
77
-} else echo errorMessage(3, $lang);
78 81
\ No newline at end of file
82
+} else {
83
+    echo errorMessage(3, $lang);
84
+}
Please login to merge, or discard this patch.
views/core/servers.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 								</div>
31 31
 							</div>
32 32
 						</li>
33
-					<?php }elseif ($row['type'] == 'waste') { ?>
33
+					<?php } elseif ($row['type'] == 'waste') { ?>
34 34
 						<li class="list-danger">
35 35
 							<i class=" fa fa-ellipsis-v"></i>
36 36
 							<div class="task-title">
Please login to merge, or discard this patch.
views/core/dashboard.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,10 @@
 block discarded – undo
5 5
         </h1>
6 6
     </div>
7 7
 </div>
8
-<?php if (isset($_SESSION['update'])) echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ')</div>'; ?>
8
+<?php if (isset($_SESSION['update'])) {
9
+    echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ')</div>';
10
+}
11
+?>
9 12
 
10 13
 <div class="row mt mb">
11 14
   <div class="col-md-12">
Please login to merge, or discard this patch.
views/core/settings.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,9 @@  discard block
 block discarded – undo
70 70
             <?php
71 71
             foreach ($settings['installedLanguage'] as $language) {
72 72
                 echo '<option value = "' . $language[1] . '" ';
73
-                if ($settings['language'] == $language[1]) echo 'selected';
73
+                if ($settings['language'] == $language[1]) {
74
+                    echo 'selected';
75
+                }
74 76
                 echo '> ' . $language[0] . '</option>';
75 77
             } ?>
76 78
         </select></div>
@@ -196,7 +198,9 @@  discard block
 block discarded – undo
196 198
     <span class='input-group-btn'><button style='margin-top: 21px;' class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div>
197 199
 
198 200
     <?php
199
-    if (!isset($pluginSettings)) echo '<h3>' . $lang['plugin'] . ' ' . $lang['settings'] . '</h3>';
201
+    if (!isset($pluginSettings)) {
202
+        echo '<h3>' . $lang['plugin'] . ' ' . $lang['settings'] . '</h3>';
203
+    }
200 204
     foreach ($settings['plugins'] as &$plugin) {
201 205
         if (file_exists("plugins/" . $plugin . "/settings.php")) {
202 206
             include("plugins/" . $plugin . "/settings.php");
Please login to merge, or discard this patch.
views/core/2factor.php 1 patch
Braces   +28 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@  discard block
 block discarded – undo
32 32
     setcookie('token', '', time() - 3600, '/');
33 33
     message($lang['2factorDeviceRevoke']);
34 34
 } elseif (isset($_GET['revokeToken']) && $_SESSION['2factor'] == 2) {
35
-    if (isset($_COOKIE['token'])) unset($_COOKIE['token']);
35
+    if (isset($_COOKIE['token'])) {
36
+        unset($_COOKIE['token']);
37
+    }
36 38
     $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
37 39
     $db_connection->query($sql);
38 40
     message($lang['2factorTokenRevoke']);
@@ -42,8 +44,10 @@  discard block
 block discarded – undo
42 44
     $db_connection->query($sql);
43 45
     $_SESSION['2factor'] = 2;
44 46
     message($lang['2factor1']);
45
-    } else message($lang['2factor2']);
46
-} ?>
47
+    } else {
48
+        message($lang['2factor2']);
49
+    }
50
+    } ?>
47 51
 <div class="row">
48 52
     <div class="col-lg-8">
49 53
         <h1 class="page-header">
@@ -53,7 +57,9 @@  discard block
 block discarded – undo
53 57
 </div>
54 58
 <?php
55 59
 if ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 5 || $_SESSION['2factor'] == 3) {
56
-    if ($_SESSION['2factor'] == 3) message($lang['2factorError2']);
60
+    if ($_SESSION['2factor'] == 3) {
61
+        message($lang['2factorError2']);
62
+    }
57 63
     echo '<form method="post" action="' . $currentPage . '" class="form-inline">
58 64
   <label for="code">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
59 65
   <button type="submit" class="btn btn-default">Verify</button></form>';
@@ -61,12 +67,21 @@  discard block
 block discarded – undo
61 67
     echo $lang['2factor1'] . '<br><br><a href="?backup" class="btn btn-default">';
62 68
     $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
63 69
     $twoFactor = $db_connection->query($sql)->fetch_object();
64
-    if (isset($twoFactor->backup)) echo $lang['new'] . ' ' . $lang['2factor3']; else echo $lang['2factor3'];
70
+    if (isset($twoFactor->backup)) {
71
+        echo $lang['new'] . ' ' . $lang['2factor3'];
72
+    } else {
73
+        echo $lang['2factor3'];
74
+    }
65 75
     echo '</a>';
66 76
     echo '<a href="?revoke" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factor4'] . '</a>';
67
-    if (isset($twoFactor->token)) echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorTokenRevoke'] . '</a>';
68
-    if (isset($_COOKIE['token'])) echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorRevokeRememberDevice'];
69
-    else echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">' . $lang['2factorRememberDevice'];
77
+    if (isset($twoFactor->token)) {
78
+        echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorTokenRevoke'] . '</a>';
79
+    }
80
+    if (isset($_COOKIE['token'])) {
81
+        echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorRevokeRememberDevice'];
82
+    } else {
83
+        echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">' . $lang['2factorRememberDevice'];
84
+    }
70 85
     echo '</a>';
71 86
 
72 87
 } elseif ($_SESSION['2factor'] == 0 || $_SESSION['2factor'] == 5) {
@@ -76,8 +91,11 @@  discard block
 block discarded – undo
76 91
         echo "<i class='fa fa-info-circle'></i> " . $lang['2factorForce'] . "</div></div>";
77 92
     }
78 93
     $secret = $gauth->createSecret();
79
-    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
80
-    else $name = 'CyberWorks';
94
+    if (isset($settings['communityName'])) {
95
+        $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
96
+    } else {
97
+        $name = 'CyberWorks';
98
+    }
81 99
     echo '<div class="col-md-6">' . $lang['2factorSetup1'] . '<br>' . $lang['2factorSetup2'] . ' <b>' . $secret . '</b><br><form method="post" action="2factor" class="form-inline">
82 100
   <label for="testCode">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input style="margin-left: 5px;" class="form-control" id="testCode" type="text" name="testCode"></div>
83 101
   <input type="hidden" id="secret" name="secret" value="'.$secret . '"><button type="submit" class="btn btn-default">Verify</button>
Please login to merge, or discard this patch.
views/core/newUser.php 1 patch
Braces   +14 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,10 @@  discard block
 block discarded – undo
22 22
                 <p><?php echo $lang['username'] ?>:</p>
23 23
                 <input id="user_name" type="text" class="form-control"
24 24
                        placeholder="<?php echo $lang['username'] ?>" autofocus
25
-                       name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required>
25
+                       name="user_name" <?php if (isset($_POST['user_name'])) {
26
+    echo 'value="' . $_POST['user_name'] . '"';
27
+}
28
+?> required>
26 29
             </div>
27 30
             <div class="form-group">
28 31
                 <p><?php echo $lang['player'] . " " . $lang['id'] ?>:</p>
@@ -32,7 +35,10 @@  discard block
 block discarded – undo
32 35
             <div class="form-group">
33 36
                 <p><?php echo $lang['emailAdd'] ?>:</p>
34 37
                 <input id="user_email" placeholder="<?php echo $lang['emailAdd'] ?>" class=" form-control" type="email"
35
-                       name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required/>
38
+                       name="user_email" <?php if (isset($_POST['user_name'])) {
39
+    echo 'value="' . $_POST['user_name'] . '"';
40
+}
41
+?> required/>
36 42
             </div>
37 43
             <div class="form-group">
38 44
                 <p><?php echo $lang['password'] ?>:</p>
@@ -52,7 +58,9 @@  discard block
 block discarded – undo
52 58
                 <select class="form-control" name="user_lvl">
53 59
                     <?php for ($rank = 1; $rank <= $settings['staffRanks']; $rank++) {
54 60
                         echo '<option value="' . $rank . '"';
55
-                        if (isset($_POST['user_lvl'])) if ($rank == $_POST['user_lvl']) echo 'selected';
61
+                        if (isset($_POST['user_lvl'])) {
62
+                            if ($rank == $_POST['user_lvl']) echo 'selected';
63
+                        }
56 64
                         echo '>' . $settings['ranks'][$rank] . '</option>';
57 65
                     } ?>
58 66
                 </select>
@@ -63,7 +71,9 @@  discard block
 block discarded – undo
63 71
                 <select class=" form-control" name="profile_pic">
64 72
                     <?php for ($icon = 1; $icon <= 6; $icon++) {
65 73
                         echo '<option value="' . $icon . '" ';
66
-                        if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected';
74
+                        if (isset($_POST['user_name'])) {
75
+                            if ($icon == $_POST['user_name']) echo 'selected';
76
+                        }
67 77
                         echo '>' . $settings['names'][$icon] . '</option>';
68 78
                     } ?>
69 79
                 </select>
Please login to merge, or discard this patch.
views/core/editServer.php 1 patch
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
     $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';";
7 7
     $result_of_query = $db_connection->query($sql);
8 8
 
9
-}
10
-elseif (isset($_POST['edit'])) {
9
+} elseif (isset($_POST['edit'])) {
11 10
     if (isset($_POST['sql_host'])) {
12 11
         if ($_SESSION['permissions']['super_admin']) {
13 12
             if (formtoken::validateToken($_POST)) {
@@ -32,8 +31,12 @@  discard block
 block discarded – undo
32 31
                     $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';";
33 32
                 }
34 33
                 $result_of_query = $db_connection->query($sql);
35
-            } else message($lang['expired']);
36
-        } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
34
+            } else {
35
+                message($lang['expired']);
36
+            }
37
+        } else {
38
+            logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
39
+        }
37 40
     }
38 41
 }
39 42
     $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';";
@@ -116,7 +119,12 @@  discard block
 block discarded – undo
116 119
 
117 120
 <script>
118 121
 $(document).ready(function() {
119
-if (<?php if ($server->usegsq == 1) echo 'false'; else echo 'true'; ?>) {
122
+if (<?php if ($server->usegsq == 1) {
123
+    echo 'false';
124
+} else {
125
+    echo 'true';
126
+}
127
+?>) {
120 128
     $("#sq_details").hide();
121 129
 };
122 130
 $("#usegsq").change(function () {
Please login to merge, or discard this patch.