]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/UserFlag/flagprofileaction.php
Merge branch '0.9.x' into userflag
[quix0rs-gnu-social.git] / plugins / UserFlag / flagprofileaction.php
1 <?php
2 /**
3  * Add a flag to a profile
4  *
5  * PHP version 5
6  *
7  * @category Action
8  * @package  StatusNet
9  * @author   Evan Prodromou <evan@status.net>
10  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
11  * @link     http://status.net/
12  *
13  * StatusNet - the distributed open-source microblogging tool
14  * Copyright (C) 2009, StatusNet, Inc.
15  *
16  * This program is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU Affero General Public License as published by
18  * the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU Affero General Public License for more details.
25  *
26  * You should have received a copy of the GNU Affero General Public License
27  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
28  */
29
30 if (!defined('STATUSNET')) {
31     exit(1);
32 }
33
34 /**
35  * Action to flag a profile.
36  *
37  * @category Action
38  * @package  StatusNet
39  * @author   Evan Prodromou <evan@status.net>
40  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
41  * @link     http://status.net/
42  */
43
44 class FlagprofileAction extends Action
45 {
46     var $profile = null;
47
48     /**
49      * Take arguments for running
50      *
51      * @param array $args $_REQUEST args
52      *
53      * @return boolean success flag
54      */
55
56     function prepare($args)
57     {
58         if ($_SERVER['REQUEST_METHOD'] != 'POST') {
59             throw new ClientException(_('Action only accepts POST'));
60         }
61
62         return true;
63     }
64
65     /**
66      * Handle request
67      *
68      * @param array $args $_REQUEST args; handled in prepare()
69      *
70      * @return void
71      */
72
73     function handle($args)
74     {
75         parent::handle($args);
76
77         $this->flagProfile();
78         $this->returnTo();
79     }
80
81     function title() {
82         return _('Flag profile');
83     }
84
85     /**
86      * save the profile flag
87      *
88      * @return void
89      */
90
91     function flagProfile()
92     {
93     }
94 }
95