User Management

DaveSYH

Joined: 2007-10-09
Posts: 7
Posted: Sat, 2007-10-20 03:28

Currently, users of WP get user access to Gallery2 as standard.

I would like WP users who register in WP, ie provide an email address and get password by email, to be granted Registered User status in Gallery2, for which I have set up to allow upload for Registered Users, but not just ordinary Users.

I can do this manually through G2 Users menu.

Is there an automatic option / solution?

Thanks!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-10-21 12:30

i don't know the WPG2 integration very well, but i'd be suprised if registered WP users wouldn't automatically be in the "registered users" group of g2 as well.

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

 
gfindlay

Joined: 2006-07-06
Posts: 20
Posted: Sun, 2007-10-21 12:33

Yep, this should work fine:

Hunt the plugins site for the "Role Manager" plugin (or just go here http://www.im-web-gefunden.de/wordpress-plugins/role-manager/). Use this to add the gallery user property to whatever user roles your registered users default to.

This means that any registered user should automatically get a gallery user connection instead of just a guest connection.

 
gfindlay

Joined: 2006-07-06
Posts: 20
Posted: Sun, 2007-10-21 12:47
valiant wrote:
i don't know the WPG2 integration very well, but i'd be suprised if registered WP users wouldn't automatically be in the "registered users" group of g2 as well.

Nope, you have to explicitly give your users their gallery access.

 
DaveSYH

Joined: 2007-10-09
Posts: 7
Posted: Sun, 2007-10-21 16:49

The Role Manager plug in did the job just great. WP registrants can now get G2 user status automatically!
The plugin is straightforward and easy to install and use.

I now have one last wrinkle to sort out. I have two domains, sharing one gallery. As long as you get to the gallery through the domain you are registered in it works wonderfully.

If you swap between domains, and they are well cross-linked, and go to the gallery, it forgets who you are again, unless you re-register through the new domain.

I would like WP users on one site to get the same status on the other site, without having to register twice.

This is probably more of a WP problem than a Gallery problem, but again I welcome ALL hints!

 
gfindlay

Joined: 2006-07-06
Posts: 20
Posted: Mon, 2007-10-22 19:26

OK, what you need is a couple of things:

1. Access to wp-config.php for the 2nd blog.
2. phpMyAdmin for access to the usermeta table from the first blog.
3. the prefix for the tables for BOTH blogs.

Right, let's assume that the prefixes are "wp1" for the main blog and "wp2" for the 2nd blog.

OK, go into phpMyAdmin, and in wp1_usermeta, look for an entry with a meta_key of "wp1_capabilities" for the user_id of your admin user (look at the Users panel in the main blog dashboard for that number)

Copy the "meta_value" field contents to a NEW record with a umeta_id of the function "LAST_INSERT_ID", meta_key "wp2_capabilities" with the same user_id value.

Then, in the wp-config.php for the 2nd blog, add the following lines at the top...then you're done.

define('CUSTOM_USER_TABLE', 'wp1_users');
define('CUSTOM_USER_META_TABLE', 'wp1_usermeta');

This depends on the blog being, basically, empty and fresh, otherwise you'll also have to go through phpMyAdmin to change user_id values in every other table to match so users can edit existing posts, etc. You could also just do the 2 define entries, then log in with the fresh "install created" admin id for the 2nd blog, then set the user roles for the 1st blogs users.

That's it. Simple. I just did it and it works perfectly.

HTH

 
DaveSYH

Joined: 2007-10-09
Posts: 7
Posted: Mon, 2007-10-22 22:44

gfindlay - you are a scholar and a gentleman (or maybe gentlewoman - tis hard to tell over the internets)

I will be attempting to follow these this evening after I manage to combine both sites onto the same database.
At present, although the Gallery is on one database, the sites are on two distinct databases.

I will attempt to back up what I can, move one over to the other database, and then carry out the above.

Luckily both are very new with only a couple of posts, comments and users.

This is all at th every edge of my abilities, so wish me luck.

Many Thanks Again

Update
Oops - wiped out one site by overwriting one with another...

but pressing on regardless.

 
DaveSYH

Joined: 2007-10-09
Posts: 7
Posted: Mon, 2007-10-22 23:02

Update: I wiped out one site accidently. So did the two define lines, in the new config.php and renewed the blog.

Like magic, it is sharing users. THANK YOU.

Now all I have to do is rebuild the one site (no backup - DUH) and I'm all set.

 
gfindlay

Joined: 2006-07-06
Posts: 20
Posted: Tue, 2007-10-23 17:48

Well, at least the site was small so not too bad, but glad it worked for you.