MyBB Community Forums

Full Version: MyFacebook Connect 3.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I get this error when i cancel to connect to fb, would like to access your public profile, friend list, email address, birthday and current city, i was just testing it to make sure it worked and it happened after i hit cancel:

[attachment=29688]
Known "bug" in the code. I haven't had the chance to update the plugin on GitHub but will do soon.
Oh ok, cool.
That's the error I was getting that I was talking about.
awesome plugin before average registration on my site was 50... because of this the average now is 130.. Smile also active members is up
btw, when i click on connect with this, it goes to facebook and my app asks for email, friends, photos, etc.. something along those lines.. i think thatll turn off some users who dont realize im not using any of that crap.

Can you elaborate on how that can be edited/dealt with?
Help me please.. it keeps on saying

Forbidden

You don't have permission to access /myfbconnect.php on this server.

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

when i tried to register. Thank you!
This might be my chance to help .. those who got errors in cancel issue .. you may want to edit myfbconnect.php in root ..

go to line 113:
remove error($lang->sprintf($lang->myfbconnect_error_report, print_r($e)));
and add this:

header("Location: index.php");
exit;

this will redirect users into your homepage if they click cancel on facebook.
bro i checked the root file and the inc/plugins and i have 1.1 and its not anywhere in the file on line 113 (i use notepad++)

I did find this under the comments dont stop the magic and dont stop the magic, again!
I found this but its on line 83 another on line 106
// user found, but permissions denied
	catch (FacebookApiException $e) {
		error($lang->sprintf($lang->myfbconnect_error_report, print_r($e)));
	}

I edited those two lines and it does return to index but with added characters???

it adds this to the addressbar: index.php#_=_

This is the code now

// don't stop the magic
if ($mybb->input['action'] == "do_fblogin") {
	
	// user detected, just tell him he his already logged in
	if ($mybb->user['uid']) {
		error($lang->myfbconnect_error_alreadyloggedin);
	}
	
	// user found and logged in
	try {
		// get the user public data
		$userdata = $facebook->api("/me?fields=id,name,email,cover,birthday,website,gender,bio,location,verified");
		// let our handler do all the hard work
		$magic = myfbconnect_run($userdata);
		if ($magic['error']) {
			$errors = $magic['data'];
			$mybb->input['action'] = "fbregister";
		}
	}
	// user found, but permissions denied
	catch (FacebookApiException $e) {
			header("Location: index.php");
			exit;
	}
}

// don't stop the magic, again!
if ($mybb->input['action'] == "fbregister") {
	
	// user detected, just tell him he his already logged in
	if ($mybb->user['uid']) {
		error($lang->myfbconnect_error_alreadyloggedin);
	}
	
	// get the user
	$user = $facebook->getUser();
	if (!$user) {
		error($lang->myfbconnect_error_noauth);
	} else {
		try {
			// get the user public data
			$userdata = $facebook->api("/me?fields=id,name,email,cover,birthday,website,gender,bio,location,verified");
		}
		// user found, but permissions denied
		catch (FacebookApiException $e) {
			header("Location: index.php");
			exit;
		}
	}
(2013-07-11, 05:51 PM)MuslimBB Wrote: [ -> ]bro i checked the root file and the inc/plugins and i have 1.1 and its not anywhere in the file on line 113 (i use notepad++)

I did find this under the comments dont stop the magic and dont stop the magic, again!
I found this but its on line 83 another on line 106
// user found, but permissions denied
	catch (FacebookApiException $e) {
		error($lang->sprintf($lang->myfbconnect_error_report, print_r($e)));
	}

I edited those two lines and it does return to index but with added characters???

it adds this to the addressbar: index.php#_=_

This is the code now

// don't stop the magic
if ($mybb->input['action'] == "do_fblogin") {
	
	// user detected, just tell him he his already logged in
	if ($mybb->user['uid']) {
		error($lang->myfbconnect_error_alreadyloggedin);
	}
	
	// user found and logged in
	try {
		// get the user public data
		$userdata = $facebook->api("/me?fields=id,name,email,cover,birthday,website,gender,bio,location,verified");
		// let our handler do all the hard work
		$magic = myfbconnect_run($userdata);
		if ($magic['error']) {
			$errors = $magic['data'];
			$mybb->input['action'] = "fbregister";
		}
	}
	// user found, but permissions denied
	catch (FacebookApiException $e) {
			header("Location: index.php");
			exit;
	}
}

// don't stop the magic, again!
if ($mybb->input['action'] == "fbregister") {
	
	// user detected, just tell him he his already logged in
	if ($mybb->user['uid']) {
		error($lang->myfbconnect_error_alreadyloggedin);
	}
	
	// get the user
	$user = $facebook->getUser();
	if (!$user) {
		error($lang->myfbconnect_error_noauth);
	} else {
		try {
			// get the user public data
			$userdata = $facebook->api("/me?fields=id,name,email,cover,birthday,website,gender,bio,location,verified");
		}
		// user found, but permissions denied
		catch (FacebookApiException $e) {
			header("Location: index.php");
			exit;
		}
	}

I'm sorry it's not on line 113 but it's on line 106.. but you've done the right thing..

yes .. it's alright .. and i have also solution for the '_=_' that get added to the address bar. It will become index.php# but nothing to worry about that.

add this to templates > your template > ungrouped templates > header include
Quote:<script type="text/javascript">
if (window.location.hash == '#_=_'){
window.location.hash = '';
}
</script>


@@@@@@@@@@@@@@@@@@@@@@@

I've found a bug with this plugin which I'm trying to resolve right now.

when a user registered via myfbconnect.. picked a username then logged in..

logged out.. then..

go to > yoururl.com/myfbconnect.php?action=fbregister

The user will be redirected to the registration page where he/she can pick a username again ..

and will be logged in with the new username..

and you can do it unlimited times. Thank you for this plugin, however, this needs to get patched.. (v1.1.1 I guess).