User external registration

raistlin
raistlin's picture

Joined: 2007-11-09
Posts: 2
Posted: Sun, 2007-11-11 20:20

Hi,

I have installed Gallery2 on my website, and it works very well.

But I need to add users with php file of the website. I tried to work directly with database and to include the GalleryEmbed.class file with successless...

Could someone help me?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-11-11 20:36

please read:
documentation -> installation -> embedding / Integration.

if you have questions, please be more specific than "help me". :) else it's hard to give you answers.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
raistlin
raistlin's picture

Joined: 2007-11-09
Posts: 2
Posted: Mon, 2007-11-12 19:38

Your answer is that I searched, i will try now to embedd G2, it could be easyer to add new users...

The first problemm was : add user but not by G2 system, with a php file out of G2 directory.

 
median_cz

Joined: 2007-12-05
Posts: 1
Posted: Thu, 2009-02-19 16:18

Hi,

You need to take care of 3 tables: g2_Entity, g2_User and g2_UserGroupMap.
First create test user record via registration process. Confirm the registration (if confirmation is enabled in admin). Look in the g2_User table, that the record is present.

Now for external registration:

1) Create unique entity record (with unique ID) in the g2_Entity table. It must be GalleryUser "entityType" (look for the test user ID in the table)
2) Create new user record in the g2_User table. You will need to generate encrypted password. Use MD5 or GalleryUtilities::md5Salt (core class function).
3) Put the user in groups (g2_UserGroupMap) (userId, groupId) - again, look for an example (test record).

Now you can login. If you can't login, try to disable Gallery2 cache in the admin section.

 
josno

Joined: 2007-09-17
Posts: 10
Posted: Thu, 2009-02-19 17:38

Are you using Gallery2 embedded? Why do you want to create Gallery2 users - are you importing them to migrate from one system to another, or do you want to log in with a separate application and have that application log your users in to Gallery2?