| @@ 181-200 (lines=20) @@ | ||
| 178 | return $return; |
|
| 179 | } |
|
| 180 | ||
| 181 | private function getCharacterDetails($charID, $retries = 3) |
|
| 182 | { |
|
| 183 | if (isset($this->characterCache[$charID])) { |
|
| 184 | return $this->characterCache[$charID]; |
|
| 185 | } |
|
| 186 | $character = null; |
|
| 187 | for ($i = 0; $i < $retries; $i++) { |
|
| 188 | $character = characterDetails($charID); |
|
| 189 | if (!is_null($character)) { |
|
| 190 | break; |
|
| 191 | } |
|
| 192 | } |
|
| 193 | if (!$character || isset($character['error'])) { |
|
| 194 | $this->logger->addInfo('AuthCheck: characterDetails lookup failed.'); |
|
| 195 | $msg = isset($character['error']) ? $character['error'] : 'characterDetails lookup failed'; |
|
| 196 | throw new Exception($msg); |
|
| 197 | } |
|
| 198 | $this->characterCache[$charID] = $character; |
|
| 199 | return $character; |
|
| 200 | } |
|
| 201 | ||
| 202 | private function isMemberInValidAlliance($member) |
|
| 203 | { |
|
| @@ 216-235 (lines=20) @@ | ||
| 213 | return $return; |
|
| 214 | } |
|
| 215 | ||
| 216 | private function getCorpDetails($corpID, $retries = 3) |
|
| 217 | { |
|
| 218 | if (isset($this->corpCache[$corpID])) { |
|
| 219 | return $this->corpCache[$corpID]; |
|
| 220 | } |
|
| 221 | $corporationDetails = null; |
|
| 222 | for ($i = 0; $i < $retries; $i++) { |
|
| 223 | $corporationDetails = corpDetails($corpID); |
|
| 224 | if (!is_null($corporationDetails)) { |
|
| 225 | break; |
|
| 226 | } |
|
| 227 | } |
|
| 228 | if (!$corporationDetails || isset($corporationDetails['error'])) { |
|
| 229 | $this->logger->addInfo('AuthCheck: corpDetails lookup failed.'); |
|
| 230 | $msg = isset($corporationDetails['error']) ? $corporationDetails['error'] : 'corpDetails lookup failed'; |
|
| 231 | throw new Exception($msg); |
|
| 232 | } |
|
| 233 | $this->corpCache[$corpID] = $corporationDetails; |
|
| 234 | return $corporationDetails; |
|
| 235 | } |
|
| 236 | ||
| 237 | private function isMemberCorpOrAllianceContact($member) |
|
| 238 | { |
|