The MU forums have moved to WordPress.org

Major problems with users (1 post)

  1. spstieng
    Member
    Posted 14 years ago #

    I have put WPMU Blog Registrations by Aaron Edwards in my mu-plugins dir, and Register-Plus in my plugins dir (and only activated it for my sub-blog).

    In My custom plugin, I have created script that adds roles and capabilities. It looks something like this:

    if(!get_role('mngBall'))
          {
            add_role('mngBall',__('Manage Ball));
            $role = get_role('mngBall');
            $role->add_cap('mngBall');
          }
    
          if(!get_role('mngBrick'))
          {
            add_role('mngBrick',__('Manage Brick'));
            $role = get_role('mngBrick');
            $role->add_cap('mngBrick');
          }

    By default, all users registering for my sub-blog, is assigned the role "newUser". This is set in blogs->edit area.

    Using Register Plus, I've added some extra fields. One of them being a dropdown where the user can select their "role".

    So, in order to automatically change this role to the selected role, I've added this hook:

    function changeUserRole($userID)
    {
    $user = new WP_User( $userID );
    $roles = array("role1"=>"role name 1", "role2"=>"role name 2");

    // Set new user role.
    foreach($roles as $role => $name) {
    if( $_POST['role'] == $name) {
    $user->add_cap($role);
    $user->remove_cap('newUser');
    }
    }
    }

    add_action ( 'user_register', 'changeUserRole' );

    Q1.
    When I access the backend of a sub-blog, I can delete a user, and the user is removed from that blog.

    But the user still remains on my main blog, and thus not deleted.
    Why isn't the user completely deleted? How can I make sure that a user i completely deleted when I delete the user from a sub-blog?

    Q2.
    When I'm on blog3.myMainSite.com/wp-admin/wpmu-users.php, why do I see users registered for blog 1 and 2? Shouldn't I only see users registered for blog 3?

    Q3.
    If I have Register Plus activated, I'm not able to update user information when I'm on:
    http://mysite.no/wp-admin/user-edit.php?user_id=11&wp_http_referer=%2Fwp-admin%2Fwpmu-users.php

    I get the following error message: You can’t give users that role.
    (I'm logged in as Administrator)

    Register Plus also does not save additional WPMU info like Primary Site

    Has onyone else experienced similar problems?

About this Topic

  • Started 14 years ago by spstieng