Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15316 closed defect (bug) (fixed)

Adding users to a blog can set the primary_domain to an invalid value

Reported by: westi's profile westi Owned by: westi's profile westi
Milestone: 3.1 Priority: high
Severity: major Version: 3.0
Component: Multisite Keywords:
Focuses: Cc:

Description

In add_user_to_blog we update the primary_domain of a user to the $blog_id passed in if the user doesn't have a primary_domain yet.

When adding an existing user to an existing site in a multisite setup we pass a blank string to this function .

In a shared usertable setup where the users were all defined elsewhere (e.g. shared with bbPress) this cause use to create blank primary_domain entries in the database.

This then causes the code in get_active_blog_for_user() to add the user as a subscriber on the current blog - even if actually they already had a role!

Change History (4)

#1 @westi
14 years ago

(In [16178]) When adding a user to the blog pass in the current blog id. See #15316.

#2 @westi
14 years ago

Note: get_active_blog_for_user() is called by the admin bar which is why this has become really obvious.

#3 @westi
14 years ago

(In [16179]) Don't mangle the primary_blog option when trying to fix it. Don't set people to be a subscriber on a blog they already have a role for. See #15316

#4 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.