X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fxrds.php;h=818cd1032c1c0516e9005dc424cca7433af281d5;hb=8b47400183052873b012dacf4eb5ba841914a886;hp=8f09557d185ce34ca3d2a566ddffc76860961f05;hpb=5f5413624d166a9b2116d266c7698dd6dcd2d8c4;p=quix0rs-gnu-social.git diff --git a/actions/xrds.php b/actions/xrds.php index 8f09557d18..818cd1032c 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -1,5 +1,4 @@ trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { + // TRANS: Client error displayed providing a non-existing nickname. $this->clientError(_('No such user.')); return; } @@ -97,27 +97,23 @@ class XrdsAction extends Action $xrdsOutputter->element('Type', null, 'xri://$xrds*simple'); $xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_REQUEST, common_local_url('requesttoken'), - array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1)); - $xrdsOutputter->showXrdsService( OAUTH_ENDPOINT_AUTHORIZE, - common_local_url('userauthorization'), array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1), null, - $this->user->getIdentifierURI()); + $this->user->uri); + $xrdsOutputter->showXrdsService( OAUTH_ENDPOINT_AUTHORIZE, + common_local_url('userauthorization'), + array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1)); $xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_ACCESS, common_local_url('accesstoken'), - array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1), - null, - $this->user->getIdentifierURI()); + array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1)); $xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_RESOURCE, null, - array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1), - null, - $this->user->getIdentifierURI()); + array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1)); $xrdsOutputter->elementEnd('XRD'); - + //omb $xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', - 'xml:id' => 'oauth', + 'xml:id' => 'omb', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); $xrdsOutputter->element('Type', null, 'xri://$xrds*simple'); @@ -126,11 +122,11 @@ class XrdsAction extends Action $xrdsOutputter->showXrdsService(OMB_ENDPOINT_UPDATEPROFILE, common_local_url('updateprofile')); $xrdsOutputter->elementEnd('XRD'); - + + Event::handle('EndUserXRDS', array($this,&$xrdsOutputter)); + //misc $xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', - 'xml:id' => 'oauth', - 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); $xrdsOutputter->showXrdsService(OAUTH_DISCOVERY, '#oauth'); @@ -138,10 +134,6 @@ class XrdsAction extends Action '#omb'); $xrdsOutputter->elementEnd('XRD'); - Event::handle('EndUserXRDS', array($this,&$xrdsOutputter)); - $xrdsOutputter->endXRDS(); - } } -?>