Passed
Branch master (334f84)
by
unknown
03:14
created
src/plugins/onTick/authCheck.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -174,68 +174,68 @@  discard block
 block discarded – undo
174 174
 
175 175
         if ($result->num_rows >= 1) {
176 176
             while ($rows = $result->fetch_assoc()) {
177
-				$charID = $rows['characterID'];
178
-				$discordID = $rows['discordID'];
179
-				$role = $rows['role'];
180
-				$member = $guild->members->get('id', $discordID);
181
-				$eveName = $rows['eveName'];
182
-				//Check if member has roles
183
-				if (null === @$member->roles) {
184
-					continue;
185
-				}
186
-
187
-				//Auth things
188
-				$character = characterDetails($charID);
189
-				//if issue with esi, skip
190
-				$timeout = 0;
191
-				while (null === $character) { //try 10 times to pull characterDetails
192
-					if ($timeout > 9) {
193
-						continue;
194
-					}
195
-					else{
196
-						$character = characterDetails($charID);
197
-						$timeout++;
198
-					}
199
-				}
200
-				$corporationID = $character['corporation_id'];
201
-				$corporationDetails = corpDetails($corporationID);
202
-				$timeout = 0;
203
-				while (null === $corporationDetails) { //try 10 times to pull corporationDetails
204
-					if ($timeout > 9) {
205
-						continue;
206
-					}
207
-					else{
208
-						$corporationDetails = corpDetails($corporationID);
209
-						$timeout++;
210
-					}
211
-				}
212
-				$allianceID = @$corporationDetails['alliance_id'];
213
-				//check if user authed based on standings
214
-				$standings = null;
215
-				if ($role === 'blue' || 'neut' || 'red') {
216
-					$allianceContacts = getContacts($allianceID);
217
-					$corpContacts = getContacts($corporationID);
218
-					if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) {
219
-						$standings = 1;
220
-					}
221
-					if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) {
222
-						$standings = 1;
223
-					}
224
-					if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) {
225
-						$standings = 1;
226
-					}
227
-				}
228
-				if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) {
229
-					// Deactivate user in database
230
-					$sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
231
-					$this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
232
-					$conn->query($sql);
233
-					continue;
234
-				}
235
-
236
-				$nextCheck = time() + 10800;
237
-				setPermCache('permsLastChecked', $nextCheck);
238
-			}
177
+                $charID = $rows['characterID'];
178
+                $discordID = $rows['discordID'];
179
+                $role = $rows['role'];
180
+                $member = $guild->members->get('id', $discordID);
181
+                $eveName = $rows['eveName'];
182
+                //Check if member has roles
183
+                if (null === @$member->roles) {
184
+                    continue;
185
+                }
186
+
187
+                //Auth things
188
+                $character = characterDetails($charID);
189
+                //if issue with esi, skip
190
+                $timeout = 0;
191
+                while (null === $character) { //try 10 times to pull characterDetails
192
+                    if ($timeout > 9) {
193
+                        continue;
194
+                    }
195
+                    else{
196
+                        $character = characterDetails($charID);
197
+                        $timeout++;
198
+                    }
199
+                }
200
+                $corporationID = $character['corporation_id'];
201
+                $corporationDetails = corpDetails($corporationID);
202
+                $timeout = 0;
203
+                while (null === $corporationDetails) { //try 10 times to pull corporationDetails
204
+                    if ($timeout > 9) {
205
+                        continue;
206
+                    }
207
+                    else{
208
+                        $corporationDetails = corpDetails($corporationID);
209
+                        $timeout++;
210
+                    }
211
+                }
212
+                $allianceID = @$corporationDetails['alliance_id'];
213
+                //check if user authed based on standings
214
+                $standings = null;
215
+                if ($role === 'blue' || 'neut' || 'red') {
216
+                    $allianceContacts = getContacts($allianceID);
217
+                    $corpContacts = getContacts($corporationID);
218
+                    if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) {
219
+                        $standings = 1;
220
+                    }
221
+                    if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) {
222
+                        $standings = 1;
223
+                    }
224
+                    if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) {
225
+                        $standings = 1;
226
+                    }
227
+                }
228
+                if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) {
229
+                    // Deactivate user in database
230
+                    $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
231
+                    $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
232
+                    $conn->query($sql);
233
+                    continue;
234
+                }
235
+
236
+                $nextCheck = time() + 10800;
237
+                setPermCache('permsLastChecked', $nextCheck);
238
+            }
239 239
         }
240 240
         $nextCheck = time() + 10800;
241 241
         setPermCache('permsLastChecked', $nextCheck);
@@ -386,17 +386,17 @@  discard block
 block discarded – undo
386 386
 
387 387
                 //corp ticker
388 388
                 if ($this->corpTickers === 'true') {
389
-					$timeout = 0;
390
-					$character = characterDetails($charID);
391
-					while (null === $character) { //try 10 times to pull characterDetails
392
-						if ($timeout > 9) {
393
-							continue;
394
-						}
395
-						else{
396
-							$character = characterDetails($charID);
397
-							$timeout++;
398
-						}
399
-					}
389
+                    $timeout = 0;
390
+                    $character = characterDetails($charID);
391
+                    while (null === $character) { //try 10 times to pull characterDetails
392
+                        if ($timeout > 9) {
393
+                            continue;
394
+                        }
395
+                        else{
396
+                            $character = characterDetails($charID);
397
+                            $timeout++;
398
+                        }
399
+                    }
400 400
                     if (!array_key_exists('corporation_id', $character)) {
401 401
                         continue;
402 402
                     }
Please login to merge, or discard this patch.