Passed
Pull Request — master (#198)
by
unknown
02:52
created
src/plugins/onTick/evemails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
         $cacheClr = $baseUnix - 13500;
113 113
 
114 114
         //Set timer for next key based on number of keys
115
-        $nextKey = (1900 / (int)$this->numberOfKeys) + time();
115
+        $nextKey = (1900 / (int) $this->numberOfKeys) + time();
116 116
         $nextKeyTime = gmdate('Y-m-d H:i:s', $nextKey);
117 117
         setPermCache('mailLastChecked', $nextKey);
118 118
 
Please login to merge, or discard this patch.
src/plugins/onTick/notifications.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
                 $this->fuelChannel = $this->toDiscordChannel;
126 126
             }
127 127
             //Set timer for next key based on number of keys
128
-            $nextKey = (1900 / (int)$this->numberOfKeys) + time();
128
+            $nextKey = (1900 / (int) $this->numberOfKeys) + time();
129 129
             $nextKeyTime = gmdate('Y-m-d H:i:s', $nextKey);
130 130
             setPermCache('notificationsLastChecked', $nextKey);
131 131
             //Set cache timer for api key
Please login to merge, or discard this patch.
src/plugins/admin/setAvatar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
             $roles = $member->roles;
72 72
             foreach ($roles as $role) {
73 73
                 if (in_array(strtolower($role->name), $adminRoles, true)) {
74
-                    $avatarURL = strtolower((string)$data['messageString']);
74
+                    $avatarURL = strtolower((string) $data['messageString']);
75 75
                     $ch = curl_init($avatarURL);
76 76
                     if (substr($avatarURL, -4) === '.jpg') {
77 77
                         $fp = fopen('/tmp/avatar.jpg', 'wb');
Please login to merge, or discard this patch.
src/plugins/onMessage/motd.php 1 patch
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -25,80 +25,80 @@
 block discarded – undo
25 25
 /**
26 26
  * @property  message
27 27
  */
28
-	class motd {
29
-		public $config;
30
-		public $discord;
31
-		public $logger;
32
-		public $message;
33
-		private $excludeChannel;
34
-		private $triggers;
35
-		public function init($config, $discord, $logger) {
36
-			$this->config = $config;
37
-			$this->discord = $discord;
38
-			$this->logger = $logger;
39
-			$this->excludeChannel = $this->config['bot']['restrictedChannels'];
40
-			$this->triggers[] = $this->config['bot']['trigger'] . 'motd';
41
-			$this->triggers[] = $this->config['bot']['trigger'] . 'Motd';
42
-			$this->triggers[] = $this->config['bot']['trigger'] . 'MOTD';
43
-			$this->keyID = $config['plugins']['motd']['keyID'];
44
-			$this->vCode = $config['plugins']['motd']['vCode'];
45
-			$this->characterID = $config['plugins']['motd']['characterID'];
46
-			$this->channelname = $config['plugins']['motd']['channelname'];
47
-		}
48
-		public function onMessage($msgData, $message) {
49
-			$channelID = (int) $msgData['message']['channelID'];
50
-			if (in_array($channelID, $this->excludeChannel, true)) {
51
-				return null;
52
-			}
53
-			$this->message = $message;
54
-			$user = $msgData['message']['from'];
55
-			$message = $msgData['message']['message'];
56
-			$data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']);
57
-			if (isset($data['trigger'])) {
58
-				$keyID = $this->keyID;
59
-				$vCode = $this->vCode;
60
-				$characterID = $this->characterID;
61
-				$channelname = $this->channelname;
28
+    class motd {
29
+        public $config;
30
+        public $discord;
31
+        public $logger;
32
+        public $message;
33
+        private $excludeChannel;
34
+        private $triggers;
35
+        public function init($config, $discord, $logger) {
36
+            $this->config = $config;
37
+            $this->discord = $discord;
38
+            $this->logger = $logger;
39
+            $this->excludeChannel = $this->config['bot']['restrictedChannels'];
40
+            $this->triggers[] = $this->config['bot']['trigger'] . 'motd';
41
+            $this->triggers[] = $this->config['bot']['trigger'] . 'Motd';
42
+            $this->triggers[] = $this->config['bot']['trigger'] . 'MOTD';
43
+            $this->keyID = $config['plugins']['motd']['keyID'];
44
+            $this->vCode = $config['plugins']['motd']['vCode'];
45
+            $this->characterID = $config['plugins']['motd']['characterID'];
46
+            $this->channelname = $config['plugins']['motd']['channelname'];
47
+        }
48
+        public function onMessage($msgData, $message) {
49
+            $channelID = (int) $msgData['message']['channelID'];
50
+            if (in_array($channelID, $this->excludeChannel, true)) {
51
+                return null;
52
+            }
53
+            $this->message = $message;
54
+            $user = $msgData['message']['from'];
55
+            $message = $msgData['message']['message'];
56
+            $data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']);
57
+            if (isset($data['trigger'])) {
58
+                $keyID = $this->keyID;
59
+                $vCode = $this->vCode;
60
+                $characterID = $this->characterID;
61
+                $channelname = $this->channelname;
62 62
 
63 63
         $urlChar = "https://api.eveonline.com/char/ChatChannels.xml.aspx?keyID=$keyID&vCode=$vCode&characterID=$characterID";
64
-				$data = file_get_contents($urlChar);
65
-				$list = new SimpleXMLElement($data);
64
+                $data = file_get_contents($urlChar);
65
+                $list = new SimpleXMLElement($data);
66 66
 				
67 67
 				
68
-				foreach ($list->result->rowset->row as $row) {
69
-					$channeln = $row["displayName"];
68
+                foreach ($list->result->rowset->row as $row) {
69
+                    $channeln = $row["displayName"];
70 70
 					
71
-					if ($channeln == $channelname) {
72
-					//scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too
73
-					$comment = $row["motd"];
74
-          $comment = str_replace("<BR>", "\n", $comment);
75
-          $comment = str_replace("<br>", "\n", $comment);
76
-          $comment = str_replace("<u>", "__", $comment);
77
-          $comment = str_replace("</u>", "__", $comment);	
78
-          $comment = str_replace("<b>", "**", $comment);	
79
-          $comment = str_replace("</b>", "**", $comment);	
80
-          $comment = str_replace("<i>", "*", $comment);	
81
-          $comment = str_replace("</i>", "*", $comment);
82
-					$comment = str_replace("&amp;", "&", $comment);
83
-          $comment = strip_tags($comment);
84
-					$comment2 = str_split($comment, 1900);
71
+                    if ($channeln == $channelname) {
72
+                    //scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too
73
+                    $comment = $row["motd"];
74
+            $comment = str_replace("<BR>", "\n", $comment);
75
+            $comment = str_replace("<br>", "\n", $comment);
76
+            $comment = str_replace("<u>", "__", $comment);
77
+            $comment = str_replace("</u>", "__", $comment);	
78
+            $comment = str_replace("<b>", "**", $comment);	
79
+            $comment = str_replace("</b>", "**", $comment);	
80
+            $comment = str_replace("<i>", "*", $comment);	
81
+            $comment = str_replace("</i>", "*", $comment);
82
+                    $comment = str_replace("&amp;", "&", $comment);
83
+            $comment = strip_tags($comment);
84
+                    $comment2 = str_split($comment, 1900);
85 85
 					
86
-					$this->message->reply("\n $comment2[0]");
87
-						if (!empty($comment2[1])) {
88
-							$this->message->reply("\n $comment2[1]");
89
-						}
90
-						if (!empty($comment2[2])) {
91
-							$this->message->reply("\n $comment2[2]");
92
-						}
93
-						if (!empty($comment2[3])) {
94
-							$this->message->reply("\n $comment2[3]");
95
-						}
96
-					}
97
-				}
98
-			}
99
-		}
100
-		public function information() {
86
+                    $this->message->reply("\n $comment2[0]");
87
+                        if (!empty($comment2[1])) {
88
+                            $this->message->reply("\n $comment2[1]");
89
+                        }
90
+                        if (!empty($comment2[2])) {
91
+                            $this->message->reply("\n $comment2[2]");
92
+                        }
93
+                        if (!empty($comment2[3])) {
94
+                            $this->message->reply("\n $comment2[3]");
95
+                        }
96
+                    }
97
+                }
98
+            }
99
+        }
100
+        public function information() {
101 101
             return array('name' => 'motd', 'trigger' => $this->triggers, 'information' => 'Displays the MOTD, useful for seeing information displayed there when not in-game.');
102
-		}
103
-	}
102
+        }
103
+    }
104 104
 ?>
Please login to merge, or discard this patch.
Dramiel.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
 //Check we are not running on a 32bit platform
58 58
 if(PHP_INT_SIZE == 4)
59 59
 {
60
-	$logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP');
61
-	die();
60
+    $logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP');
61
+    die();
62 62
 }
63 63
 
64 64
 // Require the config
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 GLOBAL $logger;
56 56
 
57 57
 //Check we are not running on a 32bit platform
58
-if(PHP_INT_SIZE == 4)
58
+if (PHP_INT_SIZE == 4)
59 59
 {
60 60
 	$logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP');
61 61
 	die();
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                         clearQueuedMessages($id);
207 207
                         continue;
208 208
                     }
209
-                    $channel = $guild->channels->get('id', (int)$queuedMessage['channel']);
209
+                    $channel = $guild->channels->get('id', (int) $queuedMessage['channel']);
210 210
                     //Check if channel is bad
211 211
                     if (null === $channel) {
212 212
                         $logger->addInfo("QueueProcessing Error- Item #{$id} : Channel provided is incorrect, removing it from the queue");
Please login to merge, or discard this patch.
src/plugins/onTick/getKillmails.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
             if ($kmGroup['startMail'] > $killID || null === $killID) {
94 94
                 $killID = $kmGroup['startMail'];
95 95
             }
96
-            if ((string)$kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'true') {
96
+            if ((string) $kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'true') {
97 97
                 $url = "https://zkillboard.com/api/corporationID/{$kmGroup['corpID']}/no-attackers/no-items/orderDirection/asc/afterKillID/{$killID}/";
98 98
             }
99
-            if ((string)$kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'false') {
99
+            if ((string) $kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'false') {
100 100
                 $url = "https://zkillboard.com/api/corporationID/{$kmGroup['corpID']}/no-attackers/no-items/kills/orderDirection/asc/afterKillID/{$killID}/";
101 101
             }
102
-            if ((string)$kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'true') {
102
+            if ((string) $kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'true') {
103 103
                 $url = "https://zkillboard.com/api/allianceID/{$kmGroup['allianceID']}/no-attackers/no-items/orderDirection/asc/afterKillID/{$killID}/";
104 104
             }
105
-            if ((string)$kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'false') {
105
+            if ((string) $kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'false') {
106 106
                 $url = "https://zkillboard.com/api/allianceID/{$kmGroup['allianceID']}/no-attackers/no-items/kills/orderDirection/asc/afterKillID/{$killID}/";
107 107
             }
108 108
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 if ($i < 10) {
198 198
                     $killID = $kill['killID'];
199 199
                     //check if mail is old
200
-                    if ((int)$killID <= (int)$oldID) {
200
+                    if ((int) $killID <= (int) $oldID) {
201 201
                         continue;
202 202
                     }
203 203
                     //save highest killID for cache
Please login to merge, or discard this patch.
src/plugins/onTick/authCheck.php 3 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -174,18 +174,18 @@  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);
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 189
 
190 190
                 //Postpone check if ESI is down to prevent timeouts
191 191
                 if (@$character['error'] === 'The datasource tranquility is temporarily unavailable') {
@@ -195,56 +195,56 @@  discard block
 block discarded – undo
195 195
                     return null;
196 196
                 }
197 197
                 
198
-				//if issue with esi, skip
199
-				$timeout = 0;
198
+                //if issue with esi, skip
199
+                $timeout = 0;
200 200
                 while (null === @$character['corporation_id']) { //try 10 times to pull characterDetails
201 201
                     if ($timeout > 3) {
202
-						continue;
203
-					}
204
-					else{
205
-						$character = characterDetails($charID);
206
-						$timeout++;
207
-					}
208
-				}
209
-				$corporationID = $character['corporation_id'];
210
-				$corporationDetails = corpDetails($corporationID);
211
-				$timeout = 0;
212
-				while (null === $corporationDetails) { //try 10 times to pull corporationDetails
213
-					if ($timeout > 9) {
214
-						continue;
215
-					}
216
-					else{
217
-						$corporationDetails = corpDetails($corporationID);
218
-						$timeout++;
219
-					}
220
-				}
221
-				$allianceID = @$corporationDetails['alliance_id'];
222
-				//check if user authed based on standings
223
-				$standings = null;
224
-				if ($role === 'blue' || 'neut' || 'red') {
225
-					$allianceContacts = getContacts($allianceID);
226
-					$corpContacts = getContacts($corporationID);
227
-					if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) {
228
-						$standings = 1;
229
-					}
230
-					if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) {
231
-						$standings = 1;
232
-					}
233
-					if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) {
234
-						$standings = 1;
235
-					}
236
-				}
237
-				if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) {
238
-					// Deactivate user in database
239
-					$sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
240
-					$this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
241
-					$conn->query($sql);
242
-					continue;
243
-				}
244
-
245
-				$nextCheck = time() + 10800;
246
-				setPermCache('permsLastChecked', $nextCheck);
247
-			}
202
+                        continue;
203
+                    }
204
+                    else{
205
+                        $character = characterDetails($charID);
206
+                        $timeout++;
207
+                    }
208
+                }
209
+                $corporationID = $character['corporation_id'];
210
+                $corporationDetails = corpDetails($corporationID);
211
+                $timeout = 0;
212
+                while (null === $corporationDetails) { //try 10 times to pull corporationDetails
213
+                    if ($timeout > 9) {
214
+                        continue;
215
+                    }
216
+                    else{
217
+                        $corporationDetails = corpDetails($corporationID);
218
+                        $timeout++;
219
+                    }
220
+                }
221
+                $allianceID = @$corporationDetails['alliance_id'];
222
+                //check if user authed based on standings
223
+                $standings = null;
224
+                if ($role === 'blue' || 'neut' || 'red') {
225
+                    $allianceContacts = getContacts($allianceID);
226
+                    $corpContacts = getContacts($corporationID);
227
+                    if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) {
228
+                        $standings = 1;
229
+                    }
230
+                    if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) {
231
+                        $standings = 1;
232
+                    }
233
+                    if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) {
234
+                        $standings = 1;
235
+                    }
236
+                }
237
+                if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) {
238
+                    // Deactivate user in database
239
+                    $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
240
+                    $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
241
+                    $conn->query($sql);
242
+                    continue;
243
+                }
244
+
245
+                $nextCheck = time() + 10800;
246
+                setPermCache('permsLastChecked', $nextCheck);
247
+            }
248 248
         }
