.
*/
if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/facebookaction.php');
class FacebookhomeAction extends FacebookAction
{
function handle($args)
{
parent::handle($args);
$this->login();
}
function login()
{
$user = null;
$facebook = get_facebook();
$fbuid = $facebook->require_login();
# check to see whether there's already a Facebook link for this user
$flink = Foreign_link::getByForeignID($fbuid, 2); // 2 == Facebook
if ($flink) {
$user = $flink->getUser();
$this->show_home($facebook, $fbuid, $user);
} else {
# Make the user put in her Laconica creds
$nickname = common_canonical_nickname($this->trimmed('nickname'));
$password = $this->arg('password');
if ($nickname) {
if (common_check_user($nickname, $password)) {
$user = User::staticGet('nickname', $nickname);
if (!$user) {
echo '