Completed
Push — master ( 9e5156...0ef7aa )
by Sam
12s
created
views/core/settings.php 2 patches
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.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
             $settings['allowLang'] = filter_var($_POST['allowLang'], FILTER_VALIDATE_BOOLEAN);
16 16
             $settings['wanted'] = filter_var($_POST['wanted'], FILTER_VALIDATE_BOOLEAN);
17 17
             $settings['news'] = filter_var($_POST['news'], FILTER_VALIDATE_BOOLEAN);
18
-            $settings['register'] =  filter_var($_POST['register'], FILTER_VALIDATE_BOOLEAN);
19
-            $settings['steamlogin'] =  filter_var($_POST['steamlogin'], FILTER_VALIDATE_BOOLEAN);
18
+            $settings['register'] = filter_var($_POST['register'], FILTER_VALIDATE_BOOLEAN);
19
+            $settings['steamlogin'] = filter_var($_POST['steamlogin'], FILTER_VALIDATE_BOOLEAN);
20 20
             $settings['vacTest'] = filter_var($_POST['vacTest'], FILTER_VALIDATE_BOOLEAN);
21
-            $settings['performance'] =  filter_var($_POST['performance'], FILTER_VALIDATE_BOOLEAN);
22
-            $settings['notifications'] =  filter_var($_POST['notifications'], FILTER_VALIDATE_BOOLEAN);
21
+            $settings['performance'] = filter_var($_POST['performance'], FILTER_VALIDATE_BOOLEAN);
22
+            $settings['notifications'] = filter_var($_POST['notifications'], FILTER_VALIDATE_BOOLEAN);
23 23
             
24 24
             $settings['2factor'] = false;
25 25
             $settings['gravatar'] = false;
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
             $settings['maxLevels']['donator'] = $_POST['max_donator'];
32 32
 
33 33
             
34
-            file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
34
+            file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
35 35
         } else {
36
-            logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['server'] . ' ' . $lang['settings'], 3);
36
+            logAction($_SESSION['user_name'], $lang['failedUpdate'].' '.$lang['server'].' '.$lang['settings'], 3);
37 37
         }
38 38
     } else {
39 39
         message($lang['expired']);
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
     <form method='post' action='settings' id='settings' name='settingsEdit'>
54 54
         <?php
55 55
         echo formtoken::getField();
56
-        echo "<h3>" . $lang['database'] . "</h3>";
57
-        echo "<div class='form-group'><label for='db_host'>" . $lang['database'] . " " . $lang['host'] . ": </label><input class='form-control' id='db_host' type='text' name='db_host' value='" . decrypt($settings['db']['host']) . "' readonly></div>";
58
-        echo "<div class='form-group'><label for='db_user'>" . $lang['database'] . " " . $lang['user'] . ": </label><input class='form-control' id='db_user' type='text' name='db_user' value='" . decrypt($settings['db']['user']) . "' readonly></div>";
59
-        echo "<div class='form-group'><div class='input-group'><label for='db_pass'>" . $lang['database'] . " " . $lang['password'] . ": </label><input class='form-control pwd' id='db_pass' type='password' name='db_pass' value='" . decrypt($settings['db']['pass']) . "' readonly>";
56
+        echo "<h3>".$lang['database']."</h3>";
57
+        echo "<div class='form-group'><label for='db_host'>".$lang['database']." ".$lang['host'].": </label><input class='form-control' id='db_host' type='text' name='db_host' value='".decrypt($settings['db']['host'])."' readonly></div>";
58
+        echo "<div class='form-group'><label for='db_user'>".$lang['database']." ".$lang['user'].": </label><input class='form-control' id='db_user' type='text' name='db_user' value='".decrypt($settings['db']['user'])."' readonly></div>";
59
+        echo "<div class='form-group'><div class='input-group'><label for='db_pass'>".$lang['database']." ".$lang['password'].": </label><input class='form-control pwd' id='db_pass' type='password' name='db_pass' value='".decrypt($settings['db']['pass'])."' readonly>";
60 60
         echo "<span class='input-group-btn'><button style='margin-top: 21px; background-color: #eee;' ";
61 61
         echo "class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div></div>";
62
-        echo "<div class='form-group'><label for='db_name'>" . $lang['database'] . " " . $lang['name'] . ": </label><input class='form-control' id='db_name' type='text' name='db_name' value='" . decrypt($settings['db']['name']) . "' readonly></div>";
62
+        echo "<div class='form-group'><label for='db_name'>".$lang['database']." ".$lang['name'].": </label><input class='form-control' id='db_name' type='text' name='db_name' value='".decrypt($settings['db']['name'])."' readonly></div>";
63 63
         ?>
64 64
 
65 65
     <h3><?php echo $lang['panel']?></h3>
@@ -71,16 +71,16 @@  discard block
 block discarded – undo
71 71
         <select name="language" id="language" class="form-control">
72 72
             <?php
73 73
             foreach ($settings['installedLanguage'] as $language) {
74
-                echo '<option value = "' . $language[1] . '" ';
74
+                echo '<option value = "'.$language[1].'" ';
75 75
                 if ($settings['language'] == $language[1]) echo 'selected';
76
-                echo '> ' . $language[0] . '</option>';
76
+                echo '> '.$language[0].'</option>';
77 77
             } ?>
78 78
         </select></div>
79 79
 
80 80
     <div class='form-group'><label for="allowLang"><?php echo $lang['allowLang'] ?>: </label>
81 81
         <select name="allowLang" id="allowLang" class="form-control">
82
-            <option value="true"<?php echo select(true, $settings['allowLang']) . '>' . $lang['yes'] ?></option>
83
-            <option value="false"<?php echo select(false, $settings['allowLang']) . '>' . $lang['no'] ?></option>
82
+            <option value="true"<?php echo select(true, $settings['allowLang']).'>'.$lang['yes'] ?></option>
83
+            <option value="false"<?php echo select(false, $settings['allowLang']).'>'.$lang['no'] ?></option>
84 84
         </select></div>
85 85
         
86 86
     <?php } ?>
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
     <div class='form-group'><label for="performance"><?php echo $lang['performance'] ?>: </label>
89 89
         <select name="performance" id="performance" class="form-control">
90 90
             <option value="true"
91
-            <?php echo select(true, $settings['performance']) . '>' . $lang['yes'] ?></option>
91
+            <?php echo select(true, $settings['performance']).'>'.$lang['yes'] ?></option>
92 92
             <option value="false"
93
-            <?php echo select(false, $settings['performance']) . '>' . $lang['no'] ?></option>
93
+            <?php echo select(false, $settings['performance']).'>'.$lang['no'] ?></option>
94 94
         </select></div>
95 95
 
96 96
     <div class='form-group'><label for="items"><?php echo $lang['itemsPP'] ?></label>
@@ -104,38 +104,38 @@  discard block
 block discarded – undo
104 104
 
105 105
     <div class='form-group'><label for="register"><?php echo $lang['registration'] ?>: </label>
106 106
         <select name="register" id="register" class="form-control">
107
-        <option value="true"<?php echo select(true, $settings['register']) . '>' . $lang['yes'] ?></option>
108
-        <option value="false"<?php echo select(false, $settings['register']) . '>' . $lang['no'] ?></option>
107
+        <option value="true"<?php echo select(true, $settings['register']).'>'.$lang['yes'] ?></option>
108
+        <option value="false"<?php echo select(false, $settings['register']).'>'.$lang['no'] ?></option>
109 109
     </select>
110 110
     </div>
111 111
 
112 112
     <div class='form-group'><label for="news"><?php echo $lang['useNews'] ?>: </label>
113 113
         <select name="news" id="news" class="form-control">
114
-        <option value="true"<?php echo select(true, $settings['news']) . '>' . $lang['yes'] ?></option>
115
-        <option value="false"<?php echo select(false, $settings['news']) . '>' . $lang['no'] ?></option>
114
+        <option value="true"<?php echo select(true, $settings['news']).'>'.$lang['yes'] ?></option>
115
+        <option value="false"<?php echo select(false, $settings['news']).'>'.$lang['no'] ?></option>
116 116
     </select></div>
117 117
 
118 118
     <div class='form-group'><label for="notifications">Notifications: </label>
119 119
         <select name="notifications" id="notifications" class="form-control">
120
-        <option value="true"<?php echo select(true, $settings['notifications']) . '>' . $lang['yes'] ?></option>
121
-        <option value="false"<?php echo select(false, $settings['notifications']) . '>' . $lang['no'] ?></option>
120
+        <option value="true"<?php echo select(true, $settings['notifications']).'>'.$lang['yes'] ?></option>
121
+        <option value="false"<?php echo select(false, $settings['notifications']).'>'.$lang['no'] ?></option>
122 122
     </select></div>
123
-    <?php echo "<div class='form-group'><label for='refresh'>" . $lang['refresh'] . ": </label><input class='form-control' id='refresh' type='number' name='refresh' value='" . $settings['refresh'] . "'></div>"; ?>
123
+    <?php echo "<div class='form-group'><label for='refresh'>".$lang['refresh'].": </label><input class='form-control' id='refresh' type='number' name='refresh' value='".$settings['refresh']."'></div>"; ?>
124 124
 </div>
125 125
 <div class="col-md-6">
126 126
     <h3>Altis Life</h3>
127 127
     <?php
