@@ -68,4 +68,6 @@ |
||
68 | 68 | </div> |
69 | 69 | </div> |
70 | 70 | <?php |
71 | -} else echo errorMessage(3, $lang); |
|
72 | 71 | \ No newline at end of file |
72 | +} else { |
|
73 | + echo errorMessage(3, $lang); |
|
74 | +} |
@@ -5,16 +5,16 @@ discard block |
||
5 | 5 | $page = 1; |
6 | 6 | } |
7 | 7 | |
8 | -$max = ' LIMIT ' . ($page - 1) * $_SESSION['items'] . ',' . $_SESSION['items']; |
|
8 | +$max = ' LIMIT '.($page - 1) * $_SESSION['items'].','.$_SESSION['items']; |
|
9 | 9 | |
10 | 10 | if (isset($search)) { |
11 | - logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['database'], 1); |
|
12 | - $sql = "SELECT * FROM `db` WHERE `dbid` LIKE '" . $search . "' OR `type` LIKE '%" . $search . "%';"; //todo: name searching |
|
11 | + logAction($_SESSION['user_name'], $lang['searched'].' ('.$search.') '.$lang['in'].' '.$lang['database'], 1); |
|
12 | + $sql = "SELECT * FROM `db` WHERE `dbid` LIKE '".$search."' OR `type` LIKE '%".$search."%';"; //todo: name searching |
|
13 | 13 | $result_of_query = $db_connection->query($sql); |
14 | 14 | $total_records = mysqli_num_rows($result_of_query); |
15 | - $sql = "SELECT * FROM `db` WHERE `dbid` LIKE '" . $search . "' OR `type` LIKE '%" . $search . "%'" . $max . " ;"; |
|
15 | + $sql = "SELECT * FROM `db` WHERE `dbid` LIKE '".$search."' OR `type` LIKE '%".$search."%'".$max." ;"; |
|
16 | 16 | } else { |
17 | - $sql = "SELECT * FROM `db` " . $max . " ;"; |
|
17 | + $sql = "SELECT * FROM `db` ".$max." ;"; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $result_of_query = $db_connection->query($sql); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <table class="table table-striped table-advance table-hover"> |
35 | 35 | <h4> |
36 | 36 | <i class="fa fa-sitemap"></i> |
37 | - <?php echo " " . $lang['wantList']; ?> |
|
37 | + <?php echo " ".$lang['wantList']; ?> |
|
38 | 38 | |
39 | 39 | </h4> |
40 | 40 | <hr class="hidden-xs"> |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | <?php |
53 | 53 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
54 | 54 | echo "<tr>"; |
55 | - echo "<td class='hidden-xs'>" . $row["wantedID"] . "</td>"; |
|
56 | - echo "<td>" . $row["wantedName"] . "</td>"; |
|
57 | - echo "<td class='hidden-xs'>" . $row["wantedBounty"] . "</td>"; |
|
58 | - echo "<td class='hidden-xs'>" . yesNo($row["active"], $lang) . "</td>"; |
|
59 | - echo "<td><a class='btn btn-primary btn-xs' href='editWanted/" . $row["wantedID"] . "'>"; |
|
55 | + echo "<td class='hidden-xs'>".$row["wantedID"]."</td>"; |
|
56 | + echo "<td>".$row["wantedName"]."</td>"; |
|
57 | + echo "<td class='hidden-xs'>".$row["wantedBounty"]."</td>"; |
|
58 | + echo "<td class='hidden-xs'>".yesNo($row["active"], $lang)."</td>"; |
|
59 | + echo "<td><a class='btn btn-primary btn-xs' href='editWanted/".$row["wantedID"]."'>"; |
|
60 | 60 | echo "<i class='fa fa-pencil'></i></a></td>"; |
61 | 61 | echo "</tr>"; |
62 | 62 | }; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | if (!$db_connection->connect_errno) { |
88 | 88 | if ($login->isUserLoggedIn() == true) { |
89 | 89 | |
90 | - if ($_SESSION['multiDB'] && isset($_POST['dbid']) && isset($_POST['type'])) { |
|
90 | + if ($_SESSION['multiDB'] && isset($_POST['dbid']) && isset($_POST['type'])) { |
|
91 | 91 | $_SESSION['server_type'] = $_POST['type']; |
92 | 92 | $_SESSION['dbid'] = $_POST['dbid']; |
93 | 93 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
240 | 240 | $page = "views/life/admins.php"; |
241 | 241 | } |
242 | - } elseif ($currentPage == 'police') { |
|
242 | + } elseif ($currentPage == 'police') { |
|
243 | 243 | if ($_SESSION['permissions']['view']['player']) { |
244 | 244 | if ($query) { |
245 | 245 | $search = $url['path'][$settings['base'] + 1]; |
@@ -522,15 +522,20 @@ discard block |
||
522 | 522 | if ($settings['2factor']) { |
523 | 523 | if ($_SESSION['2factor'] == 0) { |
524 | 524 | if ($settings['force2factor'] == 'steam') { |
525 | - if (!$_SESSION['steamsignon']) $_SESSION['2factor'] == 5; |
|
526 | - } elseif ($settings['force2factor'] == 'all') $_SESSION['2factor'] == 5; |
|
525 | + if (!$_SESSION['steamsignon']) { |
|
526 | + $_SESSION['2factor'] == 5; |
|
527 | + } |
|
528 | + } elseif ($settings['force2factor'] == 'all') { |
|
529 | + $_SESSION['2factor'] == 5; |
|
530 | + } |
|
527 | 531 | $page = 'views/core/2factor.php'; |
528 | 532 | } elseif ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 3) { |
529 | 533 | if (isset($_POST['code'])) { |
530 | 534 | $sql = "SELECT `twoFactor` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
531 | 535 | $user = $db_connection->query($sql)->fetch_object(); |
532 | - if ($gauth->verifyCode($user->twoFactor, $_POST['code'])) $_SESSION['2factor'] = 2; |
|
533 | - else { |
|
536 | + if ($gauth->verifyCode($user->twoFactor, $_POST['code'])) { |
|
537 | + $_SESSION['2factor'] = 2; |
|
538 | + } else { |
|
534 | 539 | $sql = "SELECT `backup` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
535 | 540 | $user = $db_connection->query($sql)->fetch_object(); |
536 | 541 | if ($user->backup == $_POST['code']) { |
@@ -540,7 +545,9 @@ discard block |
||
540 | 545 | $page = 'views/core/2factor.php'; |
541 | 546 | } |
542 | 547 | } |
543 | - } else $page = 'views/core/2factor.php'; |
|
548 | + } else { |
|
549 | + $page = 'views/core/2factor.php'; |
|
550 | + } |
|
544 | 551 | } |
545 | 552 | } |
546 | 553 |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | foreach ($settings['plugins'] as &$plugin) { |
40 | - if (file_exists("plugins/" . $plugin . "/lang/lang.php")) { |
|
41 | - include("plugins/" . $plugin . "/lang/lang.php"); |
|
40 | + if (file_exists("plugins/".$plugin."/lang/lang.php")) { |
|
41 | + include("plugins/".$plugin."/lang/lang.php"); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | $key = 0; |
83 | 83 | foreach ($settings['plugins'] as &$plugin) { |
84 | - if (file_exists("plugins/" . $plugin . "/plugin.json")) { |
|
85 | - if (file_exists("plugins/" . $plugin . "/init.php")) { |
|
86 | - include("plugins/" . $plugin . "/init.php"); |
|
84 | + if (file_exists("plugins/".$plugin."/plugin.json")) { |
|
85 | + if (file_exists("plugins/".$plugin."/init.php")) { |
|
86 | + include("plugins/".$plugin."/init.php"); |
|
87 | 87 | } |
88 | 88 | } else { |
89 | 89 | if (array_count_values($settings['plugins']) <= 1) { |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | $_SESSION['formtoken'][1] = time(); |
113 | 113 | |
114 | 114 | if (isset($_GET['items'])) { |
115 | - if (in_array($_GET['items'],$settings['item'])) { |
|
116 | - $sql = "UPDATE `users` SET `items` = " . $_GET['items'] . " WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
|
115 | + if (in_array($_GET['items'], $settings['item'])) { |
|
116 | + $sql = "UPDATE `users` SET `items` = ".$_GET['items']." WHERE `user_id` = '".$_SESSION['user_id']."';"; |
|
117 | 117 | $db_connection->query($sql); |
118 | 118 | $_SESSION['items'] = intval($_GET['items']); |
119 | 119 | } |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | if ($query) { |
164 | 164 | $search = $url['path'][$settings['base'] + 1]; |
165 | 165 | } |
166 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
166 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
167 | 167 | $page = "views/life/messages.php"; |
168 | 168 | } else { |
169 | 169 | $err = errorMessage(5, $lang); |
170 | 170 | $page = "views/templates/error.php"; |
171 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'messages'", 3); |
|
171 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'messages'", 3); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | if ($query) { |
178 | 178 | $search = $url['path'][$settings['base'] + 1]; |
179 | 179 | } |
180 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
180 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
181 | 181 | $page = "views/life/players.php"; |
182 | 182 | } else { |
183 | 183 | $err = errorMessage(5, $lang); |
184 | 184 | $page = "views/templates/error.php"; |
185 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'players'", 3); |
|
185 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'players'", 3); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | } elseif ($currentPage == 'editplayer') { |
189 | 189 | if ($_SESSION['permissions']['edit']['player']) { |
190 | 190 | if ($query) { |
191 | 191 | $uID = $url['path'][$settings['base'] + 1]; |
192 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
192 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
193 | 193 | $page = "views/life/editPlayer.php"; |
194 | 194 | } else { |
195 | 195 | $err = errorMessage(8, $lang); |
@@ -205,19 +205,19 @@ discard block |
||
205 | 205 | if ($query) { |
206 | 206 | $search = $url['path'][$settings['base'] + 1]; |
207 | 207 | } |
208 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
208 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
209 | 209 | $page = "views/life/vehicles.php"; |
210 | 210 | } else { |
211 | 211 | $err = errorMessage(5, $lang); |
212 | 212 | $page = "views/templates/error.php"; |
213 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'vehicles'", 3); |
|
213 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'vehicles'", 3); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | } elseif ($currentPage == 'editveh') { |
217 | 217 | if ($_SESSION['permissions']['edit']['vehicles']) { |
218 | 218 | if ($query) { |
219 | 219 | $vehID = $url['path'][$settings['base'] + 1]; |
220 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
220 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
221 | 221 | $page = "views/life/editVeh.php"; |
222 | 222 | } else { |
223 | 223 | $err = errorMessage(8, $lang); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } else { |
227 | 227 | $err = errorMessage(5, $lang); |
228 | 228 | $page = "views/templates/error.php"; |
229 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'editVeh'", 3); |
|
229 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'editVeh'", 3); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | } elseif ($currentPage == 'medic') { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | if ($query) { |
235 | 235 | $search = $url['path'][$settings['base'] + 1]; |
236 | 236 | } |
237 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
237 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
238 | 238 | $page = "views/life/medics.php"; |
239 | 239 | } |
240 | 240 | } elseif ($currentPage == 'admins') { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | if ($query) { |
243 | 243 | $search = $url['path'][$settings['base'] + 1]; |
244 | 244 | } |
245 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
245 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
246 | 246 | $page = "views/life/admins.php"; |
247 | 247 | } |
248 | 248 | } elseif ($currentPage == 'police') { |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | if ($query) { |
251 | 251 | $search = $url['path'][$settings['base'] + 1]; |
252 | 252 | } |
253 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
253 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
254 | 254 | $page = "views/life/police.php"; |
255 | 255 | } else { |
256 | 256 | $err = errorMessage(5, $lang); |
257 | 257 | $page = "views/templates/error.php"; |
258 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'houses'", 3); |
|
258 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'houses'", 3); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | } elseif ($currentPage == 'houses') { |
@@ -263,19 +263,19 @@ discard block |
||
263 | 263 | if ($query) { |
264 | 264 | $search = $url['path'][$settings['base'] + 1]; |
265 | 265 | } |
266 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
266 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
267 | 267 | $page = "views/life/houses.php"; |
268 | 268 | } else { |
269 | 269 | $err = errorMessage(5, $lang); |
270 | 270 | $page = "views/templates/error.php"; |
271 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'houses'", 3); |
|
271 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'houses'", 3); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | } elseif ($currentPage == 'edithouse') { |
275 | 275 | if ($_SESSION['permissions']['edit']['houses']) { |
276 | 276 | if ($query) { |
277 | 277 | $hID = $url['path'][$settings['base'] + 1]; |
278 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
278 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
279 | 279 | $page = "views/life/editHouse.php"; |
280 | 280 | } else { |
281 | 281 | $err = errorMessage(8, $lang); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } else { |
285 | 285 | $err = errorMessage(5, $lang); |
286 | 286 | $page = "views/templates/error.php"; |
287 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'editHouse'", 3); |
|
287 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'editHouse'", 3); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | } elseif ($currentPage == 'gangs') { |
@@ -292,19 +292,19 @@ discard block |
||
292 | 292 | if ($query) { |
293 | 293 | $search = $url['path'][$settings['base'] + 1]; |
294 | 294 | } |
295 | - logAction($_SESSION['user_name'], $lang['visited'] . " 'gangs'", 1); |
|
295 | + logAction($_SESSION['user_name'], $lang['visited']." 'gangs'", 1); |
|
296 | 296 | $page = "views/life/gangs.php"; |
297 | 297 | } else { |
298 | 298 | $err = errorMessage(5, $lang); |
299 | 299 | $page = "views/templates/error.php"; |
300 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'gangs'", 3); |
|
300 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'gangs'", 3); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | } elseif ($currentPage == 'editgang') { |
304 | 304 | if ($_SESSION['permissions']['edit']['gangs']) { |
305 | 305 | if ($query) { |
306 | 306 | $gID = $url['path'][$settings['base'] + 1]; |
307 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
307 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
308 | 308 | $page = "views/life/editGang.php"; |
309 | 309 | } else { |
310 | 310 | $err = errorMessage(8, $lang); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } else { |
314 | 314 | $err = errorMessage(5, $lang); |
315 | 315 | $page = "views/templates/error.php"; |
316 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'editGang'", 3); |
|
316 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'editGang'", 3); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | } elseif ($currentPage == 'wanted') { |
@@ -321,19 +321,19 @@ discard block |
||
321 | 321 | if ($query) { |
322 | 322 | $search = $url['path'][$settings['base'] + 1]; |
323 | 323 | } |
324 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
324 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
325 | 325 | $page = "views/life/wanted.php"; |
326 | 326 | } else { |
327 | 327 | $err = errorMessage(5, $lang); |
328 | 328 | $page = "views/templates/error.php"; |
329 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'wanted'", 3); |
|
329 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'wanted'", 3); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | } elseif ($currentPage == 'editwanted') { |
333 | 333 | if ($_SESSION['permissions']['edit']['wanted']) { |
334 | 334 | if ($query) { |
335 | 335 | $wantedID = $url['path'][$settings['base'] + 1]; |
336 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
336 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
337 | 337 | $page = "views/life/editWanted.php"; |
338 | 338 | } else { |
339 | 339 | $err = errorMessage(8, $lang); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } else { |
343 | 343 | $err = errorMessage(5, $lang); |
344 | 344 | $page = "views/templates/error.php"; |
345 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'editWanted'", 3); |
|
345 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'editWanted'", 3); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } elseif ($currentPage == 'editveh') { |
355 | 355 | if ($query) { |
356 | 356 | $vehID = $url['path'][$settings['base'] + 1]; |
357 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
357 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
358 | 358 | $page = "views/steam/life/editVeh.php"; |
359 | 359 | } else { |
360 | 360 | $err = errorMessage(8, $lang); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | } elseif ($currentPage == 'edithouse') { |
364 | 364 | if ($query) { |
365 | 365 | $hID = $url['path'][$settings['base'] + 1]; |
366 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 1); |
|
366 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 1); |
|
367 | 367 | $page = "views/steam/life/editHouse.php"; |
368 | 368 | } else { |
369 | 369 | $err = errorMessage(8, $lang); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | if ($currentPage == 'newdb' || $currentPage == 'newserver' || $currentPage == 'settings' || $currentPage == 'editstaff' || $currentPage == 'staff' || $currentPage == 'pluginstore' || $currentPage == 'newuser' || $currentPage == 'logs') { |
376 | 376 | if (isset($_POST['passTest'])) { |
377 | - $sql = "SELECT user_password_hash FROM users WHERE user_id = '" . $_SESSION['user_id'] . "';"; |
|
377 | + $sql = "SELECT user_password_hash FROM users WHERE user_id = '".$_SESSION['user_id']."';"; |
|
378 | 378 | $pass = $db_connection->query($sql)->fetch_object()->user_password_hash; |
379 | 379 | if (password_verify($_POST['passTest'], $pass)) { |
380 | 380 | $_SESSION['sudo'] = time(); |
@@ -387,38 +387,38 @@ discard block |
||
387 | 387 | } else { |
388 | 388 | if ($currentPage == 'newdb') { |
389 | 389 | if ($_SESSION['permissions']['super_admin']) { |
390 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
390 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
391 | 391 | $page = "views/core/newDB.php"; |
392 | 392 | } else { |
393 | 393 | $err = errorMessage(5, $lang); |
394 | 394 | $page = "views/templates/error.php"; |
395 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'newDB'", 3); |
|
395 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'newDB'", 3); |
|
396 | 396 | } |
397 | 397 | } elseif ($currentPage == 'newserver') { |
398 | 398 | if ($_SESSION['permissions']['super_admin']) { |
399 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
399 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
400 | 400 | $page = "views/core/newServer.php"; |
401 | 401 | } else { |
402 | 402 | $err = errorMessage(5, $lang); |
403 | 403 | $page = "views/templates/error.php"; |
404 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'newServer'", 3); |
|
404 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'newServer'", 3); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | } elseif ($currentPage == 'settings') { |
408 | 408 | if ($_SESSION['permissions']['super_admin']) { |
409 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
409 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
410 | 410 | $page = "views/core/settings.php"; |
411 | 411 | } else { |
412 | 412 | $err = errorMessage(5, $lang); |
413 | 413 | $page = "views/templates/error.php"; |
414 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'settings'", 3); |
|
414 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'settings'", 3); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | } elseif ($currentPage == 'editstaff') { |
418 | 418 | if ($_SESSION['permissions']['edit']['staff']) { |
419 | 419 | if ($query) { |
420 | 420 | $uId = $url['path'][$settings['base'] + 1]; |
421 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
421 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
422 | 422 | $page = "views/core/editStaff.php"; |
423 | 423 | } else { |
424 | 424 | $err = errorMessage(8, $lang); |
@@ -426,38 +426,38 @@ discard block |
||
426 | 426 | } |
427 | 427 | } else { |
428 | 428 | $err = errorMessage(5, $lang); $page = "views/templates/error.php"; |
429 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'editStaff'", 3); |
|
429 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'editStaff'", 3); |
|
430 | 430 | } |
431 | 431 | } elseif ($currentPage == 'staff') { |
432 | 432 | if ($_SESSION['permissions']['view']['staff']) { |
433 | 433 | if ($query) { |
434 | 434 | $search = $url['path'][$settings['base'] + 1]; |
435 | 435 | } |
436 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
436 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
437 | 437 | $page = "views/core/staff.php"; |
438 | 438 | } else { |
439 | 439 | $err = errorMessage(5, $lang); $page = "views/templates/error.php"; |
440 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'staff'", 3); |
|
440 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'staff'", 3); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | } elseif ($currentPage == 'pluginstore') { |
444 | 444 | if ($_SESSION['permissions']['super_admin']) { |
445 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
445 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
446 | 446 | $page = "views/core/pluginstore.php"; |
447 | 447 | } else { |
448 | 448 | $err = errorMessage(5, $lang); $page = "views/templates/error.php"; |
449 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'pluginstore'", 3); |
|
449 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'pluginstore'", 3); |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | } elseif ($currentPage == 'newuser') { |
453 | 453 | if ($_SESSION['permissions']['edit']['staff']) { |
454 | 454 | require_once("classes/registration.php"); |
455 | 455 | $registration = new Registration(); |
456 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
456 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
457 | 457 | $page = "views/core/newUser.php"; |
458 | 458 | } else { |
459 | 459 | $err = errorMessage(5, $lang); $page = "views/templates/error.php"; |
460 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'newUser'", 3); |
|
460 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'newUser'", 3); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | } elseif ($currentPage == 'logs' && $settings['logging']) { |
@@ -465,11 +465,11 @@ discard block |
||
465 | 465 | if ($query) { |
466 | 466 | $search = $url['path'][$settings['base'] + 1]; |
467 | 467 | } |
468 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
468 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
469 | 469 | $page = "views/core/logs.php"; |
470 | 470 | } else { |
471 | 471 | $err = errorMessage(5, $lang); $page = "views/templates/error.php"; |
472 | - logAction($_SESSION['user_name'], $lang['failedAccess'] . " 'noPerm'", 3); |
|
472 | + logAction($_SESSION['user_name'], $lang['failedAccess']." 'noPerm'", 3); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | } |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | if ($_SESSION['permissions']['view']['curplayer']) { |
480 | 480 | if ($query) { |
481 | 481 | $sid = $url['path'][$settings['base'] + 1]; |
482 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
482 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
483 | 483 | $page = "views/core/curPlayers.php"; |
484 | 484 | } else { |
485 | 485 | $err = errorMessage(8, $lang); |
@@ -488,21 +488,21 @@ discard block |
||
488 | 488 | } |
489 | 489 | } elseif ($currentPage == 'servers') { |
490 | 490 | if ($_SESSION['permissions']['super_admin']) { |
491 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
491 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
492 | 492 | $page = "views/core/servers.php"; |
493 | 493 | } |
494 | 494 | } elseif ($currentPage == 'editserver') { |
495 | 495 | if ($_SESSION['permissions']['super_admin']) { |
496 | 496 | if ($query) { |
497 | 497 | $id = $url['path'][$settings['base'] + 1]; |
498 | - logAction($_SESSION['user_name'], $lang['visited'] . " '" . $currentPage . "'", 2); |
|
498 | + logAction($_SESSION['user_name'], $lang['visited']." '".$currentPage."'", 2); |
|
499 | 499 | $page = "views/core/editServer.php"; |
500 | 500 | } else {$err = errorMessage(8, $lang); $page = "views/templates/error.php"; } |
501 | 501 | } else {$err = errorMessage(5, $lang); $page = "views/templates/error.php"; } |
502 | 502 | } |
503 | 503 | foreach ($settings['plugins'] as &$plugin) { |
504 | - if (file_exists("plugins/" . $plugin . "/pageRules.php")) { |
|
505 | - include("plugins/" . $plugin . "/pageRules.php"); |
|
504 | + if (file_exists("plugins/".$plugin."/pageRules.php")) { |
|
505 | + include("plugins/".$plugin."/pageRules.php"); |
|
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
@@ -533,11 +533,11 @@ discard block |
||
533 | 533 | $page = 'views/core/2factor.php'; |
534 | 534 | } elseif ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 3) { |
535 | 535 | if (isset($_POST['code'])) { |
536 | - $sql = "SELECT `twoFactor` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
|
536 | + $sql = "SELECT `twoFactor` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';"; |
|
537 | 537 | $user = $db_connection->query($sql)->fetch_object(); |
538 | 538 | if ($gauth->verifyCode($user->twoFactor, $_POST['code'])) $_SESSION['2factor'] = 2; |
539 | 539 | else { |
540 | - $sql = "SELECT `backup` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
|
540 | + $sql = "SELECT `backup` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';"; |
|
541 | 541 | $user = $db_connection->query($sql)->fetch_object(); |
542 | 542 | if ($user->backup == $_POST['code']) { |
543 | 543 | $_SESSION['2factor'] = 2; |
@@ -18,8 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $cmd = 'ban ' . $rid . ' ' . $time . ' ' . $reason; |
20 | 20 | $answer = rcon(decrypt($server->sq_ip), decrypt($server->sq_port), decrypt($server->rcon_pass), $cmd); |
21 | - } |
|
22 | - catch (Exception $e) |
|
21 | + } catch (Exception $e) |
|
23 | 22 | { |
24 | 23 | echo $e->getMessage( ); |
25 | 24 | } |
@@ -10,13 +10,13 @@ |
||
10 | 10 | $time = clean($_POST['TIME'], "int"); |
11 | 11 | $reason = clean($_POST['REASON'], "string"); |
12 | 12 | |
13 | - $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
13 | + $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
14 | 14 | $result_of_query = $db_connection->query($sql); |
15 | 15 | if ($result_of_query->num_rows == 1) { |
16 | 16 | $server = $result_of_query->fetch_object(); |
17 | 17 | try |
18 | 18 | { |
19 | - $cmd = 'ban ' . $rid . ' ' . $time . ' ' . $reason; |
|
19 | + $cmd = 'ban '.$rid.' '.$time.' '.$reason; |
|
20 | 20 | $answer = rcon(decrypt($server->sq_ip), decrypt($server->sq_port), decrypt($server->rcon_pass), $cmd); |
21 | 21 | } |
22 | 22 | catch (Exception $e) |
@@ -18,7 +18,9 @@ discard block |
||
18 | 18 | $array = preg_split('/$\R?^/m', $out); |
19 | 19 | $playersr = array(); |
20 | 20 | |
21 | - if ($array[0] == '(0 players in total') $array = array(); |
|
21 | + if ($array[0] == '(0 players in total') { |
|
22 | + $array = array(); |
|
23 | + } |
|
22 | 24 | |
23 | 25 | for ($i = 0; $i < count($array); $i++) |
24 | 26 | { |
@@ -27,8 +29,7 @@ discard block |
||
27 | 29 | |
28 | 30 | echo json_encode($playersr); |
29 | 31 | |
30 | - } |
|
31 | - catch (Exception $e) |
|
32 | + } catch (Exception $e) |
|
32 | 33 | { |
33 | 34 | echo $e->getMessage( ); |
34 | 35 | var_dump($e); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | if (isset($_GET['sid'])) { |
6 | 6 | $sid = clean($_GET['sid'], "int"); |
7 | 7 | $db_connection = masterConnect(); |
8 | - $sql = "SELECT `sq_ip`,`sq_port`,`rcon_pass` FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
8 | + $sql = "SELECT `sq_ip`,`sq_port`,`rcon_pass` FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
9 | 9 | $result_of_query = $db_connection->query($sql); |
10 | 10 | if ($result_of_query->num_rows == 1) { |
11 | 11 | $server = $result_of_query->fetch_object(); |
@@ -20,8 +20,7 @@ |
||
20 | 20 | try |
21 | 21 | { |
22 | 22 | $answer = rcon(decrypt($server->sq_ip), decrypt($server->sq_port), decrypt($server->rcon_pass), $cmd); |
23 | - } |
|
24 | - catch (Exception $e) |
|
23 | + } catch (Exception $e) |
|
25 | 24 | { |
26 | 25 | echo $e->getMessage( ); |
27 | 26 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $rid = clean($_POST['id'], "int"); |
14 | 14 | $cmd = clean($_POST['command'], "string"); |
15 | 15 | |
16 | - $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
16 | + $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
17 | 17 | $result_of_query = $db_connection->query($sql); |
18 | 18 | if ($result_of_query->num_rows == 1) { |
19 | 19 | $server = $result_of_query->fetch_object(); |
@@ -11,18 +11,25 @@ |
||
11 | 11 | $api = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $settings['steamAPI'] . "&steamids=" . $_POST['player_id']; |
12 | 12 | $player = json_decode(file_get_contents($api), true); |
13 | 13 | $player = $player['response']; |
14 | - if (empty($player['players'])) $isAvailable = false; else { |
|
14 | + if (empty($player['players'])) { |
|
15 | + $isAvailable = false; |
|
16 | + } else { |
|
15 | 17 | $isAvailable = true; |
16 | 18 | $player = $player['players']['0']; |
17 | 19 | } |
18 | 20 | |
19 | - if (isset($isAvailable) && isset($player['personaname'])) echo json_encode(array( |
|
21 | + if (isset($isAvailable) && isset($player['personaname'])) { |
|
22 | + echo json_encode(array( |
|
20 | 23 | 'valid' => $isAvailable, |
21 | 24 | 'name' => $player['personaname'], |
22 | 25 | 'url' => $player['profileurl'] |
23 | 26 | )); |
24 | - elseif (isset($isAvailable)) echo json_encode(array( |
|
27 | + } elseif (isset($isAvailable)) { |
|
28 | + echo json_encode(array( |
|
25 | 29 | 'valid' => $isAvailable |
26 | 30 | )); |
31 | + } |
|
27 | 32 | } |
28 | -} else echo json_encode(array('valid' => false)); |
|
29 | 33 | \ No newline at end of file |
34 | +} else { |
|
35 | + echo json_encode(array('valid' => false)); |
|
36 | +} |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | if (isset($_POST['player_id']) && isset($_SESSION['user_level'])) { |
10 | 10 | if ($settings['steamAPI'] && $_SESSION['permissions']['view']['steam'] && !$settings['performance']) { |
11 | - $api = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $settings['steamAPI'] . "&steamids=" . $_POST['player_id']; |
|
11 | + $api = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$settings['steamAPI']."&steamids=".$_POST['player_id']; |
|
12 | 12 | $player = json_decode(file_get_contents($api), true); |
13 | 13 | $player = $player['response']; |
14 | 14 | if (empty($player['players'])) $isAvailable = false; else { |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("gfunctions.php"); |
3 | 3 | /** |
4 | - * Class registration |
|
5 | - * handles the user registration |
|
6 | - */ |
|
4 | + * Class registration |
|
5 | + * handles the user registration |
|
6 | + */ |
|
7 | 7 | class Registration |
8 | 8 | { |
9 | 9 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // escaping, additionally removing everything that could be (html/javascript-) code |
87 | 87 | $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES)); |
88 | 88 | $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES)); |
89 | - if(isset($_POST['player_id'])) { |
|
89 | + if (isset($_POST['player_id'])) { |
|
90 | 90 | $playerid = $this->db_connection->real_escape_string(strip_tags($_POST['player_id'], ENT_QUOTES)); |
91 | 91 | } |
92 | 92 | $user_password = $_POST['user_password_new']; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT); |
100 | 100 | |
101 | 101 | // check if user or email address already exists |
102 | - $sql = "SELECT * FROM `users` WHERE `user_name` = '" . $user_name . "' OR `user_email = '" . $user_email . "';"; |
|
102 | + $sql = "SELECT * FROM `users` WHERE `user_name` = '".$user_name."' OR `user_email = '".$user_email."';"; |
|
103 | 103 | $query_check_user_name = $this->db_connection->query($sql); |
104 | 104 | |
105 | 105 | if ($query_check_user_name->num_rows == 1) { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | if (!empty($playerid)) { |
114 | 114 | |
115 | 115 | $sql = "INSERT INTO `users` (`user_name`, `user_password_hash`, `user_email`, `playerid`, `user_level`, `permissions`, `user_profile`) VALUES |
116 | - ('" . $user_name . "', '" . $user_password_hash . "', '" . $user_email . "', '" . $playerid . "', '" . $user_lvl . "', '" . $userPerms . "', '" . $user_pic . "');"; |
|
116 | + ('" . $user_name."', '".$user_password_hash."', '".$user_email."', '".$playerid."', '".$user_lvl."', '".$userPerms."', '".$user_pic."');"; |
|
117 | 117 | } else { |
118 | 118 | $sql = "INSERT INTO `users` (`user_name`, `user_password_hash`, `user_email`, `user_level`, `permissions`, `user_profile`) VALUES |
119 | - ('" . $user_name . "', '" . $user_password_hash . "', '" . $user_email . "', '" . $user_lvl . "', '" . $userPerms . "', '" . $user_pic . "');"; |
|
119 | + ('" . $user_name."', '".$user_password_hash."', '".$user_email."', '".$user_lvl."', '".$userPerms."', '".$user_pic."');"; |
|
120 | 120 | } |
121 | 121 | $query_new_user_insert = $this->db_connection->query($sql); |
122 | 122 |
@@ -10,13 +10,17 @@ discard block |
||
10 | 10 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%';"; |
11 | 11 | $result_of_query = $db_link->query($sql); |
12 | 12 | $total_records = mysqli_num_rows($result_of_query); |
13 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
13 | + if ($pageNum > $total_records) { |
|
14 | + $pageNum = $total_records; |
|
15 | + } |
|
14 | 16 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%'" . $max . " ;"; |
15 | 17 | } else { |
16 | 18 | $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "';"; |
17 | 19 | $result_of_query = $db_link->query($sql); |
18 | 20 | $total_records = mysqli_num_rows($result_of_query); |
19 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
21 | + if ($pageNum > $total_records) { |
|
22 | + $pageNum = $total_records; |
|
23 | + } |
|
20 | 24 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' " . $max . " ;"; |
21 | 25 | } |
22 | 26 | $result_of_query = $db_link->query($sql); |
@@ -74,4 +78,6 @@ discard block |
||
74 | 78 | </table> |
75 | 79 | </div> |
76 | 80 | <?php |
77 | -} else echo errorMessage(3, $lang); |
|
78 | 81 | \ No newline at end of file |
82 | +} else { |
|
83 | + echo errorMessage(3, $lang); |
|
84 | +} |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $db_link = serverConnect(); |
3 | -$max = 'LIMIT ' . ($pageNum - 1) * $_SESSION['items'] . ',' . $_SESSION['items']; |
|
3 | +$max = 'LIMIT '.($pageNum - 1) * $_SESSION['items'].','.$_SESSION['items']; |
|
4 | 4 | |
5 | 5 | if (isset($search)) { |
6 | - logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['vehicles'], 1); |
|
7 | - $sql = "SELECT `id` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn WHERE `id` LIKE '" . $search . "' OR `pos` LIKE '$search' OR `inventory` LIKE '%$search%' OR `name` LIKE '%$search%' AND `pid` = '" . $_SESSION['playerid'] . "';"; |
|
6 | + logAction($_SESSION['user_name'], $lang['searched'].' ('.$search.') '.$lang['in'].' '.$lang['vehicles'], 1); |
|
7 | + $sql = "SELECT `id` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn WHERE `id` LIKE '".$search."' OR `pos` LIKE '$search' OR `inventory` LIKE '%$search%' OR `name` LIKE '%$search%' AND `pid` = '".$_SESSION['playerid']."';"; |
|
8 | 8 | $result_of_query = $db_link->query($sql); |
9 | 9 | $total_records = mysqli_num_rows($result_of_query); |
10 | 10 | if ($pageNum > $total_records) $pageNum = $total_records; |
11 | - $sql = "SELECT `id`,`pid`,`pos`,`name`,`owned` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn WHERE `id` LIKE '$search' OR `pos` LIKE '$search' OR `inventory` LIKE '%$search %' OR `name` LIKE '%$search%' AND `pid` = '" . $_SESSION['playerid'] . "' $max;"; |
|
11 | + $sql = "SELECT `id`,`pid`,`pos`,`name`,`owned` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn WHERE `id` LIKE '$search' OR `pos` LIKE '$search' OR `inventory` LIKE '%$search %' OR `name` LIKE '%$search%' AND `pid` = '".$_SESSION['playerid']."' $max;"; |
|
12 | 12 | } else { |
13 | 13 | $sql = "SELECT `id` FROM `houses`;"; |
14 | 14 | $result_of_query = $db_link->query($sql); |
15 | 15 | $total_records = mysqli_num_rows($result_of_query); |
16 | 16 | if ($pageNum > $total_records) $pageNum = $total_records; |
17 | - $sql = "SELECT `id`,`pid`,`pos`,`name`,`owned` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn AND `pid` = '" . $_SESSION['playerid'] . "' $max;"; |
|
17 | + $sql = "SELECT `id`,`pid`,`pos`,`name`,`owned` FROM `houses` INNER JOIN `players` ON houses.pid=players.$playerIdColumn AND `pid` = '".$_SESSION['playerid']."' $max;"; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $result_of_query = $db_link->query($sql); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <th><i class="fa fa-user"></i> <?php echo $lang['position']; ?></th> |
42 | 42 | <th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['owned']; ?></th> |
43 | 43 | <?php if ($_SESSION['permissions']['edit']['houses']) { |
44 | - echo '<th>' . $lang['edit'] . '</th>'; |
|
44 | + echo '<th>'.$lang['edit'].'</th>'; |
|
45 | 45 | } |
46 | 46 | ?> |
47 | 47 | </tr> |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | <?php |
51 | 51 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
52 | 52 | echo "<tr>"; |
53 | - echo "<td>" . $row["name"] . "</td>"; |
|
54 | - echo "<td>" . substr($row["pos"], 1, -1) . "</td>"; |
|
55 | - echo "<td class='hidden-xs'>" . yesNo($row["owned"], $lang) . "</td>"; |
|
53 | + echo "<td>".$row["name"]."</td>"; |
|
54 | + echo "<td>".substr($row["pos"], 1, -1)."</td>"; |
|
55 | + echo "<td class='hidden-xs'>".yesNo($row["owned"], $lang)."</td>"; |
|
56 | 56 | if ($_SESSION['permissions']['edit']['houses']) { |
57 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editHouse/" . $row["id"] . "'>"; |
|
57 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editHouse/".$row["id"]."'>"; |
|
58 | 58 | echo "<i class='fa fa-pencil'></i></a></td>"; |
59 | 59 | } |
60 | 60 | echo "</tr>"; |
@@ -108,7 +108,9 @@ discard block |
||
108 | 108 | //if (!isset($verify->verify)) { |
109 | 109 | $_SESSION['2factor'] = 0; |
110 | 110 | if (!empty($result_row->twoFactor)) { |
111 | - if ($settings['2factor']) $_SESSION['2factor'] = 1; else { |
|
111 | + if ($settings['2factor']) { |
|
112 | + $_SESSION['2factor'] = 1; |
|
113 | + } else { |
|
112 | 114 | $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL WHERE `userid` = '" . $result_row->user_id . "';"; |
113 | 115 | $this->db_connection->query($sql); |
114 | 116 | $this->errors[] = $lang['2factorForceRevoke']; |
@@ -130,7 +132,11 @@ discard block |
||
130 | 132 | $_SESSION['user_id'] = $result_row->user_id; |
131 | 133 | $_SESSION['steamsignon'] = false; |
132 | 134 | $_SESSION['permissions'] = json_decode($result_row->permissions, true); |
133 | - if (isset($result_row->items))$_SESSION['items'] = $result_row->items; else $_SESSION['items'] = $settings['items']; |
|
135 | + if (isset($result_row->items)) { |
|
136 | + $_SESSION['items'] = $result_row->items; |
|
137 | + } else { |
|
138 | + $_SESSION['items'] = $settings['items']; |
|
139 | + } |
|
134 | 140 | if (isset($_POST['lang'])) { |
135 | 141 | setcookie('lang', $_POST['lang'], time() + (3600 * 24 * 30)); |
136 | 142 | $_SESSION['lang'] = $_POST['lang']; |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("gfunctions.php"); |
3 | 3 | /** |
4 | - * Class login |
|
5 | - * handles the user's login and logout process |
|
6 | - */ |
|
4 | + * Class login |
|
5 | + * handles the user's login and logout process |
|
6 | + */ |
|
7 | 7 | class Login |
8 | 8 | { |
9 | 9 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | // username field) |
90 | 90 | $sql = "SELECT user_name, user_email, user_level, user_profile, permissions, user_password_hash, user_id, playerid, twoFactor, token |
91 | 91 | FROM users |
92 | - WHERE user_name = '" . $user_name . "' OR user_email = '" . $user_name . "';"; |
|
92 | + WHERE user_name = '" . $user_name."' OR user_email = '".$user_name."';"; |
|
93 | 93 | $result_of_login_check = $this->db_connection->query($sql); |
94 | 94 | |
95 | 95 | // if this user exists |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $_SESSION['2factor'] = 0; |
109 | 109 | if (!empty($result_row->twoFactor)) { |
110 | 110 | if ($settings['2factor']) $_SESSION['2factor'] = 1; else { |
111 | - $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL WHERE `userid` = '" . $result_row->user_id . "';"; |
|
111 | + $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL WHERE `userid` = '".$result_row->user_id."';"; |
|
112 | 112 | $this->db_connection->query($sql); |
113 | 113 | $this->errors[] = $lang['2factorForceRevoke']; |
114 | 114 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $_SESSION['user_login_status'] = 1; |
139 | 139 | |
140 | 140 | multiDB(); |
141 | - logAction($_SESSION['user_name'], 'Successful Login (' . $_SERVER['REMOTE_ADDR'] . ')', 2); |
|
141 | + logAction($_SESSION['user_name'], 'Successful Login ('.$_SERVER['REMOTE_ADDR'].')', 2); |
|
142 | 142 | /*} else { |
143 | 143 | if (isset($verify->message)) { |
144 | 144 | $this->errors[] = $verify->message; |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | }*/ |
149 | 149 | } else { |
150 | 150 | $this->errors[] = "User is banned."; |
151 | - logAction($_POST['user_name'], 'Login Failed - Banned User (' . $_SERVER['REMOTE_ADDR'] . ')', 3); |
|
151 | + logAction($_POST['user_name'], 'Login Failed - Banned User ('.$_SERVER['REMOTE_ADDR'].')', 3); |
|
152 | 152 | } |
153 | 153 | } else { |
154 | 154 | $this->errors[] = "Wrong password. Try again."; |
155 | - logAction($_POST['user_name'], 'Login Failed - Wrong Password (' . $_SERVER['REMOTE_ADDR'] . ')', 3); |
|
155 | + logAction($_POST['user_name'], 'Login Failed - Wrong Password ('.$_SERVER['REMOTE_ADDR'].')', 3); |
|
156 | 156 | } |
157 | 157 | } else { |
158 | 158 | $this->errors[] = "This user does not exist."; |
159 | - logAction($_POST['user_name'], 'Login Failed - Wrong Username (' . $_SERVER['REMOTE_ADDR'] . ')', 3); |
|
159 | + logAction($_POST['user_name'], 'Login Failed - Wrong Username ('.$_SERVER['REMOTE_ADDR'].')', 3); |
|
160 | 160 | } |
161 | 161 | } else { |
162 | 162 | $this->errors[] = "Database connection problem."; |