Shade- / MyFacebook-Connect

A plugin to integrate Facebook with MyBB, letting users login and register through Facebook.
27 stars 24 forks source link

Weird bug - unlink FB account, link again and secondary primary usergroup is added #72

Closed Eldenroot closed 6 years ago

Eldenroot commented 6 years ago

Steps how to reproduce: 1) Link your existing forum account with your Facebook account (log in via Facebook button or set it in UCP) 2) If you have let say usergroup "B" which is granted after 100 posts and you link your account again your secondary usergroup is added to your account (usergroup "A") according to the in ACP in MFC plugin setting.

I think that this is wrong behaviour, this should apply only to newly registered users, not to the existing accounts.

Shade- commented 6 years ago

MFC's destination usergroup applies to both new and existing users. New users get the usergroup as their primary, existing ones in their secondaries. Not sure what's wrong with that.

Eldenroot commented 6 years ago

I do not see any point to add secondary usergroup (for example "New registered user") for users with primary usergroup for example "Registered over 2 years".

At least you should add setting if it should apply as a secondary usergroup for already registered users.

Shade- commented 6 years ago

Alright, I see your point now. Might add an option for that.

Eldenroot commented 6 years ago

Thank you, it makes me angry, because I use secondary usergroups on my board and display them in postbit... so I have to manualy set them back...

Shade- commented 6 years ago

Fixed. Note that if you have already ran the upgrade script, you will need to apply the setting by yourself or downgrade to 3.3 and run the upgrade script when asked. To downgrade, you will need to edit mybb_datacache, search for shade_plugins row, and find MyFacebook Connect within the JSON string. You should see something like:

a:XX:{s:18:"MyFacebook Connect";a:2:{s:5:"title";s:18:"MyFacebook Connect";s:7:"version";s:3:"3.4";}}

Change the version to 3.3, then go to ACP > Tools and Maintenance > Cache manager > Rebuild cache for shade_plugins.

Replace the old files with the new ones, run the upgrade script.

Eldenroot commented 6 years ago

Isnt easier to release 3.4.1? ;)

Ok, I will do it, thank you

Shade- commented 6 years ago

You can also update the upgrade script's version from 3.4 to 3.4.1 here. I do not plan to add 3.4.1 so you'll be fine with the change.

Shade- commented 6 years ago

You will also need to update to 3.4.1 here in order to get the upgrade script notice.

Shade- commented 6 years ago

(note that the version you are testing is a pre-release, hence why 3.4.1 won't be released).

Eldenroot commented 6 years ago

Thank you!

Shade- commented 6 years ago

Does it work as expected? I'm aiming towards a release by this evening.

Eldenroot commented 6 years ago

Works fine, at least it seems to be. Thank you