The MU forums have moved to WordPress.org

Selective Signup (2 posts)

  1. youngmicroserf
    Member
    Posted 13 years ago #

    Hi,

    I've just installed WP 3.0 and I'm experimenting with the wpmu/multisite option and buddypress. I'm trying to have a second blog as a community blog that is open to all members while the main blog is only edited by a group of editors.

    So I have created a second blog, and I tried to create new user accounts for the second blog, but I ran into trouble. So I've spent a couple of hours to realize that doing what I want to do is hard in WP/MU/BB.

    I basically want users to have an extended profile and the ability to blog in the community blog. Yet I had to realize that it's practically impossible to restrict new members to their profile and the community blog dashboard. Once they're signed up, they will automatically have access to either the main dashboard or a "dashboard site" dashboard in addition to the one they can write for.

    Searching this forum I found the following code that I put into wp-content/mu-plugins -

    add_action( 'wpmu_new_user', 'ds_new_user_meta', 10, 2);
    add_action( 'wpmu_new_user', 'ds_new_user_meta_too', 99, 2);
    
    function ds_new_user_meta($user_id) {
    add_user_to_blog('4', $user_id, 'contributor');
    // adds every new user to blog_id 4
    }
    
    function ds_new_user_meta_too($user_id) {
    remove_user_from_blog($user_id, 1);
    //removes user from the main blog
    }

    This code is supposed to add the new user to the blog with the ID 4 and remove the new user from the main blog. Alas, it doesn't work as supposed to.

    I can *manually* assign "no role for this blog" to the new user *after* the user was created, but I'd want this to happen immediately. Basically, I don't mind the single database for users as long as community blog users cannot ever access the main blog's dashboard or aren't confused by a redundant dashboard blog when all they need is an ability to edit their profile and write on the community blog - if possible even via front-end editing.

    Manually assigning "no role for this blog" randomly works for hiding the main blog entry from the BuddyPress navigation bar. I've also created a role "member" (using the members plugin) without *any* privileges and was able to choose it as default new user role in the superadmin network options, but when I signed up a user, the new user still appeared as contributor. I had hoped that the new user would appear as "member" in the main blog and as contributor in the secondary blog - added by the first part of the code cited above.

    Didn't work.

    And now I'm a bit lost and I think I've read pretty much everything Google has to offer on this matter - hopefully someone here can provide some help!

    Thanks in advance!

  2. youngmicroserf
    Member
    Posted 13 years ago #

    Oh, http://mu.wordpress.org/forums/topic/9913 was the main source of wisdom so far...

About this Topic

  • Started 13 years ago by youngmicroserf
  • Latest reply from youngmicroserf