diff options
author | tailor <cygnus@janrain.com> | 2006-05-05 23:06:52 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-05-05 23:06:52 +0000 |
commit | bd787eaa44c170b48e057669428f9a5a969f5f54 (patch) | |
tree | dafec042ab52bc4ccc82c4d2edcb83c5353cbba3 | |
parent | 3460bc6c05d3ea3638a0c19adae900ab20422a3e (diff) | |
download | php-openid-bd787eaa44c170b48e057669428f9a5a969f5f54.zip php-openid-bd787eaa44c170b48e057669428f9a5a969f5f54.tar.gz php-openid-bd787eaa44c170b48e057669428f9a5a969f5f54.tar.bz2 |
[project @ Moved findDelegate into endpoint class]
-rw-r--r-- | Auth/OpenID/Discover.php | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/Auth/OpenID/Discover.php b/Auth/OpenID/Discover.php index deac7c5..5fd2aa0 100644 --- a/Auth/OpenID/Discover.php +++ b/Auth/OpenID/Discover.php @@ -49,10 +49,31 @@ class Auth_OpenID_ServiceEndpoint { $this->type_uris = $type_uris; $this->identity_url = $yadis_url; $this->server_url = $uri; - $this->delegate = findDelegate($service_element); + $this->delegate = Auth_OpenID_ServiceEndpoint::findDelegate( + $service_element); $this->used_yadis = true; } + function findDelegate($service) + { + // Extract a openid:Delegate value from a Yadis Service + // element. If no delegate is found, returns null. + + // Try to register new namespace. + $service->parser->registerNamespace('openid', + 'http://openid.net/xmlns/1.0'); + + // XXX: should this die if there is more than one delegate + // element? + $delegates = $service->getElements("openid:Delegate"); + + if ($delegates) { + return $service->parser->content($delegates[0]); + } else { + return null; + } + } + function getServerID() { // Return the identifier that should be sent as the @@ -83,25 +104,6 @@ class Auth_OpenID_ServiceEndpoint { } } -function findDelegate($service) -{ - // Extract a openid:Delegate value from a Yadis Service element. - // If no delegate is found, returns null. - - // Try to register new namespace. - $service->parser->registerNamespace('openid', - 'http://openid.net/xmlns/1.0'); - - // XXX: should this die if there is more than one delegate element? - $delegates = $service->getElements("openid:Delegate"); - - if ($delegates) { - return $service->parser->content($delegates[0]); - } else { - return null; - } -} - function filter_MatchesAnyOpenIDType(&$service) { $uris = $service->getTypes(); |