WordPress.org

Ready to get started?Download WordPress

Forums

Set registration to a blog of my network (11 posts)

  1. Erriko
    Member
    Posted 3 years ago #

    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 :)

  2. Read this thread: http://wordpress.org/support/topic/adding-all-new-users-to-main-site?replies=43

    IIRC we sorted out the code for that.

  3. Erriko
    Member
    Posted 3 years ago #

    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 :(

  4. Which plugin are you using?

    We may need to rope that dev in for help.

  5. Erriko
    Member
    Posted 3 years ago #

  6. http://wordpress.org/extend/plugins/user-role-editor/ then :)

    Do you know if it's MultiSite capable?

  7. Vladimir Garagulya
    Member
    Posted 3 years ago #

    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.

  8. Erriko
    Member
    Posted 3 years ago #

    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...

  9. Vladimir Garagulya
    Member
    Posted 3 years ago #

    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
    http://wordpress.org/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.

  10. Erriko
    Member
    Posted 3 years ago #

    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?

  11. Vladimir Garagulya
    Member
    Posted 3 years ago #

    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 http://shinephp.com Contact form.

Topic Closed

This topic has been closed to new replies.

About this Topic