Announcements

Spam Blaster Implemented
by NetriX - 2 weeks ago
The New PHP-Fusion USA
by NetriX - 4 months ago

Latest Posts

I am Newbie
by hmsnaveen95 - 16 hours ago
Thank you
by hmsnaveen95 - 16 hours ago
Hello from newbie
by hmsnaveen95 - 16 hours ago
Mobile view
by NetriX - 1 week ago
Video Infusion 3.2.0
by NetriX - 1 week ago
Spam Blaster Implemented
by NetriX - 2 weeks ago
Smiley's installation
by ginny - 2 weeks ago
MySql?
by daimonbok - 2 weeks ago
Database Backup
by skpacman - 2 weeks ago
PHP - Best Practises
by skpacman - 3 weeks ago

View Thread

Who is here? 1 guest(s)
 Print Thread
Facebook Connect 3.0.0
NetriX
Installation Video
http://php-fusion.us/infusions/video/...o.php?id=2

Locales Included
  • Bulgarian
  • Czech
  • English
  • Gernam
  • Icelandic
  • Polish


Warning - v2.3.7 is currently depreciated and no longer working. Version 3 will be released very soon and is fully functional.

Changes:

v2.3.7 - Feb. 1, 2014
  • Improved Load Times
  • Improved Validation
  • Minor Bugs Fixed


v2.3.6 - Oct. 26, 2013
  • Added validation and test for non-int error_code defaulting to 0
  • Improved validation in parseSignedRequest
  • Added setSignedRequest method
  • Added a new BaseFacebook disableAppSecretProof()
  • missing setAccessToken
  • Don't convert CURLFile params to JSON


v2.3.5 - Jul. 15, 2013
  • Fixed Redirection 404
  • Tweaked connect_panel - New break tags
  • Added the extra param: appsecret_proof to the oauth api calls
  • Minor Bug Fixes


v2.3.4 - Apr. 10, 2013
  • New Locales (German)
  • Layout Updates (altered class)
  • Removed Facebook Like (potential issues caused)
  • Addressed White Space Logout Bug (Should now work 100%)


v2.3.3 - Apr. 7, 2013
  • Added Troubleshooting for JS Login. User Clicks link to access PHP login setting. Makes for better compatibility.
  • New Locales


v2.3.2 - Apr. 3, 2013
  • Improved Security
  • Fixed User_Fields Bug
  • New Dark/Light Like Button Setting


v2.3.0 - Mar. 25, 2013
  • Added User Fields for Profile
  • Admin Option for use of JS or PHP login methods
  • Integrated beta logout function
  • Like Button on Register/Login page
  • Various Tweaks


v2.2.4 - Feb. 13, 2013
  • Addressed Environment for Undefined Indexes
  • Fixed New Update Shown in Admin Panel
  • Centered avatar and img in connect_panel for cosmetic improvement


v2.2.3 - Feb. 7, 2013
  • Fixed a vulnerability with signed requests
  • Updated cert bundle to use the current curl bundle
  • Now uses most recent Facebook SDK code


v2.2.2 - August 15, 2012
  • Added Logout Functionality. Destroys Facebook login and PHP-Fusion session for use of panel. Stops user from being re-logged.


v2.2.1 - August 13, 2012
  • Fixed Redirect Loop associated with Panel. (Only present in cases of sub directory use).
  • Added Total Facebook Users Connected Count (in Admin)
  • Small design tweaks
  • Removed Facebook Image button to Connect, changed with locale text for better translation.


v2.2.0 - August 12, 2012
  • Extended Tokens
  • Shared Sessions for Better Security
  • Login through panel (no need to visit infusion page)
  • Minor Bug Fixes
  • Minor Improvements


v2.1.3
  • Admin Activation Implemented
  • Certificate Update (CURL Issue)
  • Improved Code
  • New Locales


v2.1.2
  • Updated Connect Panel for PHP-Fusion 7.02.05
  • Tidied the Code Up
  • Admin Updates Changed, No Longer IFRAME (Report Any Bugs With This)


v2.1.1
  • Security Fix


v2.1.0
  • Fixed Characters (UTF8/ISO)
  • Cleaned up Register Page
  • Fixed ApiException Error (Long array text on register)
  • Optimized Locales - <!--USERNAME--> Replaces in Output
  • More Locales Defined
  • Small Bug Fixes


v2.0.3
  • Fixed Redirect Loop Problem
  • Added new Login System (backend)
  • New Locale Variables


v2.0.2
  • Minimized / Cleaned up Code
  • Added Headers (redirect loop fix)


v2.0.0
  • Install Using Infuse
  • New - Admin panel
  • New - Fetches Facebook Profile Picture, Sets as Avatar

Edited by NetriX on 10-23-2017 10:49
 
Advertisement
NetriX
Great news!

The long awaiting, highly anticipated, Facebook Connect Infusion version 3 is almost ready for public release.

