@@ -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); |
@@ -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 | } |
@@ -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 | +} |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * PHP Class for quickly securing forms against CSRF attacks |
|
4 | - * |
|
5 | - * @author Sam Collins |
|
6 | - * @copyright 2015 Sam Collins |
|
7 | - * @link https://gist.github.com/MightySCollins/0096d193fdc4160565b3 |
|
8 | - */ |
|
3 | + * PHP Class for quickly securing forms against CSRF attacks |
|
4 | + * |
|
5 | + * @author Sam Collins |
|
6 | + * @copyright 2015 Sam Collins |
|
7 | + * @link https://gist.github.com/MightySCollins/0096d193fdc4160565b3 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | class formToken |
11 | 11 | { |
@@ -86,7 +86,7 @@ |
||
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']; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $settings['2factor'] = true; |
18 | 18 | $settings['force2factor'] = 'none'; |
19 | 19 | $settings['version'] = 0.4; |
20 | - $settings['item'] = array(5,10,15,25,50); |
|
20 | + $settings['item'] = array(5, 10, 15, 25, 50); |
|
21 | 21 | file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';'); |
22 | 22 | $updated = true; |
23 | 23 | } |
@@ -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 GuestReg |
8 | 8 | { |
9 | 9 | /** |
@@ -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 | +} |
@@ -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 | } |