Kick user out if she doesn't have FB cookies

This commit is contained in:
Zach Copley 2009-08-18 22:18:01 +00:00
parent ce004083d9
commit 486167ad8e
1 changed files with 7 additions and 13 deletions

View File

@ -38,20 +38,14 @@ class FBConnectauthAction extends Action
function prepare($args) { function prepare($args) {
parent::prepare($args); parent::prepare($args);
try { $this->fbuid = getFacebook()->get_loggedin_user();
$this->fbuid = getFacebook()->get_loggedin_user(); if ($this->fbuid > 0) {
$this->fb_fields = $this->getFacebookFields($this->fbuid,
if ($this->fbuid > 0) { array('first_name', 'last_name', 'name'));
$this->fb_fields = $this->getFacebookFields($this->fbuid, } else {
array('first_name', 'last_name', 'name')); $this->clientError(_('You must be logged into Facebook to ' .
} else { 'use Facebook Connect.'));
common_debug("No Facebook User found.");
}
} catch (Exception $e) {
common_log(LOG_WARNING, 'Problem getting Facebook uid: ' .
$e->getMessage());
} }
return true; return true;