| @@ 187-196 (lines=10) @@ | ||
| 184 | * @param $remoteAddress |
|
| 185 | * @throws \Exception |
|
| 186 | */ |
|
| 187 | private function checkWhiteList($remoteAddress) |
|
| 188 | { |
|
| 189 | if (isset($this->parameters[self::PARAMETER_WHITELIST_IPS])) { |
|
| 190 | $whitelistIps = explode(',', $this->parameters[self::PARAMETER_WHITELIST_IPS]); |
|
| 191 | $whitelistIps = array_map("trim", $whitelistIps); |
|
| 192 | if (!in_array($remoteAddress, $whitelistIps)) { |
|
| 193 | throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
| 194 | } |
|
| 195 | } |
|
| 196 | } |
|
| 197 | ||
| 198 | /** |
|
| 199 | * @param $remoteAddress |
|
| @@ 202-211 (lines=10) @@ | ||
| 199 | * @param $remoteAddress |
|
| 200 | * @throws \Exception |
|
| 201 | */ |
|
| 202 | private function checkBlackList($remoteAddress) |
|
| 203 | { |
|
| 204 | if (isset($this->parameters[self::PARAMETER_BLACKLIST_IPS])) { |
|
| 205 | $blacklistIps = explode(',', $this->parameters[self::PARAMETER_BLACKLIST_IPS]); |
|
| 206 | $blacklistIps = array_map("trim", $blacklistIps); |
|
| 207 | if (in_array($remoteAddress, $blacklistIps)) { |
|
| 208 | throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
| 209 | } |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||
| 213 | /** |
|
| 214 | * @param $request |
|