• Hello everyone,

    I need some guidance in linking user privileges for 13 blogs located in all these sub-domains.

    ——————–
    ab.jobortunity.ca
    bc.jobortunity.ca
    mb.jobortunity.ca
    nb.jobortunity.ca
    nl.jobortunity.ca
    ns.jobortunity.ca
    nt.jobortunity.ca
    nu.jobortunity.ca
    on.jobortunity.ca
    pe.jobortunity.ca
    qc.jobortunity.ca
    sk.jobortunity.ca
    yt.jobortunity.ca
    ——————–

    What has been done so thus far?

    1. I have installed WordPress 3.2.1 to allsub-domains, with individual prefix for every single one on of them into one database.

    2. I wanted all users to share one _users table and one _usermeta table, to have universal login and registration privileges across all these sub-domains.

    So, I saved and modified my first blogs _users, _usermeta tables from the database to my computer in a sql format. I then renamed the tables as universal_users and universal_usermeta, the same was done inside these user tables. Saved and uploaded back onto the same database.

    3. After all that was done, the following took place, I have added the following code to all the wp-config.php files.

    define('CUSTOM_USER_TABLE', 'universal_users');
    define('CUSTOM_USER_META_TABLE', 'universal_usermeta');

    Went back to the website, and performed a test. I encountered the error: ‘You do not have sufficient permissions to access this page.‘.

    So, I went back to the wp-config.php file, and changed the code to use the original _usermeta of each blog, but left the universal_ prefix for users. Went back to test, and it worked. I could use one admin username accross all 13 blogs, so I desided to add a new user named “testuser” and see If I can post on all blogs, and for sure it worked like a charm.

    4. I noticed one problem, when inside dashboard as “testuser” the extra details for the profile did now follow, such as firs name, last name, etc. Because the _usermeta was not universal.

    So then I went back on Google to do more research, since now I need one _usermeta file across all the blogs, but without the error for the login. So I went back to research on Google, and came accross this page: https://www.ads-software.com/support/topic/how-to-use-2-blogs-with-the-same-users?replies=17

    5. After reading the whole article, I resided this is what needs to be done, and to give it a try.. Uploaded the wp-settings.php file onto my machine, and looked for:

    $wpdb->users = $wpdb->prefix . 'users';

    and

    $wpdb->usermeta = $wpdb->prefix . 'usermeta';

    but they are no where to be found.. so what now? I’m confused, did these change in the 3.2.1 version?

    I checked the capabilities.php file, and the code I need to change is there:

    $this->cap_key = $wpdb->prefix . 'capabilities';

    Any help would be greatly appreciated. Or if this has been covered before for the new version of wp, and could possibly point me in the right direction. Thank you in advance, and sorry for the long read.

