private function validateIp() { if (!$this->matchIp2()) { return; } // no need to match the IP $ip_to_match = $this->getPartner()->getMatchIp(); if (!$ip_to_match) { return; } // althogh the service requires the match - the partner didn't specify the ip prefix. $user_ip = null; if (!requestUtils::validateIp($ip_to_match, $user_ip)) { $this->addException(APIErrors::ACCESS_FORBIDDEN_FROM_UNKNOWN_IP, $user_ip); } }