SimpleSAML_XHTML_IdPDisco::getFromCIDRhint PHP Method

getFromCIDRhint() protected method

Retrieve a recommended IdP based on the IP address of the client.
protected getFromCIDRhint ( ) : string | null
return string | null The entity ID of the IdP if one is found, or null if not.
    protected function getFromCIDRhint()
    {
        foreach ($this->metadataSets as $metadataSet) {
            $idp = $this->metadata->getPreferredEntityIdFromCIDRhint($metadataSet, $_SERVER['REMOTE_ADDR']);
            if (!empty($idp)) {
                return $idp;
            }
        }
        return null;
    }