Viewing 12 replies - 31 through 42 (of 42 total)
  • Thread Starter Alex.R

    (@alexr-1)

    @meloniq I’ll test your new plugin on the job roller network. Right now, all users can login anywhere troughout the provinces, but when they visit the other province, they need to login again in order to access dashboard.

    Thread Starter Alex.R

    (@alexr-1)

    @meloniq testing it right now.. I have all the prefixes set for all the wp installations.. but here’s my question for you, I have a custom _usermeta, _users sql structure that all of them use.

    Example: network_usermeta, network_users

    Couldn’t I just point to this prefix as the main one ( network_ )

    I’ll test it both ways.. thought I would ask you before moving forward.

    Thread Starter Alex.R

    (@alexr-1)

    Okay so far it work great, still need to play with it some more. I just made a small mistake, I chose to make default user capabilitis as job seeker, and so when all the prefixes have been entered, it changed the administraor capabilities to job seeker, and ended up locking me out of the admin panel.

    I would suggest adding an extra line of code to the plugin where it leaves the Admin user roll as default or something. Not sure if it’s possible to do that, just a heads up, some people might lock themselves out.

    The ways I got back in is trough the phpMyAdmin

    had to change the user capabilities to: a:1:{s:13:”administrator”;s:1:”1″;} from a:1:{s:13:”job_seeker”;s:1:”1″;} in my case.

    Let say that you have blog A, B and C.
    You store users and thier meta in table of blog A.
    In configuration of plugin you set prefixes “a_ , b_ , c_”.
    Default role you set to Job Seeker.

    When user register on blog B as a Job Lister, and then try to login on blog C, plugin will search for roles saved for other blogs…
    means will try to get “a_capabilities, b_capabilities, c_capabilities” to assign the same role, in this case should find it in blog B capabilities meta, and copy it to blog C. Only if script didn’t found any role, will set default one.

    Thread Starter Alex.R

    (@alexr-1)

    @meloniq it wont work, when I set user defailt to JobSeeker only, it keeps chaning my capabilities from Administrator to JobSeeker. I’ve added all 13 prefix’s to the plugin configurations, and had it installed on the Ontario JobRoller. When changing provinces from on.mysite.ca to bc.mysite.ca or any other subdomain it will not follow.. ??

    Are you willing to talk with me over Skype, and maybe we can figure out a way to make this work. I’m willing to pay for your time. I just want to get this to work. I’ve tried everything possible, and still cant get this to work.

    Since JobRoller uses 3 custom roles, it’s hard to have one user roll for all of them. If there’s a way to make it so each user roll can adopt a user roll.

    So, basically the way you have your plugin setup x3 — 1st. would be Job_Seekers with all the prefix / 2nd. Job_Listers all prefix / 3rd. Recruiters and all prefix.

    Like that, whenever the user selects their roll, they will be able to go wherever they want throughout my job network.

    templs

    (@templs)

    Hi there!
    First of all, wish to say Thanks to all for this thread and replies (especially Alex and Meloniq)!

    I’m trying to configure 2 WP installations. I need it to be separate blogs and multisite feature can’t help me. And I really need this because second blog should contain huge database of agencies and it would be just nightmare if both blogs will share one posts table in DB.

    My steps in short.
    1) Setup blog A with default $table_prefix = ‘wp_’;
    2) Setup blog B with $table_prefix = ‘hha_’;
    3) Set CUSTOM_USER_TABLE&CUSTOM_USER_META_TABLE for blog B to wp_users&wp_usermeta
    4) Added 2 new meta for admin (as Meloniq described above).
    Now blog B uses wp_users&wp_usermeta tables (from blog A), I can login on both.
    5) Installed plugin WP-Orphanage on both blogs. But in my cases it doesn’t looks like it on screenshot. It only contains dropdown Choose Default Role, but Add WP prefixes not appear.
    6) And even here I’ve got troubles with cookies (but both blogs on one domain! no subdomains). I mean if I login on one of blogs, I need to login on second again.

    7) Good news!
    I found this plugin – root Cookie.
    According to description it works with last versions of WP (3.3.1). And can be used across subdomains!

    But bad news: it looks like something wrong with this plugin.
    It didn’t change cookie path for test_cookie and wp-settings-time-1 cookies.

    I feel we can find perfect solution here ??

    —OFF-TOPIC—
    Alex, thanks for sharing your resources. After checking them I found great Resume&Jobs plugin ??
    I’ve spent days but didn’t found this, and now here it is!
    From my side I wish to recommend you to check WP-SimplyHired API. I’m using it on one of my sites for US, but it can be configured for Canada (simplyhired.ca).

    meloniq

    (@meloniq)

    Re: templs
    If blogs are in sub directories see post: https://www.ads-software.com/support/topic/universal-login-for-13-blogs?replies=37#post-2454164

    Downloaded and installed “WP-Orphanage Extended” and everything looks like on screenshot?! maybe You installed wrong plugin, means “WP-Orphanage”?!

    Links to both:
    WP-Orphanage : https://www.ads-software.com/extend/plugins/wp-orphanage/
    WP-Orphanage Extended : https://www.ads-software.com/extend/plugins/wp-orphanage-extended/

    templs

    (@templs)

    Hi Andrzej,
    Thanks for quick reply!

    I really installed WP-Orphanage instead of WP-Orphanage Extended ??
    Sorry for confusing…

    Those are test blogs, I can give full access if needed. Can I use email specified here?

    templs

    (@templs)

    So, I’ve disabled root-cookie plugin and installed WP-Orphanage Extended. Set wp_ & hha_ prefixes in plugin settings for both blogs.
    Defined cookies like here.

    Unfortunately multi-login doesn’t work…
    I login to the blog A. When I visit blog B – appears wp-admin-bar in the top (the bar for blog B). But when I try visit dashboard it redirects me to login page.

    templs

    (@templs)

    I’ve disabled WP-Orphanage Extended and enabled root-cookie again.
    All variation of login/logout now it works!
    In first my try with root-cookie I didn’t defined cookies in wp-config.
    But in the last try I just forgot to remove defined cookies. And looks like login works like a charm even with subdomains! ??

    I’ll make second test on another blog and get you updated.
    I need to try make it work with buddypress.

    I’ve combined Step-by-Step solution here. It works with WP 3.3.1.
    BuddyPress & bbPress not tested yet.

    I’m sharing little script there that helps with giving access for admin. No need fixing that issue via phpMyAdmin.

    Many Thanks to meloniq!

    Hello,
    I did all these steps but i still have a problem,

    my maindomain Admin can’t be a manager also in sub-domain WP!
    for user it work perfect, but not for admin.

    I did really everything but no way : https://www.ads-software.com/support/topic/2-blogs-with-same-login-and-db-problem-with-cookies?replies=5

    May you help me please????

    Thank you.

Viewing 12 replies - 31 through 42 (of 42 total)
  • The topic ‘Universal Login for 13 Blogs’ is closed to new replies.