We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -42,8 +42,7 @@ discard block |
||
42 | 42 | $template->display('socialRegister.inc'); |
43 | 43 | exit; |
44 | 44 | } |
45 | - } |
|
46 | - else { |
|
45 | + } else { |
|
47 | 46 | $login = (isset($_REQUEST['login']) ? $_REQUEST['login'] : (isset($var['login']) ? $var['login'] : '')); |
48 | 47 | $password = (isset($_REQUEST['password']) ? $_REQUEST['password'] : (isset($var['password']) ? $var['password'] : '')); |
49 | 48 | |
@@ -57,8 +56,7 @@ discard block |
||
57 | 56 | $account = SmrAccount::getAccountByName($login); |
58 | 57 | if (is_object($account) && $account->checkPassword($password)) { |
59 | 58 | SmrSession::$account_id = $account->getAccountID(); |
60 | - } |
|
61 | - else { |
|
59 | + } else { |
|
62 | 60 | $msg = 'Password is incorrect!'; |
63 | 61 | header('Location: /login.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES))); |
64 | 62 | exit; |
@@ -152,49 +150,71 @@ discard block |
||
152 | 150 | //convert to array |
153 | 151 | $old = explode('-', $db->getField('array')); |
154 | 152 | //get rid of old version cookie since it isn't optimal. |
155 | - if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) $old = array(); |
|
156 | - } else $old = array(); |
|
153 | + if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
154 | + $old = array(); |
|
155 | + } |
|
156 | + } else { |
|
157 | + $old = array(); |
|
158 | + } |
|
157 | 159 | $old[0] = MULTI_CHECKING_COOKIE_VERSION; |
158 | - if (!in_array($account->getAccountID(), $old)) $old[] = $account->getAccountID(); |
|
159 | - if (sizeof($old) <= 2) $use = 'FALSE'; |
|
160 | - else $use = 'TRUE'; |
|
160 | + if (!in_array($account->getAccountID(), $old)) { |
|
161 | + $old[] = $account->getAccountID(); |
|
162 | + } |
|
163 | + if (sizeof($old) <= 2) { |
|
164 | + $use = 'FALSE'; |
|
165 | + } else { |
|
166 | + $use = 'TRUE'; |
|
167 | + } |
|
161 | 168 | //check that each value is legit and add it to db string |
162 | 169 | $new = MULTI_CHECKING_COOKIE_VERSION; |
163 | - foreach ($old as $accID) |
|
164 | - if (is_numeric($accID)) $new .= '-'.$accID; |
|
170 | + foreach ($old as $accID) { |
|
171 | + if (is_numeric($accID)) $new .= '-'.$accID; |
|
172 | + } |
|
165 | 173 | $db->query('REPLACE INTO multi_checking_cookie (account_id, array, `use`) VALUES ('.$db->escapeNumber($account->getAccountID()).', '.$db->escapeString($new).', '.$db->escapeString($use).')'); |
166 | 174 | //now we update their cookie with the newest info |
167 | 175 | setcookie('Session_Info', $new, TIME + 157680000); |
168 | 176 | |
169 | - } |
|
170 | - else { |
|
177 | + } else { |
|
171 | 178 | |
172 | 179 | //we have a cookie so we see if we add to it etc |
173 | 180 | //break cookie into array |
174 | 181 | $cookie = explode('-', $_COOKIE['Session_Info']); |
175 | 182 | //check for current version |
176 | - if ($cookie[0] != MULTI_CHECKING_COOKIE_VERSION) $cookie = array(); |
|
183 | + if ($cookie[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
184 | + $cookie = array(); |
|
185 | + } |
|
177 | 186 | $cookie[0] = MULTI_CHECKING_COOKIE_VERSION; |
178 | 187 | //add this acc to the cookie if it isn't there |
179 | - if (!in_array($account->getAccountID(), $cookie)) $cookie[] = $account->getAccountID(); |
|
188 | + if (!in_array($account->getAccountID(), $cookie)) { |
|
189 | + $cookie[] = $account->getAccountID(); |
|
190 | + } |
|
180 | 191 | |
181 | 192 | $db->query('SELECT * FROM multi_checking_cookie WHERE account_id = '.$account->getAccountID()); |
182 | 193 | if ($db->nextRecord()) { |
183 | 194 | //convert to array |
184 | 195 | $old = explode('-', $db->getField('array')); |
185 | - if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) $old = array(); |
|
186 | - } else $old = array(); |
|
196 | + if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
197 | + $old = array(); |
|
198 | + } |
|
199 | + } else { |
|
200 | + $old = array(); |
|
201 | + } |
|
187 | 202 | $old[0] = MULTI_CHECKING_COOKIE_VERSION; |
188 | 203 | //merge arrays...but keys are all different so we go through each value |
189 | - foreach ($cookie as $value) |
|
190 | - if (!in_array($value,$old)) $old[] = $value; |
|
204 | + foreach ($cookie as $value) { |
|
205 | + if (!in_array($value,$old)) $old[] = $value; |
|
206 | + } |
|
191 | 207 | |
192 | - if (sizeof($old) <= 2) $use = 'FALSE'; |
|
193 | - else $use = 'TRUE'; |
|
208 | + if (sizeof($old) <= 2) { |
|
209 | + $use = 'FALSE'; |
|
210 | + } else { |
|
211 | + $use = 'TRUE'; |
|
212 | + } |
|
194 | 213 | //check that each value is legit and add it to db string |
195 | 214 | $new = MULTI_CHECKING_COOKIE_VERSION; |
196 | - foreach ($old as $accID) |
|
197 | - if (is_numeric($accID)) $new .= '-'.$accID; |
|
215 | + foreach ($old as $accID) { |
|
216 | + if (is_numeric($accID)) $new .= '-'.$accID; |
|
217 | + } |
|
198 | 218 | $db->query('REPLACE INTO multi_checking_cookie (account_id, array, `use`) VALUES ('.$db->escapeNumber($account->getAccountID()).', '.$db->escapeString($new).', '.$db->escapeString($use).')'); |
199 | 219 | //update newest cookie |
200 | 220 | setcookie('Session_Info', $new, TIME + 157680000); |
@@ -215,7 +235,6 @@ discard block |
||
215 | 235 | |
216 | 236 | header('Location: '.$href); |
217 | 237 | exit; |
218 | -} |
|
219 | -catch(Throwable $e) { |
|
238 | +} catch(Throwable $e) { |
|
220 | 239 | handleException($e); |
221 | 240 | } |
@@ -116,11 +116,9 @@ discard block |
||
116 | 116 | echo ('<body>'); |
117 | 117 | if (empty($seq)) { |
118 | 118 | $seq = 'ASC'; |
119 | - } |
|
120 | - elseif ($seq == 'ASC') { |
|
119 | + } elseif ($seq == 'ASC') { |
|
121 | 120 | $seq = 'DESC'; |
122 | - } |
|
123 | - else { |
|
121 | + } else { |
|
124 | 122 | $seq = 'ASC'; |
125 | 123 | } |
126 | 124 | |
@@ -128,8 +126,7 @@ discard block |
||
128 | 126 | |
129 | 127 | if (!empty($order) && in_array($order,$allowedOrders)) { |
130 | 128 | $order_by = $order .' '. $seq; |
131 | - } |
|
132 | - else { |
|
129 | + } else { |
|
133 | 130 | $order_by = 'ship_type.ship_type_id'; |
134 | 131 | } |
135 | 132 | |
@@ -155,8 +152,7 @@ discard block |
||
155 | 152 | $shipArray[] = buildShipStats($db2); |
156 | 153 | } |
157 | 154 | } |
158 | - } |
|
159 | - else { |
|
155 | + } else { |
|
160 | 156 | $db->query('SELECT * |
161 | 157 | FROM ship_type |
162 | 158 | JOIN ship_type_support_hardware USING(ship_type_id) |
@@ -216,8 +212,7 @@ discard block |
||
216 | 212 | echo ('</tr>'); |
217 | 213 | } ?> |
218 | 214 | </table></div></div><?php |
219 | -} |
|
220 | -catch(Throwable $e) { |
|
215 | +} catch(Throwable $e) { |
|
221 | 216 | handleException($e); |
222 | 217 | } |
223 | 218 | |
@@ -270,12 +265,13 @@ discard block |
||
270 | 265 | $stat[] = number_format($db->getInt('cost')); |
271 | 266 | $stat[] = $db->getInt('speed'); |
272 | 267 | $stat[] = $db->getInt('hardpoint'); |
273 | - if ($db->getField('buyer_restriction') == BUYER_RESTRICTION_GOOD) |
|
274 | - $restriction = '<font color="green">Good</font>'; |
|
275 | - elseif ($db->getField('buyer_restriction') == BUYER_RESTRICTION_EVIL) |
|
276 | - $restriction = '<font color="red">Evil</font>'; |
|
277 | - else |
|
278 | - $restriction = ''; |
|
268 | + if ($db->getField('buyer_restriction') == BUYER_RESTRICTION_GOOD) { |
|
269 | + $restriction = '<font color="green">Good</font>'; |
|
270 | + } elseif ($db->getField('buyer_restriction') == BUYER_RESTRICTION_EVIL) { |
|
271 | + $restriction = '<font color="red">Evil</font>'; |
|
272 | + } else { |
|
273 | + $restriction = ''; |
|
274 | + } |
|
279 | 275 | $stat[] = $restriction; |
280 | 276 | // $stat[] = $db->getInt('lvl_needed'); |
281 | 277 | $stat[] = number_format($db->getInt('max_amount')); |
@@ -285,12 +281,13 @@ discard block |
||
285 | 281 | { |
286 | 282 | if($db->nextRecord()) |
287 | 283 | { |
288 | - if ($hardware_id < 7) |
|
289 | - $stat[] = number_format($db->getInt('max_amount')); |
|
290 | - elseif ($db->getInt('max_amount') == 1) |
|
291 | - $stat[] = 'Yes'; |
|
292 | - else |
|
293 | - $stat[] = ''; |
|
284 | + if ($hardware_id < 7) { |
|
285 | + $stat[] = number_format($db->getInt('max_amount')); |
|
286 | + } elseif ($db->getInt('max_amount') == 1) { |
|
287 | + $stat[] = 'Yes'; |
|
288 | + } else { |
|
289 | + $stat[] = ''; |
|
290 | + } |
|
294 | 291 | } |
295 | 292 | $hardware_id++; |
296 | 293 | } |
@@ -37,7 +37,6 @@ |
||
37 | 37 | |
38 | 38 | |
39 | 39 | header('Location: /login.php'); |
40 | -} |
|
41 | -catch(Throwable $e) { |
|
40 | +} catch(Throwable $e) { |
|
42 | 41 | handleException($e); |
43 | 42 | } |
@@ -26,7 +26,6 @@ |
||
26 | 26 | exit; |
27 | 27 | } |
28 | 28 | |
29 | -} |
|
30 | -catch(Throwable $e) { |
|
29 | +} catch(Throwable $e) { |
|
31 | 30 | handleException($e); |
32 | 31 | } |
@@ -46,8 +46,7 @@ |
||
46 | 46 | 'links' => $links, |
47 | 47 | ]); |
48 | 48 | |
49 | -} |
|
50 | -catch(Throwable $e) { |
|
49 | +} catch(Throwable $e) { |
|
51 | 50 | handleException($e); |
52 | 51 | } |
53 | 52 | ?> |
@@ -25,10 +25,11 @@ discard block |
||
25 | 25 | 'USING_AJAX: '.(defined('USING_AJAX')?var_export(USING_AJAX,true):'undefined'); |
26 | 26 | |
27 | 27 | try { |
28 | - if(function_exists('release_lock')) |
|
29 | - release_lock(); //Try to release lock so they can carry on normally |
|
30 | - } |
|
31 | - catch(Throwable $ee) { |
|
28 | + if(function_exists('release_lock')) { |
|
29 | + release_lock(); |
|
30 | + } |
|
31 | + //Try to release lock so they can carry on normally |
|
32 | + } catch(Throwable $ee) { |
|
32 | 33 | $message .= EOL.EOL.'-----------'.EOL.EOL. |
33 | 34 | 'Releasing Lock Failed' .EOL. |
34 | 35 | 'Message: ' . $ee .EOL.EOL; |
@@ -90,8 +91,9 @@ discard block |
||
90 | 91 | |
91 | 92 | // If this is an ajax update, we don't really have a way to redirect |
92 | 93 | // to an error page at this time, so we just quit. |
93 | - if(!defined('USING_AJAX')||!USING_AJAX) |
|
94 | - header('location: /error.php?msg='.urlencode($errorType)); |
|
94 | + if(!defined('USING_AJAX')||!USING_AJAX) { |
|
95 | + header('location: /error.php?msg='.urlencode($errorType)); |
|
96 | + } |
|
95 | 97 | exit; |
96 | 98 | } |
97 | 99 |
@@ -15,7 +15,6 @@ |
||
15 | 15 | // redirect to the in-game loader (bypassing the server closure). |
16 | 16 | SmrSession::destroy(); |
17 | 17 | require_once(ENGINE . 'Default/login.inc'); |
18 | -} |
|
19 | -catch(Throwable $e) { |
|
18 | +} catch(Throwable $e) { |
|
20 | 19 | handleException($e); |
21 | 20 | } |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | if(!USING_AJAX) { |
69 | 69 | require_once(get_file_loc('smr.inc')); |
70 | 70 | create_error('Your browser lost the SN. Try to reload the page!'); |
71 | + } else { |
|
72 | + exit; |
|
71 | 73 | } |
72 | - else |
|
73 | - exit; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // do we have such a container object in the db? |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | if(!USING_AJAX) { |
79 | 79 | require_once(get_file_loc('smr.inc')); |
80 | 80 | create_error('Please avoid using the back button!'); |
81 | + } else { |
|
82 | + exit; |
|
81 | 83 | } |
82 | - else |
|
83 | - exit; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // Determine where to load game scripts from (in case we need a special |
@@ -88,9 +88,15 @@ discard block |
||
88 | 88 | // Must not call `get_file_loc` until after we have set $overrideGameID |
89 | 89 | // (unless we're exiting immediately with an error, as above). |
90 | 90 | $overrideGameID = 0; |
91 | - if (isset($var['game_id']) && is_numeric($var['game_id'])) $overrideGameID = $var['game_id']; |
|
92 | - if ($overrideGameID == 0 && isset($var['GameID']) && is_numeric($var['GameID'])) $overrideGameID = $var['GameID']; |
|
93 | - if($overrideGameID == 0) $overrideGameID = SmrSession::getGameID(); |
|
91 | + if (isset($var['game_id']) && is_numeric($var['game_id'])) { |
|
92 | + $overrideGameID = $var['game_id']; |
|
93 | + } |
|
94 | + if ($overrideGameID == 0 && isset($var['GameID']) && is_numeric($var['GameID'])) { |
|
95 | + $overrideGameID = $var['GameID']; |
|
96 | + } |
|
97 | + if($overrideGameID == 0) { |
|
98 | + $overrideGameID = SmrSession::getGameID(); |
|
99 | + } |
|
94 | 100 | |
95 | 101 | require_once(get_file_loc('smr.inc')); |
96 | 102 | |
@@ -106,22 +112,19 @@ discard block |
||
106 | 112 | } else { |
107 | 113 | forward(create_container('skeleton.php', 'invalid_email.php')); |
108 | 114 | } |
109 | - } |
|
110 | - else if ($disabled['Reason'] == CLOSE_ACCOUNT_BY_REQUEST_REASON) { |
|
115 | + } else if ($disabled['Reason'] == CLOSE_ACCOUNT_BY_REQUEST_REASON) { |
|
111 | 116 | if (isset($var['do_reopen_account'])) { |
112 | 117 | // The user has requested to reopen their account |
113 | 118 | $account->unbanAccount($account); |
114 | 119 | } else { |
115 | 120 | forward(create_container('skeleton.php', 'reopen_account.php')); |
116 | 121 | } |
117 | - } |
|
118 | - else { |
|
122 | + } else { |
|
119 | 123 | forward(create_container('disabled.php')); |
120 | 124 | } |
121 | 125 | } |
122 | 126 | |
123 | 127 | do_voodoo(); |
124 | -} |
|
125 | -catch(Throwable $e) { |
|
128 | +} catch(Throwable $e) { |
|
126 | 129 | handleException($e); |
127 | 130 | } |
@@ -2,7 +2,9 @@ |
||
2 | 2 | |
3 | 3 | $fn_game = function ($message) { |
4 | 4 | $link = new GameLink($message->channel, $message->author); |
5 | - if (!$link->valid) return; |
|
5 | + if (!$link->valid) { |
|
6 | + return; |
|
7 | + } |
|
6 | 8 | |
7 | 9 | $game = SmrGame::getGame($link->player->getGameID(), true); |
8 | 10 | $msg = "I am linked to game `".$game->getDisplayName()."` in this channel."; |