summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-01-26 06:31:25 +0000
committerZach Copley <zach@controlyourself.ca>2009-01-26 06:31:25 +0000
commit55a4fac6a62a0997f15120432314d55df8994132 (patch)
tree029fc14f618ef09f0537435e955449ae333459a3 /actions
parentb2e67db8337d94aee86adbfb8c1b61ad3e5a3b8d (diff)
trac750 Better permissions workflow and styling hooks
Diffstat (limited to 'actions')
-rw-r--r--actions/facebookhome.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/actions/facebookhome.php b/actions/facebookhome.php
index 3558cf671..e17c0f813 100644
--- a/actions/facebookhome.php
+++ b/actions/facebookhome.php
@@ -43,11 +43,11 @@ class FacebookhomeAction extends FacebookAction
function handle($args)
{
parent::handle($args);
-
+
// If the user has opted not to initially allow the app to have
// Facebook status update permission, store that preference. Only
// promt the user the first time she uses the app
- if ($this->arg('skip')) {
+ if ($this->arg('skip') || $args['fb_sig_request_method'] == 'GET') {
$this->facebook->api_client->data_setUserPreference(
FACEBOOK_PROMPTED_UPDATE_PREF, 'true');
}
@@ -191,7 +191,7 @@ class FacebookhomeAction extends FacebookAction
$this->showStylesheets();
- $this->elementStart('div', array('class' => 'content'));
+ $this->elementStart('div', array('class' => 'facebook_guide'));
$instructions = sprintf(_('If you would like the %s app to automatically update ' .
'your Facebook status with your latest notice, you need ' .
@@ -207,11 +207,19 @@ class FacebookhomeAction extends FacebookAction
$this->elementStart('ul', array('id' => 'fb-permissions-list'));
$this->elementStart('li', array('id' => 'fb-permissions-item'));
- $this->elementStart('fb:prompt-permission', array('perms' => 'status_update',
- 'next_fbjs' => 'document.setLocation(\'' . "$this->app_uri/index.php" . '\')'));
- $this->element('span', array('class' => 'facebook-button'),
- sprintf(_('Allow %s to update my Facebook status'), $this->app_name));
- $this->elementEnd('fb:prompt-permission');
+
+ $next = urlencode("$this->app_uri/index.php");
+ $api_key = common_config('facebook', 'apikey');
+
+ $auth_url = 'http://www.facebook.com/authorize.php?api_key=' .
+ $api_key . '&v=1.0&ext_perm=status_update&next=' . $next .
+ '&next_cancel=' . $next . '&submit=skip';
+
+ $this->elementStart('span', array('class' => 'facebook-button'));
+ $this->element('a', array('href' => $auth_url),
+ sprintf(_('Okay, do it!'), $this->app_name));
+ $this->elementEnd('span');
+
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'fb-permissions-item'));