[wp-hackers] Sharing Users/authentication

Curt Woodard clwoodard at gmail.com
Fri Aug 31 01:15:35 GMT 2007


>> So, I cleared everything out (de-activated plugin, deleted rows from
>> wp_options, copied fresh plugin files) and tried again and here is
>> what is happening... slightly different now.
>
>Did you also clear the extra data out of the user_meta table?
>
>> Starting with two blogs without the plugin. I install the plugin on
>> the first (master) blog. Activate it. No errors. When I look at the
>> options it is showing the right database and prefix.
>
>So far so good.
>
>> Note: I can't logout of that blog, though... when I try to sign out
>> I just get
>> redirected to the same page in the control panel area I am on.
>
>That suggests to me that you have some problem that is unrelated to
>this plugin.  Nothing I know of in this plugin should prevent you
>from logging out.
>
>Deactivate the plugin in both blogs, and see if the logout problem is
>still there.
>
>Actually, first just clear your cache and see what happens. :)

Actually, have a look at your cookies, let me know if they are being
deleted when you log out. This tells me that they aren't and there
might be an issue with wp_clear_cookie...

>> At this point I see only one entry in the wp_options table.
>>
>> Go to second (slave) blog. Activate plugin. Go to options, put in
>> database name (it is a diff database) and prefix (which is the same).
>> No errors. I can sign out.
>
>I suspected this might be the case.  I emailed the plugin author
>separately asking just this a few minutes ago.  Is the login/password
>the same or different on the two databases?
>
>WAIT! I've got it!  The two have to have different prefixes.  Right
>now they both think they are the master blog.  This is a bug.
>
>(Though I'm still quite sure the "can't logout" problem is something
>unrelated to this plugin.)
>
>Hey Curt -- if you're reading this, my "auto detect Master/Slave"
>suggestion just hit a snag!  :0  Maybe test for both prefix _and_
>database name?

This has been addressed in the new release (v2.6 BETA). I am testing
against both database name and against prefix. If both database and
prefix are the same then you are in the master copy, otherwise you're
in the slave copy. This is because you either have them in different
databases or the same database with different prefixes. Now, if you're
on different servers, that's a whole different can of worms :)

I also set up the plugin so that it will copy over the user_level as well.

Let me know if this one works! http://www.lyonesse.info/WPP/

Chris:
I'd seen your previous message but this one came in where you're using
the *almost* latest copy (since I'd added changes before you get this
message). It looked like you were having issues pointing to the proper
database since in the query you showed us had ''.<table> the '' was
empty and should have had a table name in it. The new version of the
plugin automatically uses the DB name and prefix of the copy it's run
on. You have to change it on the options panel now (Options>SM2WP).

Go ahead and remove all the sm2wp_options or other options that start
with sm2wp_ in the options table of both your databases and also make
sure the usermeta table for the master is cleared up.

Keep in mind that there may be issues if you have members in both
tables since user_ids and usernames could overlap and cause problems.
It's best to start with fresh copies if you can. If you can't, make
your master a brand-new install with only the admin account. Then turn
the copy with all the users into the slave and let the info copy over.

-Curt

-Curt


More information about the wp-hackers mailing list