HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[SOLVED] Facebook Integration

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#84380 (In Topic #17439)
Avatar

Honoured member

This one is going to take a bit of explaining, so bare with me.

I have a personal facebook account and a blog facebook account. I have my ocPortal admin user linked to the blog facebook account.

Today I was using my personal facebook account. I popped into the blog, and a new user was created on my ocPortal site based on the info on personal facebook account. This is fine, i love the one click registration that the fb integration gives, but it gave me an extra ocPortal account.

So this new user was created based on my personal facebook account. I logged out of my personal facebook account and logged into my blog, so that i could be logged in as admin on my ocPortal site.

At some point my ocPortal site changed my admin username to Ollie Evans. When i accidently created the other ocPortal member using my personal facebook account it also used the name Ollie Evans.

So that i could tell the difference between the accounts i renamed the ocPortal account created by my personal facebook account to 'TEST ACCOUNT'.

At some point ocPortal has got confused and i now have some forum threads appearing as posted by 'TEST ACCOUNT' but with the post count/profile info of my main admin account.

In a nutshell i have a couple of threats showing as created by the account i created accidently when i clearly remember logging out. Im guessing the error appeared when both accounts had the same username.

Im really sorry about how confusing this is, but i wanted to give you a bit of background as i have a feeling this may cause problems for anyone who has two facebook accounts.

Edit: Here is a link to a thread where this problem has presented itself. Keep in mind that the first two threads were created with my main admin account, but have now been hijacked by the duplicate account based on my personal facebook


Last edit: by Ollie8557
Back to the top
 
Posted
Rating:
#84420
Avatar

Ergh, okay I think I get the gist ;).

Three key facts involved:
  1. Facebook (FB) is very persistent at maintaining its logins to sites. Once you activate it the only way to stop it forcing you back into the FB-connected account is to remove permission for your app on your Facebook account settings.
  2. The username of the FB-connected account will be synched on each login. So if you rename it manually, it'll get renamed back.
  3. The FB username syncing doesn't update the usernames attached to posts like what happens when you manually do a rename by editing an account. I've attached a fix for this.

Attachment
sources_custom/facebook_connect.php
» Download: facebook_connect.php (10 Kb, 123 downloads so far)


If you need to manually intercede in the database, you can run a query like:

Code

UPDATE ocp_f_posts SET p_poster_name_if_guest='whatever' WHERE id=12345

(12345 is the member ID, 'whatever' is the new username)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#84957
Avatar

Honoured member

Cheers Chris, glad my post made sense, i had a hard time explaining as you can probably tell!

I uploaded the file and ran a few versons of the query. Hopefully that will prevent the problem in the future.

The above mentioned forum topic where the problem first presented itself still has Test Account as the username, should the query have fixed this?
Back to the top
 
Posted
Rating:
#84965
Avatar

The above mentioned forum topic where the problem first presented itself still has Test Account as the username, should the query have fixed this?

Yes. The 'p_poster_name_if_guest' is what you are seeing.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#85104
Avatar

Honoured member

Thanks Chris. I uploaded the file and ran the query and it didnt fix the two forum posts mentioned, but i havent come across the problem again, despite having to log in and out of accounts quite frequently. So i think the issue is solved :) Cheers
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: