* @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)
+ function prepare(array $args = array())
{
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)
+ function handle()
{
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');
$this->elementStart('api', $apiAttrs);
$this->elementStart('settings');
$this->element('docs', null,
- 'http://status.net/wiki/TwitterCompatibleAPI');
+ common_local_url('doc', array('title' => 'api')));
$this->element('setting', array('name' => 'OAuth'),
'true');
$this->elementEnd('settings');
*
* @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')) {