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