php-fusion.us/forum/attachments/screenshot_from_2017-10-19_03-59-06.png

php-fusion.us/forum/attachments/screenshot_from_2017-10-19_04-03-21.png

I ended up having some last minute ideas that may prove useful - please suggest your own as well.

The layout is getting a slight altercation, but the code has been reprogrammed from the ground up.

As for features, I'm debating possibly changing the login flow.

Right now it's Login with Facebook > Click Button > Enter desired user/pass > Register

I plan to somehow make the user/pass randomly generated or make it faster to register by simply selecting a username and having the randomly generated password emailed to the user.

Alternatively, maybe it can just bypass both methods and after initializing a successful Facebook authentication, skip selecting a user/pass and get right into the website as a member.

This will all however delay the official release.

Opinions? Suggestions?
NetriX attached the following file:
You must register or login in order to download this file.

Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
NetriX
Working out the release... its a tricky one this time around. One little misstep and the whole ship sinks.

I've attached the v3.00 Beta below.. Keyword being beta.

I use it live here and confirm that it is stable for me.

What's next is some basic polish and creating the complex install/readme file.

Facebook URI has to be full URL to index of connect:

Example - https://php-fusion.us/infusions/connect/index.php

Ensure your setup matches my screen shot setup!!

php-fusion.us/forum/attachments/screenshot_from_2017-10-23_12-24-02.png

php-fusion.us/forum/attachments/screenshot_from_2017-10-23_12-24-27.png

Also, this little bugger that stopped production for many months must be removed from your maincore.php file - it's safe to remove.

$_SERVER['REQUEST_URI'] = isset($_SERVER['REQUEST_URI']) ? cleanurl($_SERVER['REQUEST_URI']) : "";


Post feedback/results.
NetriX attached the following file:
You must register or login in order to download this file.

Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
daimonbok
7 only Netrix?
 
NetriX
Yes, for the time being.

I've got a couple free days so I'll work to make it v9 compatible.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
daimonbok
If you can, it'd be great! Thanks Netrix!
 
jjwichter
I keep getting this everytime I try to link facebook account. Here is my website:
http://buhlmodelt...osted.com/


URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

I got errors from dreamweaver on lines 62-64, and 99 they show in red.

Download source  Code
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Developer: Brandon Davis (NetriX)
| Website: PHP-Fusion.us
| DevSite: PHPFusionMods.org
|  _   _      _        ___  __
| | \ | | ___| |_ _ __(_) \/ /
| |  \| |/ _ \ __| '__| |\  /
| | |\  |  __/ |_| |  | |/  \
| |_| \_|\___|\__|_|  |_/_/\_\
|
| Do not remove the copyright footer without the developers
| consent. You may request the consent of removal by contacting
| me at the following email address:
|
| Thank You,
| Brandon (NetriX)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES . "templates/header.php";
include INFUSIONS . "connect/infusion_db.php";

if (isset($_GET['unlink']) && iMEMBER) {
    dbquery("UPDATE " . DB_USERS . " SET user_oauth_uid='0' WHERE user_id='" . $userdata['user_id'] .
        "'");
    redirect(BASEDIR . $settings['opening_page']);
}

opentable("Facebook Connect v3 Alpha");

$appid = null;
$secret = null;

$query = dbquery("SELECT * FROM " . DB_FACEBOOK . " LIMIT 0,1");
while ($d = dbarray($query)) {
    $appid = $d['id'];
    $secret = $d['secret'];
}

session_start();

$app_id = $appid;
$app_secret = $secret;
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/infusions/connect/';

$permissions = array('email');

require_once ('autoload.php');

use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;

FacebookSession::setDefaultApplication($app_id, $app_secret);

$helper = new FacebookRedirectLoginHelper($redirect_uri);

if (isset($_SESSION) && isset($_SESSION['fb_token'])) {
    $session = new FacebookSession($_SESSION['fb_token']);

    try {
        if (!$session->validate()) {
            $session = null;
        }
    }
    catch (exception $e) {
        $session = null;
    }
} else {
    try {
        $session = $helper->getSessionFromRedirect();
    }
    catch (FacebookRequestException $ex) {

    }
    catch (exception $ex) {
        echo $ex->message;
    }
}

