]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
parse the XRDS results
authorEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 19:04:46 +0000 (15:04 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 19:04:46 +0000 (15:04 -0400)
Apparently you have to parse the XRDS results from the discovery
result object. Who knew?

darcs-hash:20080530190446-84dde-52e5220aa5b76bc443ed20a1d0e07e509a5522f8.gz

actions/remotesubscribe.php

index 0db58ec9caee21cf0e66e6b3bef3b1bf941196e8..4c7fc0ed43174eb2b35b11626de291276a9bf384 100644 (file)
@@ -85,14 +85,16 @@ class RemotesubscribeAction extends Action {
                        return;
                }
 
-               if (!$yadis->xrds) {
+        $xrds =& Auth_Yadis_XRDS::parseXRDS($yadis->response_text);
+
+               if (!$xrds) {
                        $this->show_form(_t('Not a valid profile URL (no XRDS defined).'));
                        return;
                }
                
-               common_debug('remotesubscribe.php: XRDS is "'.print_r($yadis->xrds,TRUE).'"');
+               common_debug('remotesubscribe.php: XRDS is "'.print_r($xrds,TRUE).'"');
 
-               $omb = $this->getOmb($yadis);
+               $omb = $this->getOmb($xrds);
                
                if (!$omb) {
                        $this->show_form(_t('Not a valid profile URL (incorrect services).'));
@@ -118,12 +120,12 @@ class RemotesubscribeAction extends Action {
                return $user;
        }
 
-       function getOmb($yadis) {
+       function getOmb($xrds) {
            static $endpoints = array(OMB_ENDPOINT_UPDATEPROFILE, OMB_ENDPOINT_POSTNOTICE,
                                                                  OAUTH_ENDPOINT_REQUEST, OAUTH_ENDPOINT_AUTHORIZE,
                                                                  OAUTH_ENDPOINT_ACCESS);
                $omb = array();
-               $services = $yadis->services(); # ordered by priority
+               $services = $xrds->services(); # ordered by priority
                if (!$services) {
                        common_debug('remotesubscribe.php: Got no services back from XRDS.');
                        return NULL;