249 249
         $nextCheck = time() + 10800;
250 250
         setPermCache('permsLastChecked', $nextCheck);
@@ -395,17 +395,17 @@  discard block
 block discarded – undo
395 395
 
396 396
                 //corp ticker
397 397
                 if ($this->corpTickers === 'true') {
398
-					$timeout = 0;
399
-					$character = characterDetails($charID);
400
-					while (null === $character) { //try 10 times to pull characterDetails
401
-						if ($timeout > 9) {
402
-							continue;
403
-						}
404
-						else{
405
-							$character = characterDetails($charID);
406
-							$timeout++;
407
-						}
408
-					}
398
+                    $timeout = 0;
399
+                    $character = characterDetails($charID);
400
+                    while (null === $character) { //try 10 times to pull characterDetails
401
+                        if ($timeout > 9) {
402
+                            continue;
403
+                        }
404
+                        else{
405
+                            $character = characterDetails($charID);
406
+                            $timeout++;
407
+                        }
408
+                    }
409 409
                     if (!array_key_exists('corporation_id', $character)) {
410 410
                         continue;
411 411
                     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                     if ($timeout > 3) {
202 202
 						continue;
203 203
 					}
204
-					else{
204
+					else {
205 205
 						$character = characterDetails($charID);
206 206
 						$timeout++;
207 207
 					}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 					if ($timeout > 9) {
214 214
 						continue;
215 215
 					}
216
-					else{
216
+					else {
217 217
 						$corporationDetails = corpDetails($corporationID);
218 218
 						$timeout++;
219 219
 					}
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 						if ($timeout > 9) {
402 402
 							continue;
403 403
 						}
404
-						else{
404
+						else {
405 405
 							$character = characterDetails($charID);
406 406
 							$timeout++;
407 407
 						}
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -200,8 +200,7 @@  discard block
 block discarded – undo
200 200
                 while (null === @$character['corporation_id']) { //try 10 times to pull characterDetails
201 201
                     if ($timeout > 3) {
202 202
 						continue;
203
-					}
204
-					else{
203
+					} else{
205 204
 						$character = characterDetails($charID);
206 205
 						$timeout++;
207 206
 					}
@@ -212,8 +211,7 @@  discard block
 block discarded – undo
212 211
 				while (null === $corporationDetails) { //try 10 times to pull corporationDetails
213 212
 					if ($timeout > 9) {
214 213
 						continue;
215
-					}
216
-					else{
214
+					} else{
217 215
 						$corporationDetails = corpDetails($corporationID);
218 216
 						$timeout++;
219 217
 					}
@@ -400,8 +398,7 @@  discard block
 block discarded – undo
400 398
 					while (null === $character) { //try 10 times to pull characterDetails
401 399
 						if ($timeout > 9) {
402 400
 							continue;
403
-						}
404
-						else{
401
+						} else{
405 402
 							$character = characterDetails($charID);
406 403
 							$timeout++;
407 404
 						}
Please login to merge, or discard this patch.