Facebook bridge back in business with new JS-SDK and OAuth 2.0 flow.

Might be better to rewrite the login mechanism to use server side flow
now that Facebook provides it.
This commit is contained in:
Zach Copley
2011-09-27 04:09:47 +00:00
parent 634fb64c11
commit 3b28f226c7
6 changed files with 116 additions and 196 deletions

View File

@@ -44,20 +44,18 @@ class Foreign_user extends Managed_DataObject
);
}
// XXX: This only returns a 1->1 single obj mapping. Change? Or make
// a getForeignUsers() that returns more than one? --Zach
static function getForeignUser($id, $service) {
$fuser = new Foreign_user();
$fuser->whereAdd("service = $service");
$fuser->whereAdd("id = $id");
$fuser->id = $id;
$fuser->service = $service;
$fuser->limit(1);
if ($fuser->find()) {
$fuser->fetch();
return $fuser;
}
$result = $fuser->find(true);
return null;
return empty($result) ? null : $fuser;
}
static function getByNickname($nickname, $service)