]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/publicxrds.php
Merge commit 'refs/merge-requests/1900' of git://gitorious.org/statusnet/mainline...
[quix0rs-gnu-social.git] / actions / publicxrds.php
1 <?php
2
3 /**
4  * Public XRDS for OpenID
5  *
6  * PHP version 5
7  *
8  * @category Action
9  * @package  StatusNet
10  * @author   Evan Prodromou <evan@status.net>
11  * @author   Robin Millette <millette@status.net>
12  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
13  * @link     http://status.net/
14  *
15  * StatusNet - the distributed open-source microblogging tool
16  * Copyright (C) 2008, 2009, StatusNet, Inc.
17  *
18  * This program is free software: you can redistribute it and/or modify
19  * it under the terms of the GNU Affero General Public License as published by
20  * the Free Software Foundation, either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU Affero General Public License for more details.
27  *
28  * You should have received a copy of the GNU Affero General Public License
29  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
30  */
31
32 if (!defined('STATUSNET') && !defined('LACONICA')) {
33     exit(1);
34 }
35
36 require_once INSTALLDIR.'/plugins/OpenID/openid.php';
37 require_once INSTALLDIR.'/lib/xrdsoutputter.php';
38
39 /**
40  * Public XRDS
41  *
42  * @category Action
43  * @package  StatusNet
44  * @author   Evan Prodromou <evan@status.net>
45  * @author   Robin Millette <millette@status.net>
46  * @author   Craig Andrews <candrews@integralblue.com>
47  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
48  * @link     http://status.net/
49  *
50  * @todo factor out similarities with XrdsAction
51  */
52 class PublicxrdsAction extends Action
53 {
54     /**
55      * Is read only?
56      *
57      * @return boolean true
58      */
59     function isReadOnly($args)
60     {
61         return true;
62     }
63
64     /**
65      * Class handler.
66      *
67      * @param array $args array of arguments
68      *
69      * @return nothing
70      */
71     function handle($args)
72     {
73         parent::handle($args);
74         $xrdsOutputter = new XRDSOutputter();
75         $xrdsOutputter->startXRDS();
76         Event::handle('StartPublicXRDS', array($this,&$xrdsOutputter));
77         Event::handle('EndPublicXRDS', array($this,&$xrdsOutputter));
78         $xrdsOutputter->endXRDS();
79     }
80 }
81