summaryrefslogtreecommitdiff
path: root/actions/facebookhome.php
diff options
context:
space:
mode:
authorRobin Millette <millette@plantard.controlezvous.ca>2009-01-23 07:51:02 +0000
committerRobin Millette <millette@plantard.controlezvous.ca>2009-01-23 07:51:02 +0000
commitaa100884fbfb7f14613f402b5eabdcd9637faf57 (patch)
tree31e1f5a8e1ba88f90bdaad6c0166e4fa0a2577d7 /actions/facebookhome.php
parent965d4db26560892024503f538f107604b0f1bb45 (diff)
parent8114676bd4fd783ba9580a5dbf8bf0029a1554c9 (diff)
Merge branch 'master' of /var/www/trunk
Diffstat (limited to 'actions/facebookhome.php')
-rw-r--r--actions/facebookhome.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/actions/facebookhome.php b/actions/facebookhome.php
index b05e51b91..9510e7f08 100644
--- a/actions/facebookhome.php
+++ b/actions/facebookhome.php
@@ -57,29 +57,30 @@ class FacebookhomeAction extends FacebookAction
$this->user = $this->flink->getUser();
// If this is the first time the user has started the app
- // prompt for Facebook status update permission
- if (!$this->facebook->api_client->users_hasAppPermission('status_update')) {
+ // prompt for Facebook status update permission
+ if (!$this->facebook->api_client->users_hasAppPermission('status_update')) {
if ($this->facebook->api_client->data_getUserPreference(
- FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') {
- $this->getUpdatePermission();
- return;
+ FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') {
+ $this->getUpdatePermission();
+ return;
}
}
// Make sure the user's profile box has the lastest notice
$notice = $this->user->getCurrentNotice();
- $this->updateProfileBox($notice);
+ if ($notice) {
+ $this->updateProfileBox($notice);
+ }
- if ($this->arg('status_submit') == 'Send') {
+ if ($this->arg('status_submit') == 'Send') {
$this->saveNewNotice();
- }
+ }
// User is authenticated and has already been prompted once for
// Facebook status update permission? Then show the main page
// of the app
$this->showPage();
-
} else {
@@ -201,13 +202,13 @@ class FacebookhomeAction extends FacebookAction
$this->elementEnd('p');
$this->elementStart('form', array('method' => 'post',
- 'action' => $app_url,
+ 'action' => "$app_url/index.php",
'id' => 'facebook-skip-permissions'));
$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 . '\')'));
+ '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');