3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2008, 2009, StatusNet, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if (!defined('STATUSNET') && !defined('LACONICA')) {
24 require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php';
26 class FacebookinviteAction extends FacebookAction
29 function handle($args)
31 parent::handle($args);
33 $this->error = $error;
36 if (!$this->facebook->api_client->users_hasAppPermission('publish_stream') &&
37 $this->facebook->api_client->data_getUserPreference(
38 FACEBOOK_PROMPTED_UPDATE_PREF) == 'true') {
40 echo '<h1>REDIRECT TO HOME</h1>';
47 function showContent()
50 // If the user has opted not to initially allow the app to have
51 // Facebook status update permission, store that preference. Only
52 // promt the user the first time she uses the app
53 if ($this->arg('skip')) {
54 $this->facebook->api_client->data_setUserPreference(
55 FACEBOOK_PROMPTED_UPDATE_PREF, 'true');
60 $this->user = $this->flink->getUser();
62 // If this is the first time the user has started the app
63 // prompt for Facebook status update permission
64 if (!$this->facebook->api_client->users_hasAppPermission('publish_stream')) {
66 if ($this->facebook->api_client->data_getUserPreference(
67 FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') {
68 $this->getUpdatePermission();
74 $this->showLoginForm();
79 function showSuccessContent()
84 function showFormContent()
91 return sprintf(_m('Login'));
94 function redirectHome()