| @@ 174-183 (lines=10) @@ | ||
| 171 | * |
|
| 172 | * @throws \Exception |
|
| 173 | */ |
|
| 174 | private function checkWhiteList($remoteAddress) |
|
| 175 | { |
|
| 176 | if (isset($this->parameters[self::PARAMETER_WHITELIST_IPS])) { |
|
| 177 | $whitelistIps = explode(',', $this->parameters[self::PARAMETER_WHITELIST_IPS]); |
|
| 178 | $whitelistIps = array_map("trim", $whitelistIps); |
|
| 179 | if (!in_array($remoteAddress, $whitelistIps)) { |
|
| 180 | throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
| 181 | } |
|
| 182 | } |
|
| 183 | } |
|
| 184 | ||
| 185 | /** |
|
| 186 | * @param $remoteAddress |
|
| @@ 190-199 (lines=10) @@ | ||
| 187 | * |
|
| 188 | * @throws \Exception |
|
| 189 | */ |
|
| 190 | private function checkBlackList($remoteAddress) |
|
| 191 | { |
|
| 192 | if (isset($this->parameters[self::PARAMETER_BLACKLIST_IPS])) { |
|
| 193 | $blacklistIps = explode(',', $this->parameters[self::PARAMETER_BLACKLIST_IPS]); |
|
| 194 | $blacklistIps = array_map("trim", $blacklistIps); |
|
| 195 | if (in_array($remoteAddress, $blacklistIps)) { |
|
| 196 | throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
| 197 | } |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||
| 201 | /** |
|
| 202 | * @param $request |
|