LampCMS development and php tips

Announcements and articles about this site development and stuff like that

Integrating Google Friend Connect GFC with out login system
Sun Nov 29 2009
The clsUser and clsProfile are 2 classes that represent data about currently logged in user
These 2 are instantiated (or reset) when user logges in to site.
Actually they are instantiated regardless of user status - logged in or not, they are still instantiated.
If a user is logged in, then during instantiation the user data is used from the SESSION to populate these objects.

Now I'm going to slighly change it to actually make these 2 objects serializable to that they can be stored in session. This will (supposedly) make it easier to integrate the GoogleFriendConnect login with the existing login system

One thing to considet is how the same user can be both a member of our site and also a FriendConnect member. This is possible, it's well described on GFC site

http://code.google.com/apis/friendconnect/serverside_integration.html

OK. But how can a user possibly log in as friendConnect user when he is already logged in to our site as a regular user? I mean when someone is already logged in, then a login form is no longer shown.

I guess the only way to let already logged in user to also use his Friend Connect account is to present the FriendConnect button even if user is logged in as regular user. This actually would mean that we should treat these 2 login forms separately, even though they are usually shown side-by-side

The problem (small problem) with that is that if user already signed in as FriendConnect user then it will be ugly to alwasy render a regular log-in form on pages. This will not look right, I mean a user is already logged in as far as he is concerned.

So, if user is logged in with FriendConnect, then we don't need to ask him to login using our own form, no do we ask him to register on our site. After all, this is the whole purpose for us to integrate a FriendConnect login.

But, if user is logged-in as a normal member of our site he can still benefit from logging in again with his FriendConnect button because he can make use of his friends data from his Google friends account.

This makes it somewhat complicated. But this may be the way to go.