if (isset($session)) {

    $_SESSION['fb_token'] = $session->getToken();
    $session = new FacebookSession($session->getToken());
    $logoutURL = $helper->getLogoutUrl($session, 'http://' . $_SERVER['HTTP_HOST'] .
        '/infusions/connect/?logout');
    $request = (new FacebookRequest($session, 'GET', '/me'))->execute();
    $user = $request->getGraphObject()->asArray();
   
    // Links Facebook account of currently logged user if session exists
    if (iMEMBER && $userdata['user_oauth_uid']==0) {
        dbquery("UPDATE " . DB_USERS . " SET user_oauth_uid='" . $user['id'] . "' WHERE user_id='" . $userdata['user_id'] . "'");
        redirect(BASEDIR . $settings['opening_page']);
    }

    // Check if user is already registered then login
    if (iGUEST) {
        $result = dbquery("SELECT user_id, user_salt, user_algo, user_oauth_uid FROM " .
            DB_USERS . "
      WHERE user_oauth_uid='" . $user['id'] .
            "'  AND user_status='0' AND user_actiontime='0' LIMIT 0,1");
        if (dbrows($result) == 1) {
            $userdb = dbarray($result);
            Authenticate::setUserCookie($userdb['user_id'], $userdb['user_salt'], "sha256",
                "", true);
            redirect(BASEDIR . $settings['opening_page']);
        } else {
        // Code to begin registration
        echo "<table cellpadding='0' cellspacing='0' class='center'>
        <tr>
        <td colspan='2' class='tbl2'><strong>Facebook Register</strong></td>
        </tr>
        <tr>
        <td class='tbl' width='150'><label for='user'>Username</label></td>
        <td class='tbl'><input type='text' id='user' name='user' maxlength='64' class='textbox' value='' style='width:200px;' autocomplete='off' /></td>
        </tr>
        <tr>
        <td class='tbl' width='150'><label for='email'>Email</label></td>
        <td class='tbl'>".$user['email']."</td>
        </tr></table>";
        }
      }
    echo '<a href="' . $logoutURL . '" style="float:right">Log out</a>';
} else {
    $loginUrl = $helper->getLoginUrl($permissions);

    echo '<center><a href="' . $loginUrl . '">Log in</a></center>';
}
closetable();

if (isset($_GET['logout'])) {
    session_destroy();
    redirect($redirect_uri);
}

require_once THEMES . "templates/footer.php";



jjwichter attached the following file:
You must register or login in order to download this file.

Edited by jjwichter on 10-25-2017 16:51
 
NetriX

>jjwichter wrote:


I keep getting this everytime I try to link facebook account. Here is my website:
http://buhlmodelt...osted.com/


URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

I got errors from dreamweaver on lines 62-64, and 99 they show in red.

Hi, it would appear that you're using an outdated version. The latest tested release is located a couple post above here.

Download the attachment and follow the installation guidelines presented and post back with results.

Thanks.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
jjwichter
Thanks,
John
 
jjwichter
Ok, that got rid of that now I got this error "URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."

and

"Not Found

The requested URL /infusion was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

What do I put in the space in facebook connect settings where it says "Facebook URI:" Copy the address from facebook?
http://buhlmodeltrainsociety.a2hosted...index.php? From what it shows from facebook

When I go back into the facebook connect after the error the URI changes to:
http://buhlmodeltrainsociety.a2hosted...m/infusion

It cuts the url off.

Thanks,
John
Edited by jjwichter on 10-27-2017 13:58
 
Advertisement
NetriX
Aha, bug found. The uri doesn't have enough space in the table for the full url character count. You can change the scructure to varchar(120) .

Or, edit the /infusions/connect/index.php file and change the redirect_uri to http://buhlmodeltrainsociety.a2hosted.../index.php

I'm at work right now and cannot alter myself until morning.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
jjwichter
Yup, That worked!, so you just have to fix that in the update just incase someone else website address is biggier. Also yours is not working the last time I looked. You get this error "Facebook SDK returned an error: Cross-site request forgery validation failed. Required param "state" missing."

Thanks,
John
 
NetriX

>jjwichter wrote:


Yup, That worked!, so you just have to fix that in the update just incase someone else website address is biggier. Also yours is not working the last time I looked. You get this error "Facebook SDK returned an error: Cross-site request forgery validation failed. Required param "state" missing."

Thanks,
John

Glad to hear! It will be addressed shortly.

I was making some changes earlier so that could be the issue. Is it working for you now for our site?

Thanks.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
jjwichter
It is working now on your site.

Thanks,
John
 
jjwichter
Hey are you going to make a version 9 of facebook connect? If so that would be cool!

Thanks,
John
 
NetriX

>jjwichter wrote:


Hey are you going to make a version 9 of facebook connect? If so that would be cool!

Thanks,
John

Of course! If I get time next week, maybe I'll throw out a beta.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
daimonbok
Neat, can't wait Netrix! I'd enjoy testing it......
 
nightlord
Hi. I have one issue. When Im trying to unlink facebook I get redirected to:
http://mywebsite.com/http://mywebsite...p/news.php where is the issue I cant find it?
Thank you
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Facebook Connect 2.3.7 Infusions Support 10 01-03-2017 10:45
Facebook Login Infusions Support 4 12-11-2016 13:32
Facebook connect and Fusion 9.0 Infusions Support 8 08-04-2016 16:02
Facebook Connect - Update Dev Account Infusions Support 24 03-04-2016 16:47
Facebook Connect user_online_presence Error Infusions Support 15 08-25-2015 04:48