3 * Laconica - a distributed open-source microblogging tool
4 * Copyright (C) 2008, Controlez-Vous, 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('LACONICA')) { exit(1); }
22 require_once(INSTALLDIR.'/lib/facebookaction.php');
24 class FacebookinviteAction extends FacebookAction
27 function handle($args)
29 parent::handle($args);
31 $this->error = $error;
34 if (!$this->facebook->api_client->users_hasAppPermission('status_update') &&
35 $this->facebook->api_client->data_getUserPreference(
36 FACEBOOK_PROMPTED_UPDATE_PREF) == 'true') {
38 echo '<h1>REDIRECT TO HOME</h1>';
46 function showContent()
49 // If the user has opted not to initially allow the app to have
50 // Facebook status update permission, store that preference. Only
51 // promt the user the first time she uses the app
52 if ($this->arg('skip')) {
53 $this->facebook->api_client->data_setUserPreference(
54 FACEBOOK_PROMPTED_UPDATE_PREF, 'true');
59 $this->user = $this->flink->getUser();
61 // If this is the first time the user has started the app
62 // prompt for Facebook status update permission
63 if (!$this->facebook->api_client->users_hasAppPermission('status_update')) {
65 if ($this->facebook->api_client->data_getUserPreference(
66 FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') {
67 $this->getUpdatePermission();
73 $this->showLoginForm();
78 function showSuccessContent()
85 function showFormContent()
93 return sprintf(_('Login'));
96 function redirectHome()