' + .' Lost or forgotten password?' + .'
' + .'diff --git a/actions/facebookhome.php b/actions/facebookhome.php new file mode 100644 index 0000000000..b58110bcc8 --- /dev/null +++ b/actions/facebookhome.php @@ -0,0 +1,162 @@ +. + */ + +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 = $this->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) { + + $this->display($facebook, $fbuid); + + $user = $flink->getUser(); + + + $notice = $user->getCurrentNotice(); + + echo $this->show_notices($user); + + + $this->update_profile_box($facebook, $fbuid, $user); + + + } else { + + $nickname = common_canonical_nickname($this->trimmed('nickname')); + $password = $this->arg('password'); + + if ($nickname) { + + if (common_check_user($nickname, $password)) { + + echo '
Hello,
Login with your username and password. Don\'t have a username yet?' + .' Register a new account.' + .'
' + .'' + .' Lost or forgotten password?' + .'
' + .'' . $notice->rendered . '
' + .'' + .'' . common_date_string($notice->created) . ''; + + if ($notice->source) { + $html .= _(' from '); + $html .= $this->source_link($notice->source); + } + + if ($notice->reply_to) { + $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); + $html .= + ' (' . _('in reply to...') . ')'; + } + + $html .= '