128
-    echo "<div class='form-group'><label for='max_cop'>" . $lang['max'] . " " . $lang['cop'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_cop' type='number' name='max_cop' value='" . $settings['maxLevels']['cop'] . "'></div>";
129
-    echo "<div class='form-group'><label for='max_medic'>" . $lang['max'] . " " . $lang['medic'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_medic' type='number' name='max_medic' value='" . $settings['maxLevels']['medic'] . "'></div>";
130
-    echo "<div class='form-group'><label for='max_admin'>" . $lang['max'] . " " . $lang['admin'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_admin' type='number' name='max_admin' value='" . $settings['maxLevels']['admin'] . "'></div>";
131
-    echo "<div class='form-group'><label for='max_donator'>" . $lang['max'] . " " . $lang['donator'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_donator' type='number' name='max_donator' value='" . $settings['maxLevels']['donator'] . "'></div>";
128
+    echo "<div class='form-group'><label for='max_cop'>".$lang['max']." ".$lang['cop']." ".$lang['level'].": </label><input class='form-control' id='max_cop' type='number' name='max_cop' value='".$settings['maxLevels']['cop']."'></div>";
129
+    echo "<div class='form-group'><label for='max_medic'>".$lang['max']." ".$lang['medic']." ".$lang['level'].": </label><input class='form-control' id='max_medic' type='number' name='max_medic' value='".$settings['maxLevels']['medic']."'></div>";
130
+    echo "<div class='form-group'><label for='max_admin'>".$lang['max']." ".$lang['admin']." ".$lang['level'].": </label><input class='form-control' id='max_admin' type='number' name='max_admin' value='".$settings['maxLevels']['admin']."'></div>";
131
+    echo "<div class='form-group'><label for='max_donator'>".$lang['max']." ".$lang['donator']." ".$lang['level'].": </label><input class='form-control' id='max_donator' type='number' name='max_donator' value='".$settings['maxLevels']['donator']."'></div>";
132 132
     ?>
133 133
     <div class='form-group'><label for="wanted"><?php echo $lang['wanted'] ?>: </label>
134 134
         <select name="wanted" id="wanted" class="form-control">
135 135
             <option value="true"
136
-            <?php echo select(true, $settings['wanted']) . '>' . $lang['yes'] ?></option>
136
+            <?php echo select(true, $settings['wanted']).'>'.$lang['yes'] ?></option>
137 137
             <option value="false"
138
-            <?php echo select(false, $settings['wanted']) . '>' . $lang['no'] ?></option>
138
+            <?php echo select(false, $settings['wanted']).'>'.$lang['no'] ?></option>
139 139
         </select></div>
140 140
 
141 141
     <div class='form-group'>
@@ -163,35 +163,35 @@  discard block
 block discarded – undo
163 163
     <div class='form-group'><label for="steamlogin"><?php echo $lang['steamlogin'] ?>: </label>
164 164
         <select name="steamlogin" id="steamlogin" class="form-control">
165 165
         <option value="true"
166
-        <?php echo select(true, $settings['steamlogin']) . '>' . $lang['yes'] ?></option>
166
+        <?php echo select(true, $settings['steamlogin']).'>'.$lang['yes'] ?></option>
167 167
         <option value="false"
168
-        <?php echo select(false, $settings['steamlogin']) . '>' . $lang['no'] ?></option>
168
+        <?php echo select(false, $settings['steamlogin']).'>'.$lang['no'] ?></option>
169 169
     </select></div>
170 170
 
171 171
     <div class='form-group'><label for="vacTest"><?php echo $lang['useVAC'] ?>: </label>
172 172
         <select name="vacTest" id="vacTest" class="form-control">
173 173
         <option value="true"
174
-        <?php echo select(true, $settings['vacTest']) . '>' . $lang['yes'] ?></option>
174
+        <?php echo select(true, $settings['vacTest']).'>'.$lang['yes'] ?></option>
175 175
         <option value="false"
176
-        <?php echo select(false, $settings['vacTest']) . '>' . $lang['no'] ?></option>
176
+        <?php echo select(false, $settings['vacTest']).'>'.$lang['no'] ?></option>
177 177
     </select></div>
178 178
 
179 179
     <div class='form-group'><label for="communityBansTest"><?php echo $lang['useCommunityBans'] ?>: </label>
180 180
         <select name="communityBansTest" id="communityBansTest" class="form-control">
181 181
         <option value="true"
182
-        <?php echo select(true, $settings['communityBansTest']) . '>' . $lang['yes'] ?></option>
182
+        <?php echo select(true, $settings['communityBansTest']).'>'.$lang['yes'] ?></option>
183 183
         <option value="false"
184
-        <?php echo select(false, $settings['communityBansTest']) . '>' . $lang['no'] ?></option>
184
+        <?php echo select(false, $settings['communityBansTest']).'>'.$lang['no'] ?></option>
185 185
     </select></div>
186 186
 
187 187
     <div class='form-group'><div class='input-group'><label for='communityBansAPI'>Community Bans API <?php echo $lang['key'] ?>: </label><input class='form-control pwd' id='communityBansAPI' type='password' name='communityBansAPI' value='<?php echo $settings['communityBansAPI']?>'>
188 188
     <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>
189 189
 
190 190
     <?php
191
-    if (!isset($pluginSettings)) echo '<h3>' . $lang['plugin'] . ' ' . $lang['settings'] . '</h3>';
191
+    if (!isset($pluginSettings)) echo '<h3>'.$lang['plugin'].' '.$lang['settings'].'</h3>';
192 192
     foreach ($settings['plugins'] as &$plugin) {
193
-        if (file_exists("plugins/" . $plugin . "/settings.php")) {
194
-            include("plugins/" . $plugin . "/settings.php");
193
+        if (file_exists("plugins/".$plugin."/settings.php")) {
194
+            include("plugins/".$plugin."/settings.php");
195 195
         }
196 196
     }
197 197
     ?>
Please login to merge, or discard this patch.
views/core/2factor.php 2 patches
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.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (isset($_GET['backup']) && $_SESSION['2factor'] == 2) {
3 3
     $backup = $gauth->createSecret(8);
4
-    $sql = "UPDATE `users` SET `backup`='" . $backup . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
4
+    $sql = "UPDATE `users` SET `backup`='".$backup."' WHERE `user_id` = '".$_SESSION['user_id']."';";
5 5
     $db_connection->query($sql);
6
-    message($lang['2factorBackup1'] . ' <b>' . $backup . '</b> ' . $lang['2factorBackup2']);
6
+    message($lang['2factorBackup1'].' <b>'.$backup.'</b> '.$lang['2factorBackup2']);
7 7
 } elseif (isset($_GET['revokeBackup']) && $_SESSION['2factor'] == 2) {
8
-    $sql = "UPDATE `users` SET `backup`=NULL WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
8
+    $sql = "UPDATE `users` SET `backup`=NULL WHERE `user_id` = '".$_SESSION['user_id']."';";
9 9
     $db_connection->query($sql);
10 10
     message($lang['2factorBackupRevoke']);
11 11
 } elseif (isset($_GET['revoke']) && $_SESSION['2factor'] == 2) {
12
-    $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL,`token`=NULL WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
12
+    $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL,`token`=NULL WHERE `user_id` = '".$_SESSION['user_id']."';";
13 13
     $db_connection->query($sql);
14 14
     unset($_COOKIE['token']);
15 15
     setcookie('token', '', time() - 3600, '/');
16 16
     $_SESSION['2factor'] = 0;
17 17
     message($lang['2factorRevoke']);
18 18
 } elseif (isset($_GET['remember']) && $_SESSION['2factor'] == 2 && !isset($_COOKIE['token'])) {
19
-    $sql = "SELECT `token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
19
+    $sql = "SELECT `token` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';";
20 20
     $token = $db_connection->query($sql)->fetch_object()->token;
21 21
     if (empty($token)) {
22 22
         $key = $gauth->createSecret(32);
23
-        $sql = "UPDATE `users` SET `token`='" . encrypt($key) . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
23
+        $sql = "UPDATE `users` SET `token`='".encrypt($key)."' WHERE `user_id` = '".$_SESSION['user_id']."';";
24 24
         $db_connection->query($sql);
25 25
         setcookie('token', $key, time() + 5184000, "/");
26 26
     } else {
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
     message($lang['2factorDeviceRevoke']);
34 34
 } elseif (isset($_GET['revokeToken']) && $_SESSION['2factor'] == 2) {
35 35
     if (isset($_COOKIE['token'])) unset($_COOKIE['token']);
36
-    $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
36
+    $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '".$_SESSION['user_id']."';";
37 37
     $db_connection->query($sql);
38 38
     message($lang['2factorTokenRevoke']);
39 39
 } elseif (isset($_POST['testCode']) && isset($_POST['secret']) && $_SESSION['2factor'] == 0) {
40 40
     if ($gauth->verifyCode($_POST['secret'], $_POST['testCode'])) {
41
-    $sql = "UPDATE `users` SET `twoFactor`='" . $_POST['secret'] . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
41
+    $sql = "UPDATE `users` SET `twoFactor`='".$_POST['secret']."' WHERE `user_id` = '".$_SESSION['user_id']."';";
42 42
     $db_connection->query($sql);
43 43
     $_SESSION['2factor'] = 2;
44 44
     message($lang['2factor1']);
@@ -54,32 +54,32 @@  discard block
 block discarded – undo
54 54
 <?php
55 55
 if ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 5 || $_SESSION['2factor'] == 3) {
56 56
     if ($_SESSION['2factor'] == 3) message($lang['2factorError2']);
57
-    echo '<form method="post" action="' . $currentPage . '" class="form-inline">
58
-  <label for="code">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
57
+    echo '<form method="post" action="'.$currentPage.'" class="form-inline">
58
+  <label for="code">'.$lang['2factorSetup3'].'<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
59 59
   <button type="submit" class="btn btn-default">Verify</button></form>';
60 60
 } elseif ($_SESSION['2factor'] == 2) {
61
-    echo $lang['2factor1'] . '<br><br><a href="?backup" class="btn btn-default">';
62
-    $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
61
+    echo $lang['2factor1'].'<br><br><a href="?backup" class="btn btn-default">';
62
+    $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';";
63 63
     $twoFactor = $db_connection->query($sql)->fetch_object();
64
-    if (isset($twoFactor->backup)) echo $lang['new'] . ' ' . $lang['2factor3']; else echo $lang['2factor3'];
64
+    if (isset($twoFactor->backup)) echo $lang['new'].' '.$lang['2factor3']; else echo $lang['2factor3'];
65 65
     echo '</a>';
66
-    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'];
66
+    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'];
70 70
     echo '</a>';
71 71
 
72 72
 } elseif ($_SESSION['2factor'] == 0 || $_SESSION['2factor'] == 5) {
73 73
     if ($_SESSION['2factor'] == 5) {
74 74
         echo "<div class='alert alert-danger alert-dismissable'>";
75 75
         echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>";
76
-        echo "<i class='fa fa-info-circle'></i> " . $lang['2factorForce'] . "</div></div>";
76
+        echo "<i class='fa fa-info-circle'></i> ".$lang['2factorForce']."</div></div>";
77 77
     }
78 78
     $secret = $gauth->createSecret();
79
-    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
79
+    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName'])."CyberWorks");
80 80
     else $name = 'CyberWorks';
81
-    echo '<div class="col-md-6">' . $lang['2factorSetup1'] . '<br>' . $lang['2factorSetup2'] . ' <b>' . $secret . '</b><br><form method="post" action="2factor" class="form-inline">
82
-  <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
-  <input type="hidden" id="secret" name="secret" value="'.$secret . '"><button type="submit" class="btn btn-default">Verify</button>
84
-  </form></div><div class="col-md-6"><img src="'.$gauth->getQRCodeGoogleUrl($name, $secret) . '"></div>';
81
+    echo '<div class="col-md-6">'.$lang['2factorSetup1'].'<br>'.$lang['2factorSetup2'].' <b>'.$secret.'</b><br><form method="post" action="2factor" class="form-inline">
82
+  <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
+  <input type="hidden" id="secret" name="secret" value="'.$secret.'"><button type="submit" class="btn btn-default">Verify</button>
84
+  </form></div><div class="col-md-6"><img src="'.$gauth->getQRCodeGoogleUrl($name, $secret).'"></div>';
85 85
 }
86 86
\ No newline at end of file
Please login to merge, or discard this patch.
views/core/newUser.php 2 patches
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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  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'])) echo 'value="'.$_POST['user_name'].'"'; ?> required>
26 26
             </div>
27 27
             <div class="form-group">
28
-                <p><?php echo $lang['player'] . " " . $lang['id'] ?>:</p>
28
+                <p><?php echo $lang['player']." ".$lang['id'] ?>:</p>
29 29
                 <input id="player_id" class="form-control" placeholder="<?php echo $lang['playerID'] ?>" type="number" name="player_id">
30 30
                 <p id='steam'></p>
31 31
             </div>
32 32
             <div class="form-group">
33 33
                 <p><?php echo $lang['emailAdd'] ?>:</p>
34 34
                 <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/>
35
+                       name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="'.$_POST['user_name'].'"'; ?> required/>
36 36
             </div>
37 37
             <div class="form-group">
38 38
                 <p><?php echo $lang['password'] ?>:</p>
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
                        name="user_password_new" required autocorrect="off" autocapitalize="off" autocomplete="off">
42 42
             </div>
43 43
             <div class="form-group">
44
-                <p><?php echo $lang['repeat'] . ' ' . $lang['password']?>:</p>
45
-                <input id="user_password_repeat" placeholder="<?php echo $lang['repeat'] . ' ' . $lang['password']?>" class=" form-control login_input"
44
+                <p><?php echo $lang['repeat'].' '.$lang['password']?>:</p>
45
+                <input id="user_password_repeat" placeholder="<?php echo $lang['repeat'].' '.$lang['password']?>" class=" form-control login_input"
46 46
                        type="password"
47 47
                        name="user_password_repeat" required autocorrect="off" autocapitalize="off" autocomplete="off">
48 48
             </div>
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
                 <p><?php echo $lang['level'] ?>:</p>
52 52
                 <select class="form-control" name="user_lvl">
53 53
                     <?php for ($rank = 1; $rank <= $_SESSION['user_level']; $rank++) {
54
-                        echo '<option value="' . $rank . '"';
54
+                        echo '<option value="'.$rank.'"';
55 55
                         if (isset($_POST['user_lvl'])) if ($rank == $_POST['user_lvl']) echo 'selected';
56
-                        echo '>' . $settings['ranks'][$rank] . '</option>';
56
+                        echo '>'.$settings['ranks'][$rank].'</option>';
57 57
                     } ?>
58 58
                 </select>
59 59
             </div>
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
                 <p><?php echo $lang['picture']?>:</p>
63 63
                 <select class=" form-control" name="profile_pic">
64 64
                     <?php for ($icon = 1; $icon <= 6; $icon++) {
65
-                        echo '<option value="' . $icon . '" ';
65
+                        echo '<option value="'.$icon.'" ';
66 66
                         if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected';
67
-                        echo '>' . $settings['names'][$icon] . '</option>';
67
+                        echo '>'.$settings['names'][$icon].'</option>';
68 68
                     } ?>
69 69
                 </select>
70 70
             </div>
Please login to merge, or discard this patch.
views/core/editServer.php 2 patches
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.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $id = clean($id, "int");
3 3
 if (isset($_POST['del']) && $id != 1) {
4
-    $sql = "DELETE FROM `db` WHERE `dbid`='" . $id . "';";
4
+    $sql = "DELETE FROM `db` WHERE `dbid`='".$id."';";
5 5
     $result_of_query = $db_connection->query($sql);
6
-    $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';";
6
+    $sql = "DELETE FROM `servers` WHERE `dbid`='".$id."';";
7 7
     $result_of_query = $db_connection->query($sql);
8 8
 
9 9
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
                 $pass = encrypt(clean($_POST['sql_pass'], "string"));
17 17
                 $name = encrypt(clean($_POST['sql_name'], "string"));
18 18
 
19
-                $sql = "UPDATE `db` SET `sql_host` = '" . $host . "',`sql_name` = '" . $name . "',`sql_pass` = '" . $pass . "',`sql_user` = '" . $user . "' WHERE `dbid`='" . $id . "';";
19
+                $sql = "UPDATE `db` SET `sql_host` = '".$host."',`sql_name` = '".$name."',`sql_pass` = '".$pass."',`sql_user` = '".$user."' WHERE `dbid`='".$id."';";
20 20
                 $result_of_query = $db_connection->query($sql);
21 21
 
22 22
                 $type = clean($_POST['type'], "string");
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
                     $sq_ip = encrypt(clean($_POST['sq_ip'], "string"));
28 28
                     $sq_port = encrypt(clean($_POST['sq_port'], "string"));
29 29
                     $rcon_pass = encrypt(clean($_POST['rcon_pass'], "string"));
30
-                    $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "',`sq_port`= '" . $sq_port . "',`sq_ip`= '" . $sq_ip . "',`rcon_pass`= '" . $rcon_pass . "' WHERE `dbid`='" . $id . "';";
30
+                    $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."',`sq_port`= '".$sq_port."',`sq_ip`= '".$sq_ip."',`rcon_pass`= '".$rcon_pass."' WHERE `dbid`='".$id."';";
31 31
                 } else {
32
-                    $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';";
32
+                    $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."' WHERE `dbid`='".$id."';";
33 33
                 }
34 34
                 $result_of_query = $db_connection->query($sql);
35 35
             } else message($lang['expired']);
36
-        } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
36
+        } else logAction($_SESSION['user_name'], $lang['failedUpdate'].' '.$lang['gsq'], 3);
37 37
     }
38 38
 }
39
-    $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';";
39
+    $sql = "SELECT * FROM `servers` WHERE `dbid`='".$id."';";
40 40
     $result_of_query = $db_connection->query($sql);
41 41
 
42 42
     if ($result_of_query->num_rows == 1) {
43 43
         $server = $result_of_query->fetch_object();
44
-        $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='" . $id . "';";
44
+        $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='".$id."';";
45 45
         $result = $db_connection->query($sql);
46 46
         if ($result->num_rows == 1) {
47 47
             $db = $result->fetch_object();
@@ -59,45 +59,45 @@  discard block
 block discarded – undo
59 59
     <form method='post' action='<?php echo $settings['url'] ?>editServer/<?php echo $id ?>' id='updateServer' name='updateServer'>
60 60
         <div class="col-md-6">
61 61
             <?php
62
-            echo "<h3>" . $lang['database'] . "</h3>";
63
-            echo "<div class='form-group'><label for='sql_host'>" . $lang['database'] . " " . $lang['host'] . ": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='" . decrypt($db->sql_host) . "'></div>";
64
-            echo "<div class='form-group'><label for='sql_user'>" . $lang['database'] . " " . $lang['user'] . ": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='" . decrypt($db->sql_user) . "'></div>";
65
-            echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>" . $lang['database'] . " " . $lang['password'] . ": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='" . decrypt($db->sql_pass) . "'>";
62
+            echo "<h3>".$lang['database']."</h3>";
63
+            echo "<div class='form-group'><label for='sql_host'>".$lang['database']." ".$lang['host'].": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='".decrypt($db->sql_host)."'></div>";
64
+            echo "<div class='form-group'><label for='sql_user'>".$lang['database']." ".$lang['user'].": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='".decrypt($db->sql_user)."'></div>";
65
+            echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>".$lang['database']." ".$lang['password'].": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='".decrypt($db->sql_pass)."'>";
66 66
             echo "<span class='input-group-btn'><button style='margin-top: 23px; background-color: #eee;' ";
67 67
             echo "class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div></div>";
68
-            echo "<div class='form-group'><label for='sql_name'>" . $lang['database'] . " " . $lang['name'] . ": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='" . decrypt($db->sql_name) . "'></div>";
69
-            echo "<div class='form-group'><label for='name'>" . $lang['name'] . ": </label><input class='form-control' id='name' type='text' name='name' value='" . $server->name . "'></div>";
68
+            echo "<div class='form-group'><label for='sql_name'>".$lang['database']." ".$lang['name'].": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='".decrypt($db->sql_name)."'></div>";
69
+            echo "<div class='form-group'><label for='name'>".$lang['name'].": </label><input class='form-control' id='name' type='text' name='name' value='".$server->name."'></div>";
70 70
             ?>
71
-            <div class='form-group'><label for="type"><?php echo $lang['database'] . " " . $lang['type'] ?>: </label>
71
+            <div class='form-group'><label for="type"><?php echo $lang['database']." ".$lang['type'] ?>: </label>
72 72
                 <select name="type" id="type" class="form-control">
73 73
                     <option value="life"
74
-                    <?php echo select('life', $server->type) . '>' . $lang['life'] ?></option>
74
+                    <?php echo select('life', $server->type).'>'.$lang['life'] ?></option>
75 75
                     <option value="waste"
76
-                    <?php echo select('waste', $server->type) . '>' . $lang['waste'] ?></option>
76
+                    <?php echo select('waste', $server->type).'>'.$lang['waste'] ?></option>
77 77
                 </select>
78 78
             </div>
79 79
         </div>
80 80
         <div class="col-md-6" style="float:right;">
81 81
                 <h3><?php echo $lang['gsq'] ?></h3>
82
-                <div class='form-group'><label for="usegsq"><?php echo $lang['use'] . " " . $lang['gsq'] ?>: </label>
82
+                <div class='form-group'><label for="usegsq"><?php echo $lang['use']." ".$lang['gsq'] ?>: </label>
83 83
                 <select name="usegsq" id="usegsq" class="form-control">
84 84
                     <option value="1"
85
-                    <?php echo select('1', $server->use_sq) . '>' . $lang['yes'] ?></option>
85
+                    <?php echo select('1', $server->use_sq).'>'.$lang['yes'] ?></option>
86 86
                     <option value="0"
87
-                    <?php echo select('0', $server->use_sq) . '>' . $lang['no'] ?></option>
87
+                    <?php echo select('0', $server->use_sq).'>'.$lang['no'] ?></option>
88 88
                 </select>
89 89
             </div> <?php
90
-                echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>" . $lang['gsq'] . " " . $lang['gsqa'] . ": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='";
90
+                echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>".$lang['gsq']." ".$lang['gsqa'].": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='";
91 91
                 if (isset($server->sq_ip)) {
92 92
                     echo decrypt($server->sq_ip);
93 93
                 }
94 94
                 echo "'></div>";
95
-                echo "<div class='form-group'><label for='sq_port'>" . $lang['gsq'] . " " . $lang['gsqp'] . ": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='";
95
+                echo "<div class='form-group'><label for='sq_port'>".$lang['gsq']." ".$lang['gsqp'].": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='";
96 96
                 if (isset($server->sq_port)) {
97 97
                     echo decrypt($server->sq_port);
98 98
                 }
99 99
                 echo "'></div>";
100
-                echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>" . $lang['gsq'] . " " . $lang['gsrc'] . ": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='";
100
+                echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>".$lang['gsq']." ".$lang['gsrc'].": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='";
101 101
                 if (isset($server->rcon_pass)) {
102 102
                     echo decrypt($server->rcon_pass);
103 103
                 }
Please login to merge, or discard this patch.
views/core/pluginstore.php 2 patches
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -117,24 +117,32 @@
 block discarded – undo
117 117
         }
118 118
 
119 119
         $dropIn = array_diff($files, array_column($plugins, 'dirname'));
120
-        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
120
+        if ($dropIn > 0) {
121
+            echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
122
+        }
121 123
         
122 124
         foreach ($dropIn as &$plugin) {
123 125
             $key = array_search($plugin, array_column($installed, 'dirname'));
124 126
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">';
125 127
             echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version'];
126 128
 
127
-            if (in_array($plugin, $settings['plugins']))
128
-            echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
129
-            else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
129
+            if (in_array($plugin, $settings['plugins'])) {
130
+                        echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
131
+            } else {
132
+                echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
133
+            }
130 134
 
131 135
             echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>';
132 136
 
133
-            if (in_array($plugin, $settings['plugins']))
134
-            echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
135
-            else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
137
+            if (in_array($plugin, $settings['plugins'])) {
138
+                        echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
139
+            } else {
140
+                echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
141
+            }
136 142
 
137
-            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
143
+            if (isset($installed[$key]['authurl'])) {
144
+                echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
145
+            }
138 146
             echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>';
139 147
             echo '</p></div></div></div>';
140 148
         }
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (file_exists("plugins")) {
3
-    $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id=' . $settings['id']), true);
3
+    $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id='.$settings['id']), true);
4 4
 
5 5
     function downloadFile($url) {
6
-        $newfname = realpath('downloading') . '/plugin.zip';
6
+        $newfname = realpath('downloading').'/plugin.zip';
7 7
         $folder = realpath('plugins');
8 8
         $file = fopen($url, "rb");
9 9
         if ($file) {
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
             $objects = scandir($dir);
38 38
             foreach ($objects as $object) {
39 39
                 if ($object != "." && $object != "..") {
40
-                    if (filetype($dir . "/" . $object) == "dir") {
41
-                        rrmdir($dir . "/" . $object);
40
+                    if (filetype($dir."/".$object) == "dir") {
41
+                        rrmdir($dir."/".$object);
42 42
                     } else {
43
-                        unlink($dir . "/" . $object);
43
+                        unlink($dir."/".$object);
44 44
                     }
45 45
                 }
46 46
             }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     if (isset($_GET['activate'])) {
59 59
         if (!in_array($_GET['activate'], $settings['plugins'])) {
60 60
             array_push($settings['plugins'], $_GET['activate']);
61
-            $json = json_decode(file_get_contents('plugins/' . $_GET['activate'] . '/plugin.json'), true);
61
+            $json = json_decode(file_get_contents('plugins/'.$_GET['activate'].'/plugin.json'), true);
62 62
             if (isset($json['language']) && isset($json['short'])) {
63 63
                 $lang = array($json['language'], $json['short']);
64 64
                 array_push($settings['installedLanguage'], $lang);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
                 }
71 71
             }
72
-            file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
72
+            file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
73 73
             message($lang['pluginActivated']);
74 74
         } message($lang['activeAlready']);
75 75
     }
@@ -82,17 +82,17 @@  discard block
 block discarded – undo
82 82
                 $settings['plugins'] = array_diff($settings['plugins'], array($_GET['deactivate']));
83 83
             }
84 84
             
85
-            $json = json_decode(file_get_contents('plugins/' . $_GET['deactivate'] . '/plugin.json'), true);
85
+            $json = json_decode(file_get_contents('plugins/'.$_GET['deactivate'].'/plugin.json'), true);
86 86
             if (isset($json['language']) && isset($json['short'])) {
87 87
                 $key = array_search($_GET['deactivate'], array_column($settings['installedLanguage'], 0));
88 88
                 unset($settings['installedLanguage'][$key]);
89 89
             }
90
-            file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
90
+            file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
91 91
         } message($lang['notActive']);
92 92
     }
93 93
 
94 94
     if (isset($_GET['delete'])) {
95
-        rrmdir(realpath('plugins') . '/' . $_GET['delete']);
95
+        rrmdir(realpath('plugins').'/'.$_GET['delete']);
96 96
     }
97 97
     ?>
98 98
 
@@ -112,91 +112,91 @@  discard block
 block discarded – undo
112 112
         unset($files[1]);
113 113
 
114 114
         foreach ($files as &$file) {
115
-            $path = 'plugins/' . $file . '/plugin.json';
115
+            $path = 'plugins/'.$file.'/plugin.json';
116 116
             $installed[] = json_decode(file_get_contents($path), true);
117 117
         }
118 118
 
119 119
         $dropIn = array_diff($files, array_column($plugins, 'dirname'));
120
-        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
120
+        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>".$lang['dropIn']."</h2>";
121 121
         
122 122
         foreach ($dropIn as &$plugin) {
123 123
             $key = array_search($plugin, array_column($installed, 'dirname'));
124 124
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">';
125
-            echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version'];
125
+            echo '<h3>'.$installed[$key]['name'].' - '.$installed[$key]['version'];
126 126
 
127 127
             if (in_array($plugin, $settings['plugins']))
128
-            echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
129
-            else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
128
+            echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span></small>';
129
+            else echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>';
130 130
 
131
-            echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>';
131
+            echo '</h3><p><strong>'.$installed[$key]['author'].'</strong> - '.$installed[$key]['description'].'</p>';
132 132
 
133 133
             if (in_array($plugin, $settings['plugins']))
134
-            echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
135
-            else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
134
+            echo '<p><a href="?deactivate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>';
135
+            else echo '<p><a href="?activate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>';
136 136
 
137
-            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
138
-            echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>';
137
+            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="'.$installed[$key]['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>';
138
+            echo '<a style="float: right;" href="?delete='.$plugin.'" class="btn btn-danger" role="button">'.$lang['delete'].'</a>';
139 139
             echo '</p></div></div></div>';
140 140
         }
141
-        echo "<div class='row'></div><h2>" . $lang['pluginstore'] . "</h2>";
141
+        echo "<div class='row'></div><h2>".$lang['pluginstore']."</h2>";
142 142
 
143 143
         foreach ($plugins as &$plugin) {
144 144
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail">';
145
-            echo '<img  src="' . $plugin['image'] . '" alt="' . $plugin['name'] . '">';
145
+            echo '<img  src="'.$plugin['image'].'" alt="'.$plugin['name'].'">';
146 146
             echo '<div class="caption">';
147
-            echo '<h3>' . $plugin['name'] . ' - ' . $plugin['version'];
147
+            echo '<h3>'.$plugin['name'].' - '.$plugin['version'];
148 148
 
149 149
             $key = array_search($plugin['dirname'], array_column($installed, 'dirname'));
150 150
 
151 151
             if ($key !== false) {
152 152
                 if (in_array($plugin['dirname'], $settings['plugins'])) {
153 153
                     if ($plugin['version'] > $installed[$key]['version']) {
154
-                        echo '<small style="padding-left: 6px;"><span class="label label-info">' . $lang['updateAvalible'] . '</span></small>';
154
+                        echo '<small style="padding-left: 6px;"><span class="label label-info">'.$lang['updateAvalible'].'</span></small>';
155 155
                     }
156 156
                     // Update avalible
157 157
                     else {
158
-                        echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span>';
158
+                        echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span>';
159 159
                     }
160 160
                     // Active plugin
161 161
                 } elseif (in_array($plugin['dirname'], $files)) {
162
-                    echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
162
+                    echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>';
163 163
                 }
164 164
                 // Installed not active
165 165
             }
166
-            echo '</h3><p><strong>' . $plugin['author'] . '</strong> - ' . $plugin['description'] . '</p>';
166
+            echo '</h3><p><strong>'.$plugin['author'].'</strong> - '.$plugin['description'].'</p>';
167 167
 
168 168
             if ($key !== false) {
169 169
                 if (in_array($plugin['dirname'], $settings['plugins'])) {
170 170
                     if ($plugin['version'] > $installed[$key]['version']) {
171
-                        echo '<div><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['update'] . '</a>';
171
+                        echo '<div><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['update'].'</a>';
172 172
                     }
173 173
                     // Update avalible
174 174
                     else {
175
-                        echo '<p><a href="?deactivate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
175
+                        echo '<p><a href="?deactivate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>';
176 176
                     }
177 177
                     // Active plugin
178 178
                 } elseif (in_array($plugin['dirname'], $files)) {
179
-                    echo '<p><a href="?activate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
179
+                    echo '<p><a href="?activate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>';
180 180
                 }
181 181
                 // Installed not active
182 182
             } else {
183
-                echo '<p><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['install'] . '</a>';
183
+                echo '<p><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['install'].'</a>';
184 184
             }
185 185
             // Not installed
186 186
 
187 187
             if (isset($plugin['authurl'])) {
188
-                echo '<a style="margin-left: 5px;" href="' . $plugin['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
188
+                echo '<a style="margin-left: 5px;" href="'.$plugin['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>';
189 189
             }
190 190
             if (in_array($plugin['dirname'], $files)) {
191
-                echo '<a style="float: right;" href="?delete=' . $plugin['dirname'] . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a></div>';
191
+                echo '<a style="float: right;" href="?delete='.$plugin['dirname'].'" class="btn btn-danger" role="button">'.$lang['delete'].'</a></div>';
192 192
             }
193 193
             echo '</div></div></div>';
194 194
         }
195 195
 
196 196
         echo '</div></div></form>';
197 197
     } else {
198
-        echo '<h2>' . $lang['notverified'] . '</h2>';
198
+        echo '<h2>'.$lang['notverified'].'</h2>';
199 199
     }
200 200
     } else {
201
-    echo '<h2>' . $lang['noPlugin'] . '</h2>';
201
+    echo '<h2>'.$lang['noPlugin'].'</h2>';
202 202
 }
Please login to merge, or discard this patch.
views/core/newServer.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,8 @@  discard block
 block discarded – undo
75 75
                     <input placeholder="SQ IP" id="server_SQ_host"
76 76
                        class=" form-control login_input" type="text"
77 77
                        name="server_SQ_host"
78
-                        <?php if (isset($_POST['server_SQ_host'])) echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off">
78
+                        <?php if (isset($_POST['server_SQ_host'])) {
79
+    echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off">
79 80
                     </div>
80 81
                     <div class="form-group">
81 82
                         <label for="server_SQ_port">SQ port: </label>
@@ -93,6 +94,7 @@  discard block
 block discarded – undo
93 94
                             <?php
94 95
                 $sql = "SELECT `dbid`,`sql_name` FROM `db`;";
95 96
 }
97
+}
96 98
                 $result_of_query = $db_connection->query($sql);
97 99
                 if ($result_of_query->num_rows >= 1) {
98 100
                     echo '<div class="form-group"><label for="server_dbid">Database: </label>';
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
         if ($dbid == 'none') {
6 6
             $server_type = 'life';
7 7
 
8
-            $sql = "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES ('" . $server_type . "', '" . $settings['db']['host'] . "', '" . $settings['db']['user'] . "', '" . $settings['db']['pass'] . "', '" . $settings['db']['name'] . "');";
8
+            $sql = "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES ('".$server_type."', '".$settings['db']['host']."', '".$settings['db']['user']."', '".$settings['db']['pass']."', '".$settings['db']['name']."');";
9 9
             $result_of_query = $db_connection->query($sql);
10 10
 
11
-            $sql = "SELECT `dbid` FROM `db` WHERE `sql_name` = '" . $SQL_name . "';";
11
+            $sql = "SELECT `dbid` FROM `db` WHERE `sql_name` = '".$SQL_name."';";
12 12
             $result_of_query = $db_connection->query($sql);
13 13
             while ($row = mysqli_fetch_assoc($result_of_query)) {
14 14
                 $dbid = $row['dbid'];
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
                 $server_RCON_pass = encrypt($_POST['server_RCON_pass']);
28 28
 
29 29
                 $sql = "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`, `sq_port`,`sq_ip`, `rcon_pass`) VALUES
30
-                ('" . $server_name . "', '" . $dbid . "', '" . $server_type . "', '" . $server_SQ . "', '" . $server_SQ_port . "', '" . $server_SQ_host . "', '" . $server_RCON_pass . "');";
30
+                ('" . $server_name."', '".$dbid."', '".$server_type."', '".$server_SQ."', '".$server_SQ_port."', '".$server_SQ_host."', '".$server_RCON_pass."');";
31 31
             }
32 32
         } else {
33 33
             $sql = "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`) VALUES
34
-                ('" . $server_name . "', '" . $dbid . "', '" . $server_type . "', '" . $server_SQ . "');";
34
+                ('" . $server_name."', '".$dbid."', '".$server_type."', '".$server_SQ."');";
35 35
         }
36 36
 
37 37
         $result_of_query = $db_connection->query($sql);
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
         <form method="post" action="newServer" name="newServer" id="newServer">
47 47
             <?php echo formtoken::getField() ?>
48 48
             <h2 class="form-login-heading">
49
-                <?php echo $lang['new'] . ' ' . $lang['gameServers'] ?>
49
+                <?php echo $lang['new'].' '.$lang['gameServers'] ?>
50 50
             </h2>
51 51
             <div class="form-group">
52 52
                 <label for="server_name">Server Name: </label>
53 53
                 <input placeholder="Server Name" id="server_name" class=" form-control login_input" type="text" name="server_name"
54 54
                     <?php if (isset($_POST['server_name'])) {
55
-    echo 'value="' . $_POST['server_name'] . '"' ?>
55
+    echo 'value="'.$_POST['server_name'].'"' ?>
56 56
                        autocorrect="off" required>
57 57
                 </div>
58 58
                 <div class="form-group">
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
                     <input placeholder="SQ IP" id="server_SQ_host"
76 76
                        class=" form-control login_input" type="text"
77 77
                        name="server_SQ_host"
78
-                        <?php if (isset($_POST['server_SQ_host'])) echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off">
78
+                        <?php if (isset($_POST['server_SQ_host'])) echo 'value="'.$_POST['server_SQ_host'].'"' ?> autocorrect="off" autocapitalize="off">
79 79
                     </div>
80 80
                     <div class="form-group">
81 81
                         <label for="server_SQ_port">SQ port: </label>
82 82
                         <input placeholder="SQ Port" id="server_SQ_port"
83 83
                        class=" form-control login_input" type="text"
84 84
                        name="server_SQ_port"
85
-                            <?php if (isset($_POST['server_SQ_port'])) echo 'value="' . $_POST['server_SQ_port'] . '"' ?> autocorrect="off" autocapitalize="off" autocomplete="off">
85
+                            <?php if (isset($_POST['server_SQ_port'])) echo 'value="'.$_POST['server_SQ_port'].'"' ?> autocorrect="off" autocapitalize="off" autocomplete="off">
86 86
                         </div>
87 87
                         <div class="form-group">
88 88
                             <label for="server_RCON_pass">RCON Password: </label>
89 89
                             <input placeholder="RCON Password" id="server_RCON_pass" class=" form-control login_input" type="password" name="server_RCON_pass"
90
-                                <?php if (isset($_POST['server_RCON_pass'])) echo 'value="' . $_POST['server_RCON_pass'] . '"' ?> autocorrect="off" autocapitalize="off" autocomplete="off">
90
+                                <?php if (isset($_POST['server_RCON_pass'])) echo 'value="'.$_POST['server_RCON_pass'].'"' ?> autocorrect="off" autocapitalize="off" autocomplete="off">
91 91
                             </div>
92 92
                             </div>
93 93
                             <?php
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     echo '<div class="form-group"><label for="server_dbid">Database: </label>';
99 99
                     echo '<select id="server_dbid" name="server_dbid" class="form-control login_input">';
100 100
                     while ($row = mysqli_fetch_assoc($result_of_query)) {
101
-                        echo '<option value="' . $row['dbid'] . '">' . decrypt($row['sql_name'], $settings['key']) . '</option>';
101
+                        echo '<option value="'.$row['dbid'].'">'.decrypt($row['sql_name'], $settings['key']).'</option>';
102 102
                     }
103 103
                     echo '</select></div>';
104 104
                 } else {
Please login to merge, or discard this patch.
views/core/profile.php 3 patches
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,10 @@  discard block
 block discarded – undo
103 103
                     invalid: 'fa fa-times',
104 104
                     validating: 'fa fa-refresh'
105 105
                 },
106
-                locale: '<?php if (isset($_SESSION['forum_lang'])) echo $_SESSION['forum_lang']; else echo 'en_US' ?>',
106
+                locale: '<?php if (isset($_SESSION['forum_lang'])) {
107
+    echo $_SESSION['forum_lang'];
108
+} else {
109
+    echo 'en_US' ?>',
107 110
                 fields: {
108 111
                     email: {
109 112
                         validators: {
@@ -131,7 +134,9 @@  discard block
 block discarded – undo
131 134
                                 regexp: /^\d{15,25}$/
132 135
                             },
133 136
                             remote: {
134
-                                url: '<?php echo $settings['url']; ?>validators/pid.php',
137
+                                url: '<?php echo $settings['url'];
138
+}
139
+?>validators/pid.php',
135 140
                                 type: 'POST',
136 141
                                 message: '<?php echo $lang['failPID'] ?>'
137 142
                             }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,13 +113,13 @@
 block discarded – undo
113 113
                 </table>
114 114
                 <span class="pull-right">
115 115
                      <?php
116
-                     $sql = "SELECT `uid`,`playerid` FROM `players` WHERE `playerid` = '" . $profile->playerid . "' ";
117
-                     $result = $db_connection->query($sql);
116
+                        $sql = "SELECT `uid`,`playerid` FROM `players` WHERE `playerid` = '" . $profile->playerid . "' ";
117
+                        $result = $db_connection->query($sql);
118 118
 
119
-                     if ($result->num_rows > 0) {
120
-                         ?> <a class="btn btn-sm btn-primary" href="<?php echo $settings['url'] . 'editPlayer/' . $result->fetch_object()->uid ?> ">  My Player</a> <?php
121
-                     }
122
-                     ?>
119
+                        if ($result->num_rows > 0) {
120
+                            ?> <a class="btn btn-sm btn-primary" href="<?php echo $settings['url'] . 'editPlayer/' . $result->fetch_object()->uid ?> ">  My Player</a> <?php
121
+                        }
122
+                        ?>
123 123
                 </span>
124 124
             </div>
125 125
         </div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
         $user_pic = $_POST['user_pic'];
6 6
         $pId = $_POST['player_id'];
7 7
         $_SESSION['user_profile'] = $user_pic;
8
-        $sql = "UPDATE `users` SET `user_email`= '" . $email . "',`playerid`= '" . $pId . "', `user_profile`= '" . $user_pic . "'WHERE `user_id` = '" . $_SESSION['user_id'] . "' ";
8
+        $sql = "UPDATE `users` SET `user_email`= '".$email."',`playerid`= '".$pId."', `user_profile`= '".$user_pic."'WHERE `user_id` = '".$_SESSION['user_id']."' ";
9 9
         $result_of_query = $db_connection->query($sql);
10 10
     } else {
11 11
         message($lang['expired']);
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 }
14 14
 if (isset($_POST['user_password'])) {
15 15
     if (formtoken::validateToken($_POST)) {
16
-        $sql = "SELECT `user_password_hash` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
16
+        $sql = "SELECT `user_password_hash` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';";
17 17
         $result = $db_connection->query($sql)->fetch_object();
18
-        if ($_POST['user_password'] == $_POST['user_password_again'] && password_verify($_POST['current_password'],$result->user_password_hash)) {
19
-            $sql = "UPDATE `users` SET `user_password_hash`= '" . password_hash($_POST['user_password'], PASSWORD_DEFAULT) . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
18
+        if ($_POST['user_password'] == $_POST['user_password_again'] && password_verify($_POST['current_password'], $result->user_password_hash)) {
19
+            $sql = "UPDATE `users` SET `user_password_hash`= '".password_hash($_POST['user_password'], PASSWORD_DEFAULT)."' WHERE `user_id` = '".$_SESSION['user_id']."';";
20 20
             $result_of_query = $db_connection->query($sql);
21 21
             message($lang['passChanged']);
22 22
         }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     }
26 26
 }
27 27
 
28
-$sql = "SELECT * FROM `users` WHERE `user_name` ='" . $_SESSION['user_name'] . "';";
28
+$sql = "SELECT * FROM `users` WHERE `user_name` ='".$_SESSION['user_name']."';";
29 29
 $profile = $db_connection->query($sql)->fetch_object();
30 30
 ?>
31 31
 <div class="row">
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
     <div class="panel-body">
45 45
         <div class="row">
46 46
             <div  style="padding-top:4%;" class="col-md-3 col-lg-3 " align="center">
47
-                <?php if(!isset($_SESSION['profile_link'])) {
48
-                    if(isset($_SESSION['user_email']) && $settings['gravatar']) { ?>
49
-                        <a href="<?php echo $settings['url'] . 'profile' ?>"> <img alt="User Pic" src="<?php get_gravatar($_SESSION['user_email'],64,'retro')  ?>" class="img-circle img-responsive"></a>
47
+                <?php if (!isset($_SESSION['profile_link'])) {
48
+                    if (isset($_SESSION['user_email']) && $settings['gravatar']) { ?>
49
+                        <a href="<?php echo $settings['url'].'profile' ?>"> <img alt="User Pic" src="<?php get_gravatar($_SESSION['user_email'], 64, 'retro')  ?>" class="img-circle img-responsive"></a>
50 50
                     <?php } else {?>
51
-                        <a href="<?php echo $settings['url'] . 'profile' ?>"> <img alt="User Pic" src="<?php echo $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg' ?>" class="img-circle img-responsive"></a>
51
+                        <a href="<?php echo $settings['url'].'profile' ?>"> <img alt="User Pic" src="<?php echo $settings['url'].'assets/img/profile/'.$_SESSION['user_profile'].'.jpg' ?>" class="img-circle img-responsive"></a>
52 52
                     <?php } ?>
53 53
                 <?php } else { ?>
54
-                    <img alt="User Pic" src="<?php echo $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg' ?>" class="img-circle img-responsive">
54
+                    <img alt="User Pic" src="<?php echo $settings['url'].'assets/img/profile/'.$_SESSION['user_profile'].'.jpg' ?>" class="img-circle img-responsive">
55 55
                 <?php } ?>
56 56
             </div>
57 57
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                     <tbody>
61 61
                     <tr>
62 62
                         <td><?php echo $lang['rank'] ?>:</td>
63
-                        <td><?php echo $settings['ranks'][$profile->user_level] . " (" . $profile->user_level . ")" ?></td>
63
+                        <td><?php echo $settings['ranks'][$profile->user_level]." (".$profile->user_level.")" ?></td>
64 64
                     </tr>
65 65
                     <form method="post" action="profile" name="profileEdit" id="profileEdit">
66 66
                         <?php echo formtoken::getField(); ?>
@@ -78,26 +78,26 @@  discard block
 block discarded – undo
78 78
                                 <select id='user_pic' name='user_pic' class='form-control'>";
79 79
                                     <?php
80 80
                                     for ($icon = 1; $icon < 6; $icon++) {
81
-                                        echo '<option value="' . $icon . '" ' . select($icon, $profile->user_profile) . '>' . $settings['names'][$icon] . '</option>';
81
+                                        echo '<option value="'.$icon.'" '.select($icon, $profile->user_profile).'>'.$settings['names'][$icon].'</option>';
82 82
                                     }
83 83
                                     ?>
84 84
                                 </select>
85 85
                             </td>
86 86
                         </tr>
87 87
                         <tr>
88
-                            <td><?php echo $lang['current'] . " " . $lang['password'] ?></td>
88
+                            <td><?php echo $lang['current']." ".$lang['password'] ?></td>
89 89
                             <td>
90 90
                                 <input type="password" id="current_password" name="current_password" class="form-control" autocorrect="off" autocapitalize="off" autocomplete="off">
91 91
                             </td>
92 92
                         </tr>
93 93
                         <tr>
94
-                            <td><?php echo "New " . $lang['password'] ?></td>
94
+                            <td><?php echo "New ".$lang['password'] ?></td>
95 95
                             <td>
96 96
                                 <input type="password" id="user_password" name="user_password" class="form-control" autocorrect="off" autocapitalize="off" autocomplete="off">
97 97
                             </td>
98 98
                         </tr>
99 99
                         <tr>
100
-                            <td><?php echo $lang['repeat'] . " New " . $lang['password'] ?></td>
100
+                            <td><?php echo $lang['repeat']." New ".$lang['password'] ?></td>
101 101
                             <td>
102 102
                                 <input type="password" id="user_password_again" name="user_password_again" autocorrect="off" class="form-control" autocapitalize="off" autocomplete="off">
103 103
                             </td>
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
                 </table>
114 114
                 <span class="pull-right">
115 115
                      <?php
116
-                     $sql = "SELECT `uid`,`playerid` FROM `players` WHERE `playerid` = '" . $profile->playerid . "' ";
116
+                     $sql = "SELECT `uid`,`playerid` FROM `players` WHERE `playerid` = '".$profile->playerid."' ";
117 117
                      $result = $db_connection->query($sql);
118 118
 
119 119
                      if ($result->num_rows > 0) {
120
-                         ?> <a class="btn btn-sm btn-primary" href="<?php echo $settings['url'] . 'editPlayer/' . $result->fetch_object()->uid ?> ">  My Player</a> <?php
120
+                         ?> <a class="btn btn-sm btn-primary" href="<?php echo $settings['url'].'editPlayer/'.$result->fetch_object()->uid ?> ">  My Player</a> <?php
121 121
                      }
122 122
                      ?>
123 123
                 </span>
Please login to merge, or discard this patch.
views/core/register.php 2 patches
Braces   +11 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,13 +22,19 @@  discard block
 block discarded – undo
22 22
                 <p>Username:</p>
23 23
                 <input id="user_name" type="text" class="form-control"
24 24
                        placeholder="Username (only letters and numbers, 2 to 30 characters)" 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
 
28 31
             <div class="form-group">
29 32
                 <p>Email Address:</p>
30 33
                 <input id="user_email" placeholder="User's email" class=" form-control" type="email"
31
-                       name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required/>
34
+                       name="user_email" <?php if (isset($_POST['user_name'])) {
35
+    echo 'value="' . $_POST['user_name'] . '"';
36
+}
37
+?> required/>
32 38
             </div>
33 39
             <div class="form-group">
34 40
                 <p>Password:</p>
@@ -47,7 +53,9 @@  discard block
 block discarded – undo
47 53
                 <select class=" form-control" name="profile_pic">
48 54
                     <?php for ($icon = 1; $icon <= 6; $icon++) {
49 55
                         echo '<option value="' . $icon . '" ';
50
-                        if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected';
56
+                        if (isset($_POST['user_name'])) {
57
+                            if ($icon == $_POST['user_name']) echo 'selected';
58
+                        }
51 59
                         echo '>' . $settings['names'][$icon] . '</option>';
52 60
                     } ?>
53 61
                 </select>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
                 <p>Username:</p>
23 23
                 <input id="user_name" type="text" class="form-control"
24 24
                        placeholder="Username (only letters and numbers, 2 to 30 characters)" 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'])) echo 'value="'.$_POST['user_name'].'"'; ?> required>
26 26
             </div>
27 27
 
28 28
             <div class="form-group">
29 29
                 <p>Email Address:</p>
30 30
                 <input id="user_email" placeholder="User's email" class=" form-control" type="email"
31
-                       name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required/>
31
+                       name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="'.$_POST['user_name'].'"'; ?> required/>
32 32
             </div>
33 33
             <div class="form-group">
34 34
                 <p>Password:</p>
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
                 <p>Profile Picture:</p>
47 47
                 <select class=" form-control" name="profile_pic">
48 48
                     <?php for ($icon = 1; $icon <= 6; $icon++) {
49
-                        echo '<option value="' . $icon . '" ';
49
+                        echo '<option value="'.$icon.'" ';
50 50
                         if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected';
51
-                        echo '>' . $settings['names'][$icon] . '</option>';
51
+                        echo '>'.$settings['names'][$icon].'</option>';
52 52
                     } ?>
53 53
                 </select>
54 54
             </div>
Please login to merge, or discard this patch.
views/firstTime.php 2 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -295,7 +295,8 @@  discard block
 block discarded – undo
295 295
                             <br>
296 296
                             <label for="community_name">Community Name: </label>
297 297
                             <input placeholder="Community Name" id="community_name"
298
-                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) echo 'value="' . $_POST['community_name'] . '"'?>>
298
+                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) {
299
+    echo 'value="' . $_POST['community_name'] . '"'?>>
299 300
                             <br><h4>User Setup</h4>
300 301
                             <label for="user_name">Username: </label>
301 302
                             <input placeholder="Username" id="user_name"
@@ -317,10 +318,14 @@  discard block
 block discarded – undo
317 318
 
318 319
                             <select id='user_pic' name='user_pic' class=" form-control login_input">
319 320
                             <?php
320
-                            for ($icon = 1; $icon < 7; $icon++) {
321
+                            for ($icon = 1;
322
+}
323
+$icon < 7; $icon++) {
321 324
                                 echo '<option value="' . $icon . '"';
322 325
                                 if (isset($_POST['user_pic'])) {
323
-                                    if ($icon == $_POST['user_pic']) echo ' selected';
326
+                                    if ($icon == $_POST['user_pic']) {
327
+                                        echo ' selected';
328
+                                    }
324 329
                                 }
325 330
                                 echo '>' . $icon . '</option>';
326 331
                             } ?>
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     $max = ceil($length / 40);
7 7
     $random = '';
8 8
     for ($i = 0; $i < $max; $i++) {
9
-        $random .= sha1(microtime(true) . mt_rand(10000, 90000));
9
+        $random .= sha1(microtime(true).mt_rand(10000, 90000));
10 10
     }
11 11
     return substr($random, 0, $length);
12 12
 }
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 if (isset($_POST['user_name'])) {
25
-    $last = str_replace(strrchr($_SERVER['REQUEST_URI'], '/'), '', $_SERVER['REQUEST_URI']) . '/';
26
-    $settings['url'] = 'http://' . $_SERVER['HTTP_HOST'] . $last;
25
+    $last = str_replace(strrchr($_SERVER['REQUEST_URI'], '/'), '', $_SERVER['REQUEST_URI']).'/';
26
+    $settings['url'] = 'http://'.$_SERVER['HTTP_HOST'].$last;
27 27
     $base = substr($last, 1);
28 28
     $settings['base'] = substr_count($settings['url'], "/") - 2;
29 29
 
30 30
     $hta = 'RewriteEngine On
31
-RewriteBase /'.$base . '
31
+RewriteBase /'.$base.'
32 32
 RewriteCond %{REQUEST_FILENAME} !-f
33
-RewriteRule . /'.$base . 'index.php [L]';
34
-    file_put_contents('.htaccess',$hta);
33
+RewriteRule . /'.$base.'index.php [L]';
34
+    file_put_contents('.htaccess', $hta);
35 35
 
36 36
     $settings['id'] = 1001;
37 37
     $settings['community'] = $_POST['community_name'];
@@ -111,21 +111,21 @@  discard block
 block discarded – undo
111 111
     $settings['communityBansTest'] = false;
112 112
     $settings['communityBansAPI'] = '';
113 113
 
114
-    $settings['item'] = array(5,10,15,25,50);
114
+    $settings['item'] = array(5, 10, 15, 25, 50);
115 115
 
116
-    $settings['installedLanguage']=array();
117
-    $langEn = array('English','en');
118
-    $langDe = array('German','de');
116
+    $settings['installedLanguage'] = array();
117
+    $langEn = array('English', 'en');
118
+    $langDe = array('German', 'de');
119 119
     array_push($settings['installedLanguage'], $langEn);
120 120
     array_push($settings['installedLanguage'], $langDe);
121 121
 
122 122
     $settings['names'] = array('', 'Dave', 'Sam', 'Joe', 'Kerry', 'Connie', 'Jess');
123
-    $settings['ranks'] = array('Banned','Player','Member','Moderator','Server Admin','Super Admin');
123
+    $settings['ranks'] = array('Banned', 'Player', 'Member', 'Moderator', 'Server Admin', 'Super Admin');
124 124
 
125 125
     $permissions = include 'config/permissions.php';
126 126
     $userPerms = json_encode($permissions['5']);
127 127
 
128
-    $link = mysqli_connect($server_SQL_host,$server_SQL_user,$server_SQL_pass,$server_SQL_name);
128
+    $link = mysqli_connect($server_SQL_host, $server_SQL_user, $server_SQL_pass, $server_SQL_name);
129 129
     if (mysqli_connect_errno()) {
130 130
         printf("Connect failed: %s\n", mysqli_connect_error());
131 131
         exit();
@@ -133,31 +133,31 @@  discard block
 block discarded – undo
133 133
 
134 134
     $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);
135 135
 
136
-    mysqli_query($link, "USE `" . $server_SQL_name . "`;") or die('LINK: ' . mysqli_error($link));
136
+    mysqli_query($link, "USE `".$server_SQL_name."`;") or die('LINK: '.mysqli_error($link));
137 137
 
138
-    $query = mysqli_query($link, "SHOW TABLES LIKE 'users'") or die('TEST 1: ' . mysqli_error($link));
138
+    $query = mysqli_query($link, "SHOW TABLES LIKE 'users'") or die('TEST 1: '.mysqli_error($link));
139 139
     if (mysqli_num_rows($query) == 1) {
140
-        mysqli_query($link, "DROP TABLE `users`") or die('DROP 1: ' . mysqli_error($link));
140
+        mysqli_query($link, "DROP TABLE `users`") or die('DROP 1: '.mysqli_error($link));
141 141
     }
142 142
 
143
-    $query = mysqli_query($link, "SHOW TABLES LIKE 'notes'") or die('TEST 2: ' . mysqli_error($link));
143
+    $query = mysqli_query($link, "SHOW TABLES LIKE 'notes'") or die('TEST 2: '.mysqli_error($link));
144 144
     if (mysqli_num_rows($query) == 1) {
145
-        mysqli_query($link, "DROP TABLE `notes`") or die('DROP 2: ' . mysqli_error($link));
145
+        mysqli_query($link, "DROP TABLE `notes`") or die('DROP 2: '.mysqli_error($link));
146 146
     }
147 147
 
148
-    $query = mysqli_query($link, "SHOW TABLES LIKE 'db'") or die('TEST 3: ' . mysqli_error($link));
148
+    $query = mysqli_query($link, "SHOW TABLES LIKE 'db'") or die('TEST 3: '.mysqli_error($link));
149 149
     if (mysqli_num_rows($query) == 1) {
150
-        mysqli_query($link, "DROP TABLE `db`") or die('DROP 3: ' . mysqli_error($link));
150
+        mysqli_query($link, "DROP TABLE `db`") or die('DROP 3: '.mysqli_error($link));
151 151
     }
152 152
 
153
-    $query = mysqli_query($link, "SHOW TABLES LIKE 'servers'") or die('TEST 4: ' . mysqli_error($link));
153
+    $query = mysqli_query($link, "SHOW TABLES LIKE 'servers'") or die('TEST 4: '.mysqli_error($link));
154 154
     if (mysqli_num_rows($query) == 1) {
155
-        mysqli_query($link, "DROP TABLE `servers`") or die('DROP 4: ' . mysqli_error($link));
155
+        mysqli_query($link, "DROP TABLE `servers`") or die('DROP 4: '.mysqli_error($link));
156 156
     }
157 157
 
158
-    $query = mysqli_query($link, "SHOW TABLES LIKE 'logs'") or die('TEST 5: ' . mysqli_error($link));
158
+    $query = mysqli_query($link, "SHOW TABLES LIKE 'logs'") or die('TEST 5: '.mysqli_error($link));
159 159
     if (mysqli_num_rows($query) == 1) {
160
-        mysqli_query($link, "DROP TABLE `logs`") or die('DROP 5: ' . mysqli_error($link));
160
+        mysqli_query($link, "DROP TABLE `logs`") or die('DROP 5: '.mysqli_error($link));
161 161
     }
162 162
 
163 163
     mysqli_query($link, "CREATE TABLE IF NOT EXISTS `users` (
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
   `twoFactor` VARCHAR(25) NULL,
174 174
   `backup` VARCHAR(255) NULL,
175 175
   `token` VARCHAR(64) NULL
176
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='user data';") or die('1: ' . mysqli_error($link));
176
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='user data';") or die('1: '.mysqli_error($link));
177 177
 
178 178
     if (isset($_POST['user_pid'])) {
179 179
         $user_pid = $_POST['user_pid'];
180 180
         mysqli_query($link, "INSERT INTO `users` (`user_id`, `user_name`, `user_password_hash`, `user_email`, `playerid`, `user_level`, `permissions`,
181 181
 
182 182
 `user_profile`) VALUES
183
-    (1, '" . $user_name . "', '" . $user_password_hash . "', '" . $user_email . "', '" . $user_pid . "', 5, '" . $userPerms . "', '" . $user_pic . "');") or die('2: ' . mysqli_error($link));
183
+    (1, '" . $user_name."', '".$user_password_hash."', '".$user_email."', '".$user_pid."', 5, '".$userPerms."', '".$user_pic."');") or die('2: '.mysqli_error($link));
184 184
     } else { mysqli_query($link, "INSERT INTO `users` (`user_id`, `user_name`, `user_password_hash`, `user_email`, `user_level`, `permissions`, `user_profile`) VALUES
185
-    (1, '" . $user_name . "', '" . $user_password_hash . "', '" . $user_email . "', 5, '" . $userPerms . "', '" . $user_pic . "');") or die('2: ' . mysqli_error($link)); }
185
+    (1, '" . $user_name."', '".$user_password_hash."', '".$user_email."', 5, '".$userPerms."', '".$user_pic."');") or die('2: '.mysqli_error($link)); }
186 186
 
187 187
     mysqli_query($link, "ALTER TABLE `users`
188
-    MODIFY `user_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing user_id of each user, unique index',AUTO_INCREMENT=2;") or die('3: ' . mysqli_error($link));
188
+    MODIFY `user_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing user_id of each user, unique index',AUTO_INCREMENT=2;") or die('3: '.mysqli_error($link));
189 189
 
190 190
     mysqli_query($link, "CREATE TABLE IF NOT EXISTS `notes` (
191 191
 	  `note_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing note_id of each user, unique index',
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	  `note_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
196 196
 	  PRIMARY KEY (`note_id`),
197 197
 	  UNIQUE KEY `note_id` (`note_id`)
198
-    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;") or die('4: ' . mysqli_error($link));
198
+    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;") or die('4: '.mysqli_error($link));
199 199
 
200 200
     mysqli_query($link, "CREATE TABLE IF NOT EXISTS `db` (
201 201
     `dbid` INT(11) NOT NULL AUTO_INCREMENT,
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
     `sql_name` VARCHAR(64) NOT NULL,
207 207
 	PRIMARY KEY (dbid),
208 208
 	UNIQUE KEY `dbid` (`dbid`)
209
-    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;") or die('5: ' . mysqli_error($link));
209
+    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;") or die('5: '.mysqli_error($link));
210 210
 
211 211
     mysqli_query($link, "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES
212
-    ('" . $sql_type . "', '" . $encrypted_SQL_host . "', '" . $encrypted_SQL_user . "', '" . $encrypted_SQL_pass . "', '" . $encrypted_SQL_name . "');") or die ('6: ' . mysqli_error($link));
212
+    ('" . $sql_type."', '".$encrypted_SQL_host."', '".$encrypted_SQL_user."', '".$encrypted_SQL_pass."', '".$encrypted_SQL_name."');") or die ('6: '.mysqli_error($link));
213 213
 
214 214
     mysqli_query($link, "CREATE TABLE IF NOT EXISTS `servers` (
215 215
     `sid` INT(2) NOT NULL AUTO_INCREMENT,
@@ -222,16 +222,16 @@  discard block
 block discarded – undo
222 222
     `rcon_pass` VARCHAR(255) NULL,
223 223
 	PRIMARY KEY (`sid`),
224 224
 	UNIQUE KEY `sid` (`sid`)
225
-    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;") or die('7: ' . mysqli_error($link));
225
+    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;") or die('7: '.mysqli_error($link));
226 226
 
227 227
     if ($server_use_SQ == '1') {
228 228
         mysqli_query($link, "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`, `sq_port`, `sq_ip`,`rcon_pass`) VALUES
229
-    ('" . $server_name . "', '1', '" . $server_type . "', '" . $server_use_SQ . "', '" . $server_PORT . "', '" . $server_IP . "', '" . $server_RCON . "');") or die
229
+    ('" . $server_name."', '1', '".$server_type."', '".$server_use_SQ."', '".$server_PORT."', '".$server_IP."', '".$server_RCON."');") or die
230 230
 
231
-('8: ' . mysqli_error($link));
231
+('8: '.mysqli_error($link));
232 232
     } else {
233 233
                 mysqli_query($link, "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`) VALUES
234
-    ('" . $server_name . "', '1', '" . $server_type . "', '" . $server_use_SQ . "');") or die('8: ' . mysqli_error($link));
234
+    ('" . $server_name."', '1', '".$server_type."', '".$server_use_SQ."');") or die('8: '.mysqli_error($link));
235 235
     }
236 236
 
237 237
     mysqli_query($link, "CREATE TABLE IF NOT EXISTS `logs` (
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
     PRIMARY KEY (`logid`),
244 244
     UNIQUE KEY `logid` (`logid`),
245 245
     KEY `logid_2` (`logid`)
246
-    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;") or die('9: ' . mysqli_error($link));
246
+    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;") or die('9: '.mysqli_error($link));
247 247
 
248 248
     mysqli_close($link);
249 249
 
250
-    file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
250
+    file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
251 251
     $settings = include 'config/settings.php';
252 252
 
253 253
     header("Location: index?setup=1");
@@ -294,34 +294,34 @@  discard block
 block discarded – undo
294 294
                             <br>
295 295
                             <label for="community_name">Community Name: </label>
296 296
                             <input placeholder="Community Name" id="community_name"
297
-                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) echo 'value="' . $_POST['community_name'] . '"'?>>
297
+                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) echo 'value="'.$_POST['community_name'].'"'?>>
298 298
                             <br><h4>User Setup</h4>
299 299
                             <label for="user_name">Username: </label>
300 300
                             <input placeholder="Username" id="user_name"
301
-                                   class="form-control login_input" type="text" name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'?>>
301
+                                   class="form-control login_input" type="text" name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="'.$_POST['user_name'].'"'?>>
302 302
 
303 303
                             <label for="user_email">Email: </label>
304 304
                             <input placeholder="Email" id="user_email" class="form-control login_input"
305
-                                   type="email" name="user_email" required <?php if (isset($_POST['user_email'])) echo 'value="' . $_POST['user_email'] . '"'?>>
305
+                                   type="email" name="user_email" required <?php if (isset($_POST['user_email'])) echo 'value="'.$_POST['user_email'].'"'?>>
306 306
 
307 307
                             <label for="user_password">Password: </label>
308 308
                             <input placeholder="Password" id="user_password"
309 309
                                    class="form-control login_input" type="password" name="user_password"
310
-                                   autocomplete="off" required <?php if (isset($_POST['user_password'])) echo 'value="' . $_POST['user_password'] . '"'?>>
310
+                                   autocomplete="off" required <?php if (isset($_POST['user_password'])) echo 'value="'.$_POST['user_password'].'"'?>>
311 311
 
312 312
                             <label for="user_pid">Player ID: </label>
313 313
                             <input placeholder="Player ID" id="user_pid"
314
-                                   class="form-control login_input" type="number" name="user_pid" <?php if (isset($_POST['user_pid'])) echo 'value="' . $_POST['user_pid'] . '"'?>>
314
+                                   class="form-control login_input" type="number" name="user_pid" <?php if (isset($_POST['user_pid'])) echo 'value="'.$_POST['user_pid'].'"'?>>
315 315
                             <label for="user_pic">Picture: </label>
316 316
 
317 317
                             <select id='user_pic' name='user_pic' class=" form-control login_input">
318 318
                             <?php
319 319
                             for ($icon = 1; $icon < 7; $icon++) {
320
-                                echo '<option value="' . $icon . '"';
320
+                                echo '<option value="'.$icon.'"';
321 321
                                 if (isset($_POST['user_pic'])) {
322 322
                                     if ($icon == $_POST['user_pic']) echo ' selected';
323 323
                                 }
324
-                                echo '>' . $icon . '</option>';
324
+                                echo '>'.$icon.'</option>';
325 325
                             } ?>
326 326
                             </select>
327 327
                             <br>
@@ -336,29 +336,29 @@  discard block
 block discarded – undo
336 336
                             <label for="server_SQL_host">SQL Host: </label>
337 337
                             <input placeholder="SQL Host" id="server_SQL_host"
338 338
                                    class="form-control login_input" type="text" name="server_SQL_host"
339
-                                <?php if (isset($_POST['server_SQL_host'])) echo 'value="' . $_POST['server_SQL_host'] . '"'?>>
339
+                                <?php if (isset($_POST['server_SQL_host'])) echo 'value="'.$_POST['server_SQL_host'].'"'?>>
340 340
 
341 341
                             <label for="server_SQL_user">SQL User: </label>
342 342
                             <input placeholder="SQL User" id="server_SQL_user"
343 343
                                    class="form-control login_input" type="text" name="server_SQL_user"
344
-                                <?php if (isset($_POST['server_SQL_user'])) echo 'value="' . $_POST['server_SQL_user'] . '"'?>>
344
+                                <?php if (isset($_POST['server_SQL_user'])) echo 'value="'.$_POST['server_SQL_user'].'"'?>>
345 345
 
346 346
                             <label for="server_SQL_pass">SQL Password: </label>
347 347
                             <input placeholder="SQL Password" id="server_SQL_pass"
348 348
                                    class="form-control login_input" type="password" name="server_SQL_pass"
349
-                                <?php if (isset($_POST['server_SQL_pass'])) echo 'value="' . $_POST['server_SQL_pass'] . '"'?>>
349
+                                <?php if (isset($_POST['server_SQL_pass'])) echo 'value="'.$_POST['server_SQL_pass'].'"'?>>
350 350
 
351 351
                             <label for="server_SQL_name">SQL Database: </label>
352 352
                             <input placeholder="SQL Database Name" id="server_SQL_name"
353 353
                                    class="form-control login_input" type="text" name="server_SQL_name"
354
-                                <?php if (isset($_POST['server_SQL_name'])) echo 'value="' . $_POST['server_SQL_name'] . '"'?>>
354
+                                <?php if (isset($_POST['server_SQL_name'])) echo 'value="'.$_POST['server_SQL_name'].'"'?>>
355 355
                             <br><br>
356 356
 
357 357
                             <h4>Server Setup</h4>
358 358
                             <label for="server_name">Server name: </label>
359 359
                             <input placeholder="Server name" id="server_name"
360 360
                                    class="form-control login_input" type="text" name="server_name"
361
-                                <?php if (isset($_POST['server_name'])) echo 'value="' . $_POST['server_name'] . '"'?>>
361
+                                <?php if (isset($_POST['server_name'])) echo 'value="'.$_POST['server_name'].'"'?>>
362 362
 
363 363
                             <label for="server_type">Server type: </label>
364 364
                             <select id="server_name" class=" form-control login_input" name="server_type">
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
                             <label for="server_port">Server Query Port: </label>
376 376
                             <input placeholder="Server Query Port (Default: 2302)" id="server_port"
377 377
                                    class="form-control login_input" type="text" name="server_port"
378
-                                <?php if (isset($_POST['server_port'])) echo 'value="' . $_POST['server_port'] . '"'?>>
378
+                                <?php if (isset($_POST['server_port'])) echo 'value="'.$_POST['server_port'].'"'?>>
379 379
 
380 380
                             <label for="server_IP">Server Query IP: </label>
381 381
                             <input placeholder="Server Query IP" id="server_IP"
382 382
                                    class="form-control login_input" type="text" name="server_IP"
383
-                                <?php if (isset($_POST['server_IP'])) echo 'value="' . $_POST['server_IP'] . '"'?>>
383
+                                <?php if (isset($_POST['server_IP'])) echo 'value="'.$_POST['server_IP'].'"'?>>
384 384
 
385 385
                             <label for="server_SQL_pass">RCON Password: </label>
386 386
                             <input placeholder="RCON Password" id="server_SQL_pass"
387 387
                                    class="form-control login_input" type="password" name="server_RCON_pass"
388
-                                <?php if (isset($_POST['server_SQL_pass'])) echo 'value="' . $_POST['server_SQL_pass'] . '"'?>>
388
+                                <?php if (isset($_POST['server_SQL_pass'])) echo 'value="'.$_POST['server_SQL_pass'].'"'?>>
389 389
                             <br>
390 390
                             <input class="btn btn-lg btn-primary" style="float:right;" type="submit" name="setup"
391 391
                                    value="Setup">
Please login to merge, or discard this patch.