* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class RsdAction extends Action
{
/**
* Optional attribute for the personal rsd.xml file.
*/
-
var $user = null;
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
// Permanent redirect on non-canonical nickname
if ($nickname_arg != $nickname) {
- common_redirect(common_local_url('rsd',
- array('nickname' => $nickname)),
- 301);
- return false;
+ common_redirect(common_local_url('rsd', array('nickname' => $nickname)), 301);
}
- $this->user = User::staticGet('nickname', $nickname);
+ $this->user = User::getKV('nickname', $nickname);
if (empty($this->user)) {
+ // TRANS: Client error.
$this->clientError(_('No such user.'), 404);
- return false;
}
}
*
* @return nothing
*/
-
function handle($args)
{
header('Content-Type: application/rsd+xml');
$this->elementStart('rsd', array('version' => '1.0',
'xmlns' => $rsdNS));
$this->elementStart('service');
+ // TRANS: Engine name for RSD.
$this->element('engineName', null, _('StatusNet'));
$this->element('engineLink', null, 'http://status.net/');
$this->elementStart('apis');
'true');
$this->elementEnd('settings');
$this->elementEnd('api');
+
+ // Atom API
+
+ if (empty($this->user)) {
+ $service = common_local_url('ApiAtomService');
+ } else {
+ $service = common_local_url('ApiAtomService', array('id' => $this->user->nickname));
+ }
+
+ $this->element('api', array('name' => 'Atom',
+ 'preferred' => 'false',
+ 'apiLink' => $service,
+ 'blogID' => $blogID));
+
Event::handle('EndRsdListApis', array($this, $this->user));
}
$this->elementEnd('apis');
*
* @return string date of last change of this page
*/
-
function lastModified()
{
if (!empty($this->user)) {
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return string API root URI for this site
*/
-
private function _apiRoot()
{
if (common_config('site', 'fancy')) {