Author: chabotc
Date: Mon Dec 22 01:50:22 2008
New Revision: 728633
URL: http://svn.apache.org/viewvc?rev=728633&view=rev
Log:
SHINDIG-807 - Adds OAuth information to the metadata response
Modified:
incubator/shindig/trunk/php/src/gadgets/MetadataHandler.php
Modified: incubator/shindig/trunk/php/src/gadgets/MetadataHandler.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/MetadataHandler.php?rev=728633&r1=728632&r2=728633&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/MetadataHandler.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/MetadataHandler.php Mon Dec 22
01:50:22 2008
@@ -65,6 +65,16 @@
foreach ($gadget->getIcons() as $icon) {
$icons[] = $icon;
}
+ $oauth = array();
+ $oauthspec = $gadget->getOAuthSpec();
+ if (! empty($oauthspec)) {
+ foreach ($oauthspec->getServices() as $oauthservice) {
+ $oauth[$oauthservice->getName()] = array(
+ "request" => $oauthservice->getRequestUrl(),
+ "access" => $oauthservice->getAccessUrl(),
+ "authorization" => $oauthservice->getAuthorizationUrl());
+ }
+ }
$response['author'] = $gadget->getAuthor();
$response['authorEmail'] = $gadget->getAuthorEmail();
$response['description'] = $gadget->getDescription();
@@ -95,6 +105,7 @@
$response['url'] = $gadgetUrl;
$response['iframeUrl'] = UrlGenerator::getIframeURL($gadget, $context);
$response['userPrefs'] = $prefs;
+ $response['oauth'] = $oauth;
return $response;
}
}