× Joomla Facebook Connect support forum

Topic-icon Straight to authentication?

Active Subscriptions:

None
15 years 1 month ago #9188 by johnsontran
Hi,

I have a website with registration without activation and Facebook User only selected for a one-click registration which works like it is suppose to. My question is this, I have a facebook app and i want to take the user straight to the request for permission page with the allow/disallow button and if the user clicks allow, it takes them to my page with an account created. So basically, I'm looking to cut out the part where the user has to click on "login with facebook" for my facebook app page. Is this possible? I have seen many fb apps with this process.

thanks
The topic has been locked.
Support Specialist
15 years 1 month ago #9200 by alzander
John,
We're going to write up a tutorial soon on how to do this, because it's actually something that's been assked increasingly more over the last few weeks. There's no option to do this built-in to JFBConnect, but we may add it as an option in the future. Hopefully, the below will get you started. We haven't tested every aspect of this, but it seems to work on our test system. Your feedback would be very appreciated.

1) Modify /plugins/system/jfbcsystem.php. At line 79, you'll see $javascript = ... Directly above that line, add the following block:
$user = JFactory::getUser();
        if ($user->guest)
            $autoLogin = 'jfbc.login.login_custom();';
        else
            $autoLogin = '';
Then, in the $javascript block, add the {$autoLogin} parameter as below:
$javascript =
                <<<EOT
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '{$appId}', status: true, cookie: true, xfbml: true});{$subs}
{$autoLogin}
};

Leave all the code underneath that as well.

That will pop-up the Login box whenever a user visits the page and aren't logged into your site.

2) Make your site for Registered users only. Usually, you can start with just marking your home page menu item as "Registered", but people may still be able to see other areas of your site. There are plugins and other add-ons for Joomla that can force all pages to be registered, and are outside the scope of JFBConnect.

Hope this helps, and again, let us know if you run into any issues!
The topic has been locked.