Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

As the title suggests, If you had to synchronize WordPress user accounts across multiple domains and installations without using WordPress MU how would you do it?

share|improve this question
    
I am think based on the answers thus far that using some sort of openid system might be best. Letting users login with facebook accounts etc. –  Ash G Nov 11 '10 at 21:32
    
Yes but what about the meta data created by specific plugins? E.g. installation 5 has a plugin that adds "twittername" to the meta data or something. –  edelwater Nov 11 '10 at 21:40
    
Good point, though in this use case I don't think that will be an issue as my client has a very specific usage of the accounts and the users wont have access to the backend. –  Ash G Nov 11 '10 at 22:56

3 Answers 3

(side note) In wp-config you can set:

define('CUSTOM_USER_TABLE', $table_prefix.'my_users'); define('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta');

So I would expect this to work especially for the case when you have centralized your user database... but it does not: http://core.trac.wordpress.org/ticket/13323

(and a username/password for the remote database to get the info from)

I think this is the best way to go: 1 db with the user table and the user meta table.

Nacin writes here that there are multiple plugins who provide this functionality more robustly here so I assume there are plugins for this. (I have not found it yet).

I found: http://wordpress.org/extend/plugins/wpldap/ but that would require the different domains ("ldap" domains) are synchronized / have a trust relation. But as I read there must be other plugins for this this also.


Why I would NOT sync as indicated above and use a central database:

  1. The tricky thing is that the same user can have changed his password in installation 1 and in installation 2 OR a user is added in installation 1 under the same name as another user in installation 2 OR the user has another e-mail in installation 1 as in installation 2 etc..
  2. Even if you trigger the sync on any insert / update / delete (and rely on it to ahve convered all user databases there could be plugins that modify the meta user table and by which you lose control (so especially the user meta data creates lots of new use cases to take into account).

Writing your own sync e.g. with dbsync with some code around it to check for all synchronization cases is difficult because of all the use cases. there are many companies who have products for this for e.g. enterprise CRM systems interfacing with lots of other contact databases and which require cleansing and validation of user data but none are perfect.

Maybe you could also add additional requirements like "only register/update on site 1" and then use site 1 for all further synchronization. Then again... plugins that add specific user metadata... in e.g. installation 5 would not sync their changes to e.g. installation 3. So additional you need then a diff with the installation 1 with all other installation and ... if there are differences ... see if can cover them in as much as patterns possible. Treat the exceptions then as manual actions.

share|improve this answer
    
I'm using these defines quite successfully on my end... –  Denis Nov 11 '10 at 23:50
    
so ticket 13323 is bogus? –  edelwater Nov 12 '10 at 9:42
    
@Denis: Do they refer to a table on the same or on a different database? The ticket was about incorrect escaping of the tablename if it includes a database name (dbname.tablename becomes ' dbname.tablename' instead of 'dbname'.'tablename', where the single quote should be a backtick that I can't escape here). –  Jan Fabry Nov 12 '10 at 12:44
1  
I've all sites using shared user and usermeta, each with a different table prefix, all in the same database. –  Denis Nov 12 '10 at 13:59
    
ticket 13323 is about having the shared user tables in another database then the blogs database. that does not work. if the user table is within the same database, it works. –  hakre Nov 12 '10 at 22:41

You can use OpenID for user authentication, e.g. provided by the plugin OpenID. This is invariant over the whole web, so in particular for your n Wordpress installations.

Of course, Wordpress specifig user settings would not be synchronized.

share|improve this answer

Are they on the same webserver/mysqlserver?

If they share the same mysqlserver you can hook in the registration and add the user in more then one database.

Or you could create a file that includes a user via $_POST/$_GET, be sure it's protected with a token or something.

Thats what I would try to do.

share|improve this answer
    
HI,they will likely not share the same server –  Ash G Nov 11 '10 at 21:28
    
You would have to make certain that every single bit of user changing code honors this arrangement, in particular in every plugin you install. Not feasible. –  Raphael Nov 12 '10 at 10:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.