User Synchronization : how to?

lubanoo

Joined: 2010-02-06
Posts: 5
Posted: Sat, 2010-02-06 09:01

Hello,

I am currently trying to embed G2 in my web site.

I have read the following doc :
http://codex.gallery2.org/Gallery2:Embedding:Integration

But regarding the User synchronization I am a bit confused.
What is the "Map by entityId denoted Map_by_entityId_cache" ? Is it a specific table inside G2?

I only have a few users in my website for the moment. I think & I would like to do the mapping manually if someone explain me how to do it.

Here is the extract from the integration doc:

Quote:
Get cached lists of EmAppUsers, G2Users and Map by entityId denoted as EmAppUsers_cache, G2Users_cache and Map_by_entityId_cache respectively;
For each g2User in G2Users_cache do
if g2User NOT in Map_by_entityId_cache then
Create User in EmApp with user data from g2User;
Insert new mapping into Map;
end if;
end for;
Get cached list of Map by externalId Map_by_externalId_cache;
For each emAppUser in EmAppUsers_cache do
if emAppUser NOT in Map_by_externalId_cache then
Create User in G2 with user data from emAppUser;
Insert new mapping into Map;
else
Update User in G2 with user data from emAppUser;
end if;
end for;

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2010-02-06 13:02

Have you seen my easy embed tool?

Which app are you trying to embed gallery with?
Do your users have ids or just usernames?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
lubanoo

Joined: 2010-02-06
Posts: 5
Posted: Sat, 2010-02-06 14:41

Yes i have seen your tool which seems to be great but i am not sure it could reply to my needs.

This is my concerns:

My web site already have :
- Gallery 2
- PHPBB3

For the moment users are managed separatly and i want that to be unified : The user arriving to my web site should have to log only one time for the whole site.

As I understand, the first thing to do is to synchronize users between phpbb and Gallery2.

Which means :
- more or less create existing PHPBB on G2 and, create existing G2 users on PHPBB3
- create on G2 a link between PHPBB userID & G2 user ID

I would like to understand how to do that and if possible how to do it manually as the number of users are not very big on my site for the moment.

Regards,
Lub.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2010-02-06 14:51
 
lubanoo

Joined: 2010-02-06
Posts: 5
Posted: Sun, 2010-02-07 06:34

Sorry I was not very clear.

I don't want to embed G2 into phpBB or phpBB into G2.

I just want to keep the user login session between all the tools (Php BB, G2, my other pages, future other tools).

As I understand, the phpbb3 package is here to embed gallery2 into phpbb3. I don't need this.

So:
- When the user creates an account, this should be created into phpbb user table and gallery2 user table.
- When the user login in, he should keep its user session opened when he goes to phpbb, gallery2, other pages, etc.

But before that, I need to sync the current users of phpBB and gallery2.
Creating the existing user of phpBB into G2 and vice versa should be easy but I don't know how to say to G2 that the phpBB userID is linked to the G2 user ID.

Best regards.

PS : the source forge link provided in the gallery2 embeding page :
http://cvs.sourceforge.net/viewcvs.py/gallery-contrib/embed/

does not work.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2010-02-07 12:58

You really need one app to control all the users. Mapping from phpbb to gallery is easy enough, but mapping back is another story.
Gallery allows for a user to have an "externalId" as well as an internal id, as far as I know phpbb does not.
And if you throw another app into the mix... good luck.
I can show you examples of how to map external users to G2 and how to initialize a gallery session using this externally mapped user if you wish.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
lubanoo

Joined: 2010-02-06
Posts: 5
Posted: Sun, 2010-02-07 19:08

Thanks a lot for your proposal. I am very interested by any examples you could provide me :-)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2010-02-08 13:14

As I started to put together examples from my app... and having to reconstruct them into a more generic form so they would be easier for someone not familiar with my app...
I realized you could get the exact methods you need from the phpbb3 integration app mentioned above. Already written with the correct variables and phpbb method references.
Look to it for your examples.

Personally I'd just use it.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
lubanoo

Joined: 2010-02-06
Posts: 5
Posted: Tue, 2010-02-09 05:28

Ok I will check that.