publicxrds.php 2.39 KB
Newer Older
Evan Prodromou's avatar
Evan Prodromou committed
1
<?php
Robin Millette's avatar
Robin Millette committed
2 3 4 5 6 7
/**
 * Public XRDS for OpenID
 *
 * PHP version 5
 *
 * @category Action
8
 * @package  StatusNet
9
 * @author   Evan Prodromou <evan@status.net>
10
 * @author   Craig Andrews <candrews@integralblue.com>
11
 * @author   Robin Millette <millette@status.net>
12
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
Robin Millette's avatar
Robin Millette committed
13
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
14
 * @link     http://status.net/
Robin Millette's avatar
Robin Millette committed
15
 *
16
 * StatusNet - the distributed open-source microblogging tool
17
 * Copyright (C) 2008, 2009, StatusNet, Inc.
Evan Prodromou's avatar
Evan Prodromou committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

33
if (!defined('STATUSNET') && !defined('LACONICA')) {
Robin Millette's avatar
Robin Millette committed
34 35
    exit(1);
}
Evan Prodromou's avatar
Evan Prodromou committed
36

37
require_once INSTALLDIR.'/plugins/OpenID/openid.php';
38
require_once INSTALLDIR.'/lib/xrdsoutputter.php';
Evan Prodromou's avatar
Evan Prodromou committed
39

Robin Millette's avatar
Robin Millette committed
40
/**
41
 * Public XRDS
Robin Millette's avatar
Robin Millette committed
42 43
 *
 * @category Action
44
 * @package  StatusNet
45 46
 * @author   Evan Prodromou <evan@status.net>
 * @author   Robin Millette <millette@status.net>
47
 * @author   Craig Andrews <candrews@integralblue.com>
48
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
Robin Millette's avatar
Robin Millette committed
49
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
50
 * @link     http://status.net/
Robin Millette's avatar
Robin Millette committed
51 52 53
 *
 * @todo factor out similarities with XrdsAction
 */
54 55
class PublicxrdsAction extends Action
{
Robin Millette's avatar
Robin Millette committed
56 57
    /**
     * Is read only?
58
     *
Robin Millette's avatar
Robin Millette committed
59 60
     * @return boolean true
     */
61
    function isReadOnly($args)
62
    {
63 64
        return true;
    }
65

Robin Millette's avatar
Robin Millette committed
66 67
    /**
     * Class handler.
68
     *
Robin Millette's avatar
Robin Millette committed
69 70 71 72
     * @param array $args array of arguments
     *
     * @return nothing
     */
73 74
    function handle($args)
    {
75
        parent::handle($args);
76 77 78 79 80
        $xrdsOutputter = new XRDSOutputter();
        $xrdsOutputter->startXRDS();
        Event::handle('StartPublicXRDS', array($this,&$xrdsOutputter));
        Event::handle('EndPublicXRDS', array($this,&$xrdsOutputter));
        $xrdsOutputter->endXRDS();
81
    }
Robin Millette's avatar
Robin Millette committed
82 83
}