@@ -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 | { |
@@ -106,10 +106,14 @@ discard block |
||
| 106 | 106 | if ($result_row->user_level <> 0) { |
| 107 | 107 | $verify = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/messages.php?id=' . $settings['id'])); |
| 108 | 108 | if (!isset($verify->verify)) { |
| 109 | - if ($verify->version > floatval($settings['version'])) $_SESSION['update'] = true; |
|
| 109 | + if ($verify->version > floatval($settings['version'])) { |
|
| 110 | + $_SESSION['update'] = true; |
|
| 111 | + } |
|
| 110 | 112 | $_SESSION['2factor'] = 0; |
| 111 | 113 | if (!empty($result_row->twoFactor)) { |
| 112 | - if ($settings['2factor']) $_SESSION['2factor'] = 1; else { |
|
| 114 | + if ($settings['2factor']) { |
|
| 115 | + $_SESSION['2factor'] = 1; |
|
| 116 | + } else { |
|
| 113 | 117 | $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL WHERE `userid` = '" . $result_row->user_id . "';"; |
| 114 | 118 | $this->db_connection->query($sql); |
| 115 | 119 | $this->errors[] = $lang['2factorForceRevoke']; |
@@ -131,7 +135,11 @@ discard block |
||
| 131 | 135 | $_SESSION['user_id'] = $result_row->user_id; |
| 132 | 136 | $_SESSION['steamsignon'] = false; |
| 133 | 137 | $_SESSION['permissions'] = json_decode($result_row->permissions, true); |
| 134 | - if (isset($result_row->items))$_SESSION['items'] = $result_row->items; else $_SESSION['items'] = $settings['items']; |
|
| 138 | + if (isset($result_row->items)) { |
|
| 139 | + $_SESSION['items'] = $result_row->items; |
|
| 140 | + } else { |
|
| 141 | + $_SESSION['items'] = $settings['items']; |
|
| 142 | + } |
|
| 135 | 143 | if (isset($_POST['lang'])) { |
| 136 | 144 | setcookie('lang', $_POST['lang'], time() + (3600 * 24 * 30)); |
| 137 | 145 | $_SESSION['lang'] = $_POST['lang']; |
@@ -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 @@ |
||
| 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 | /** |