• Resolved eindc

    (@eindc)


    I had this working correctly at one point, but it has unfortunately broke since trying to upgrade to 2.3.2. My backup was incomplete, unfortunately, so I’ve lost the modified files that previously had this setup working.

    I have two separate WP installs that I’d like to setup to share a primary user table. All tables, etc. are on the same database.

    I’ve already changed wp_settings.php so that the tables section has the users and usermeta pointers pointing to the primary tables. Great, that part worked and both blogs at least recognize the users.

    I am, however, now getting an error saying that my user account (should be admin) doesn’t have the correct perms to access the wp-admin section. Like I said, this worked fine prior to upgrading. I updated the line in capabilities.php so that it points to the primary table. No luck.

    I looked at the tables on my WP database and there’s no capabilities table listed. Should there be? Any guidance is appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Here’s what I did – YMMV –

    /INSTALL_DIR/wp-includes/capabilities.php

    CHANGE THIS:

    function _init_caps() {
    global $wpdb;
    $this->cap_key = $wpdb->prefix . ‘capabilities’;
    $this->caps = &$this->{$this->cap_key};
    if ( ! is_array($this->caps) )
    $this->caps = array();
    $this->get_role_caps();
    }

    TO THIS:

    function _init_caps() {
    global $wpdb;
    $this->cap_key = ‘wp_intranet_capabilities’; // where wp_intranet is the prefix of the primary install
    $this->caps = &$this->{$this->cap_key};
    if ( ! is_array($this->caps) )
    $this->caps = array();
    $this->get_role_caps();
    }

    /INSTALL_DIR/wp-settings.php

    CHANGE THIS:

    // Table names
    $wpdb->posts = $wpdb->prefix . ‘posts’;
    $wpdb->users = $wpdb->prefix . ‘users’;
    $wpdb->categories = $wpdb->prefix . ‘categories’;
    $wpdb->post2cat = $wpdb->prefix . ‘post2cat’;
    $wpdb->comments = $wpdb->prefix . ‘comments’;
    $wpdb->link2cat = $wpdb->prefix . ‘link2cat’;
    $wpdb->links = $wpdb->prefix . ‘links’;
    $wpdb->options = $wpdb->prefix . ‘options’;
    $wpdb->postmeta = $wpdb->prefix . ‘postmeta’;
    $wpdb->usermeta = $wpdb->prefix . ‘usermeta’;
    $wpdb->terms = $wpdb->prefix . ‘terms’;
    $wpdb->term_taxonomy = $wpdb->prefix . ‘term_taxonomy’;
    $wpdb->term_relationships = $wpdb->prefix . ‘term_relationships’;

    TO THIS:

    // Table names
    $wpdb->posts = $wpdb->prefix . ‘posts’;
    $wpdb->users = ‘wp_intranet_users’; // where wp_intranet is the prefix of the primary install
    $wpdb->categories = $wpdb->prefix . ‘categories’;
    $wpdb->post2cat = $wpdb->prefix . ‘post2cat’;
    $wpdb->comments = $wpdb->prefix . ‘comments’;
    $wpdb->link2cat = $wpdb->prefix . ‘link2cat’;
    $wpdb->links = $wpdb->prefix . ‘links’;
    $wpdb->options = $wpdb->prefix . ‘options’;
    $wpdb->postmeta = $wpdb->prefix . ‘postmeta’;
    $wpdb->usermeta = ‘wp_intranet_usermeta’; // where wp_intranet is the prefix of the primary install
    $wpdb->terms = $wpdb->prefix . ‘terms’;
    $wpdb->term_taxonomy = $wpdb->prefix . ‘term_taxonomy’;
    $wpdb->term_relationships = $wpdb->prefix . ‘term_relationships’;

    highanx

    (@highanx)

    Do you have an upgrade to this patch for WordPress 2.5?

    Thanks

    It should be the same for 2.5.x. The names of the tables haven’t changed.

    Unfortunately this solutions does not work me.
    I have WP 2.3.3 and this one does not have a table wp_capabilities
    or wp_user_levels

    I used symlinks to create several instances of wordpress and applied the code from above to get one user table for each install but once I try to perform an action I am supposed to login .. although the login itself is working properly.

    I can login on the main site and all subsites but can only perform actions e.g. submitting a form on the main site.

    Edit: Just noticed if I login into a site I am only logged into that specific site and not any other sites although they are using the same tables.

    why not upgrade to 2.6.2

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Two Blogs, One User Table — Still having problems’ is closed to new replies.