• Hi!
    I need some help to figure out how to automatically add every new registration to the main site of my network.
    At the moment every new user is registered to the network, but if I want to add him to the main blog I have to access the main blog dashboard and use “add user”.
    Can I set this as default?

    Thank you in advance, every input is appreciated ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Read this thread: https://www.ads-software.com/support/topic/adding-all-new-users-to-main-site?replies=43

    IIRC we sorted out the code for that.

    Thread Starter Erriko

    (@erriko)

    Thank you for you help. I’ve tried it, but it works at the 50%.

    I use role editor to set a non conventional default user role.

    I dugg into phpMyAdmin to see how it was stored, and I saw it is stored as the name of this role without capital letters.
    It is stored by brackets, in the same way as administrator or subscriber is.

    I set this value in default_user_role but when I try to register the new user is added to the main site but it can’t log into the dashboard. WordPress says you haven’t permissions.

    I’m sure it is caused by the user role, but I can’t figure what value is suitable to make it work ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Which plugin are you using?

    We may need to rope that dev in for help.

    Thread Starter Erriko

    (@erriko)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    https://www.ads-software.com/extend/plugins/user-role-editor/ then ??

    Do you know if it’s MultiSite capable?

    By default URE plugin works with current site only. If you need to replicate changed or created role to all sites of the network you may turn on ‘Apply to all sites’ checkbox before press the ‘Update’ button.

    Erriko, did you create new role for all sites? Please be aware that setting selected role as default – works for current site only. So you need to go to every site and change default role if you need all sites of your network use the same role as default one.

    Thread Starter Erriko

    (@erriko)

    Actually I have user registration active only for the main site. Other blogs have only 1 user (the corresponding admin).
    My issue here is that a new user is registered to the network and not to all sites, nor just one. I have to use “add user” to make an user be part of a site…

    I’m sure if you follow Ipstenu recommendations and setup simple plugin in wp-content/mu-plugins folder, e.g. single activate-user.php file with the code mentioned at
    https://www.ads-software.com/support/topic/adding-all-new-users-to-main-site?replies=43

    <?php

    function _activate_user( $user_id, $password, $meta )
    {
    // Ensure that new users are registered to the main blog
    add_user_to_blog( '1', $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
    }
    add_action( 'wpmu_activate_user', '_activate_user', 10, 3 );

    ?>

    you will resolve your issue with new user registration at the blog 1 automatically.

    Thread Starter Erriko

    (@erriko)

    I tried it but it doesn’t work with the user role. I changed ‘subscriber’ with ‘differentrole’ but it make the user not allowed to login after activation.
    The value ‘differentrole’ comes from PhpMyAdmin, I retrieved it from the table of users and it is showed in place of ‘administrator’, ‘subscriber’ etc in the users already associated with this role…

    Any ideas?

    Did you try to login on the site where new activated user is really registered?

    If it’s possible for you to give me super-admin access I could try to investigate the problem on-site. If Yes, send me a message using https://shinephp.com Contact form.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Set registration to a blog of my network’ is closed to new replies.