Auth_OpenID_ServiceEndpoint::parseService PHP Method

parseService() public method

public parseService ( $yadis_url, $uri, $type_uris, $service_element )
    function parseService($yadis_url, $uri, $type_uris, $service_element)
    {
        // Set the state of this object based on the contents of the
        // service element.  Return true if successful, false if not
        // (if findOPLocalIdentifier returns false).
        $this->type_uris = $type_uris;
        $this->server_url = $uri;
        $this->used_yadis = true;
        if (!$this->isOPIdentifier()) {
            $this->claimed_id = $yadis_url;
            $this->local_id = Auth_OpenID_findOPLocalIdentifier($service_element, $this->type_uris);
            if ($this->local_id === false) {
                return false;
            }
        }
        return true;
    }

Usage Example

Ejemplo n.º 1
0
function Auth_OpenID_makeOpenIDEndpoints($uri, $yadis_services)
{
    $s = array();
    if (!$yadis_services) {
        return $s;
    }
    foreach ($yadis_services as $service) {
        $type_uris = $service->getTypes();
        $uris = $service->getURIs();
        // If any Type URIs match and there is an endpoint URI
        // specified, then this is an OpenID endpoint
        if ($type_uris && $uris) {
            foreach ($uris as $service_uri) {
                $openid_endpoint = new Auth_OpenID_ServiceEndpoint();
                if ($openid_endpoint->parseService($uri, $service_uri, $type_uris, $service)) {
                    $s[] = $openid_endpoint;
                }
            }
        }
    }
    return $s;
}