diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-12-15 20:07:48 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-12-15 20:07:48 -0500 |
commit | 580cd62f0a4fac5dba37a8a152afaecd99e8c767 (patch) | |
tree | ad71f414174ffe91536ecb9875377ce2682b53fc /models/Auth/Yadis/XRIRes.php | |
parent | d9bf22a0e29c2a70049443a0ae8521a2c0492c8b (diff) | |
download | elgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.gz elgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.bz2 |
removed old libraries - depends on openid_api now
Diffstat (limited to 'models/Auth/Yadis/XRIRes.php')
-rw-r--r-- | models/Auth/Yadis/XRIRes.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/models/Auth/Yadis/XRIRes.php b/models/Auth/Yadis/XRIRes.php deleted file mode 100644 index 5e1158735..000000000 --- a/models/Auth/Yadis/XRIRes.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/** - * Code for using a proxy XRI resolver. - */ - -require_once 'Auth/Yadis/XRDS.php'; -require_once 'Auth/Yadis/XRI.php'; - -class Auth_Yadis_ProxyResolver { - function Auth_Yadis_ProxyResolver($fetcher, $proxy_url = null) - { - $this->fetcher = $fetcher; - $this->proxy_url = $proxy_url; - if (!$this->proxy_url) { - $this->proxy_url = Auth_Yadis_getDefaultProxy(); - } - } - - function queryURL($xri, $service_type = null) - { - // trim off the xri:// prefix - $qxri = substr(Auth_Yadis_toURINormal($xri), 6); - $hxri = $this->proxy_url . $qxri; - $args = array( - '_xrd_r' => 'application/xrds+xml' - ); - - if ($service_type) { - $args['_xrd_t'] = $service_type; - } else { - // Don't perform service endpoint selection. - $args['_xrd_r'] .= ';sep=false'; - } - - $query = Auth_Yadis_XRIAppendArgs($hxri, $args); - return $query; - } - - function query($xri, $service_types, $filters = array()) - { - $services = array(); - $canonicalID = null; - foreach ($service_types as $service_type) { - $url = $this->queryURL($xri, $service_type); - $response = $this->fetcher->get($url); - if ($response->status != 200 and $response->status != 206) { - continue; - } - $xrds = Auth_Yadis_XRDS::parseXRDS($response->body); - if (!$xrds) { - continue; - } - $canonicalID = Auth_Yadis_getCanonicalID($xri, - $xrds); - - if ($canonicalID === false) { - return null; - } - - $some_services = $xrds->services($filters); - $services = array_merge($services, $some_services); - // TODO: - // * If we do get hits for multiple service_types, we're - // almost certainly going to have duplicated service - // entries and broken priority ordering. - } - return array($canonicalID, $services); - } -} - - |