Viewing 11 replies - 16 through 26 (of 26 total)
  • taffeljohan

    (@taffeljohan)

    Glad I could help.

    wolthers

    (@wolthers)

    Hello everyone. This helped me alot. I messed up when copypasting some of the code so i thought i’d make a clean version without typos. Here it is:

    In ALL of my installs:
    in wp-config.php:
    added just above /* That’s all, stop editing! Happy blogging. */:
    define('CUSTOM_CAPABILITIES_PREFIX', 'wp_');

    in wp-includes/capabilities.php:
    replaced:
    $this->cap_key = $wpdb->prefix . 'capabilities';
    with:

    if (defined ('CUSTOM_CAPABILITIES_PREFIX')) {
    	$this->cap_key = CUSTOM_CAPABILITIES_PREFIX . 'capabilities';
    	}
    	else {	$this->cap_key = $wpdb->prefix . 'capabilities';
    	}

    In all installs EXCEPT the original:
    in wp-config.php:
    added just above /* That’s all, stop editing! Happy blogging. */:

    define ('WPLANG', '');
    define('CUSTOM_USER_TABLE', 'wp_users');
    define('CUSTOM_USER_META_TABLE', 'wp_usermeta');

    AND replaced:
    $table_prefix = 'wp_';
    with
    $table_prefix = 'anyotherprefix_' //the prefix has to be unique for each installation

    wolthers

    (@wolthers)

    With this, although I can use the same users on all my installs flawlessly, I have to log in each time i enter a new blog. Does anyone know how to share the cookies so you stay logged in?

    // Michael

    taffeljohan

    (@taffeljohan)

    I hate to edit the core files everytime I upgrade. Should we enroll this lines to the wordpress trac? Any tickets already?

    if (defined ('CUSTOM_CAPABILITIES_PREFIX')) {
    	$this->cap_key = CUSTOM_CAPABILITIES_PREFIX . 'capabilities';
    	}
    	else {	$this->cap_key = $wpdb->prefix . 'capabilities';
    	}

    @hudatoriq: There are trac tickets here and here. The conclusion was that this is ‘broken’ on purpose to give you the ability to assign user capabilities on a per-blog basis even when the user tables are shared (something I am learning to appreciate as the number of blogs comprising the site I build and maintain grows). But allowing for definition of CUSTOM_CAPABILITIES_PREFIX in wp-config.php sounds to me like a good idea. Trac it!

    This is a good idea, but it’s not mine :-). If this is going to be added in Trac, I prefer to let the one who brought this idea to take the credit :-).

    But if others don’t have time to file the ticket, I can help. I think I’ll wait 1-2 weeks. If there is no one to do it, I’ll file it with links to this & some other related threads.

    This won’t make it into 2.7 anyway..

    Hi All

    As usual I’ve been impatient and jumped staright in to uploading 2.7 to all my blogs and now none of them work. They used to all share the same tables except the options table.

    Does anyone know how to make this work in 2.7 ?

    Thanks

    @neil T

    Not sure. But they should work fine. I share user & usermeta table and they work in 2.7.
    Have you upgraded both site’s database?
    Have you hack the capabilities.php again after the upgrade? It’s overrided so you have to modify the lines again.

    Hi all,

    I have 3 WordPress Installations on my website, two blogs and one news. I am sharing the users table but don’t know how to make them work with a single login. I see it can be achieved for 2.6, could it be done in 2.7? Would it be the same steps as described here?

    Thanks!

    Two questions:

    Following the instructions here, I too was able to share the user tables between multiple WordPress 2.7 installs. However, when writing a post in any of the non-primary blogs, the shared users don’t appear in the Author drop-down box. What am I missing here?

    Also, when registering a new user from a non-primary blog, by default that user’s data gets entered into the non-primary blog’s user table. Is there any way to make it so that new users registered on any blog get entered into the shared user table?

    Thanks in advance for any input.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘WordPress 2.5 Share users table’ is closed to new replies.