]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/FacebookSSO/facebooklogin.php
Merge branch '0.9.x' into facebook-upgrade
[quix0rs-gnu-social.git] / plugins / FacebookSSO / facebooklogin.php
1 <?php
2 /**
3  * StatusNet - the distributed open-source microblogging tool
4  * Copyright (C) 2010, StatusNet, Inc.
5  *
6  * An action for logging in with Facebook
7  *
8  * PHP version 5
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Affero General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Affero General Public License for more details.
19  *
20  * You should have received a copy of the GNU Affero General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  * @category  Pugin
24  * @package   StatusNet
25  * @author    Zach Copley <zach@status.net>
26  * @copyright 2010 StatusNet, Inc.
27  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28  * @link      http://status.net/
29  */
30
31 if (!defined('STATUSNET')) {
32     exit(1);
33 }
34
35 class FacebookloginAction extends Action
36 {
37     function handle($args)
38     {
39         parent::handle($args);
40
41         if (common_is_real_login()) {
42             $this->clientError(_m('Already logged in.'));
43         }
44         
45         $this->showPage();
46     }
47
48     function getInstructions()
49     {
50         // TRANS: Instructions.
51         return _m('Login with your Facebook Account');
52     }
53
54     function showPageNotice()
55     {
56         $instr = $this->getInstructions();
57         $output = common_markup_to_html($instr);
58         $this->elementStart('div', 'instructions');
59         $this->raw($output);
60         $this->elementEnd('div');
61     }
62
63     function title()
64     {
65         // TRANS: Page title.
66         return _m('Login with Facebook');
67     }
68
69     function showContent() {
70
71         $this->elementStart('fieldset');
72         $this->element('fb:login-button');
73         $this->elementEnd('fieldset');
74     }
75
76     function showLocalNav()
77     {
78         $nav = new LoginGroupNav($this);
79         $nav->show();
80     }
81 }
82