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