[wpmu-trac] [WordPress MU Trac] #1076: Infinite Loop on New User Login

WordPress MU Trac wpmu-trac at lists.automattic.com
Tue Jul 28 19:08:28 UTC 2009


#1076: Infinite Loop on New User Login
------------------------+---------------------------------------------------
 Reporter:  deannas     |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  2.8.2   
Component:  component1  |     Version:          
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 An infinite loop occurs when you perform the following:[[BR]]

 1. Log in as site admin and create a new user.[[BR]]
 2. Create a new blog and make the new user the blog admin.[[BR]]
 3. Log in as new user.[[BR]]

 To "fix" the issue from a non-code perspective:[[BR]]
 1. As site admin, log in and make new user a subscriber to main blog.

 Tested in subdirectory mode with no plugins or mu-plugins activated.
 Dashboard blog left as default (blank).

 Problem does not occur when main blog is set to something other than the
 default.

 Problem re-occurs when dashboard blog is set back to default.

 I think this fixes the issue from a code perspective:

 wp-includes\wpmu-functions.php lines 1261-1265 should be:
 {{{
 // get the user's login
         $user = get_user_by('id', $user_id);

         if ( !is_site_admin($user->user_login) && get_usermeta( $user_id,
 'primary_blog' ) == get_site_option( 'dashboard_blog', 1 ) )
                 update_usermeta( $user_id, 'primary_blog', $blog_id );

 }}}

 instead of:


 {{{
 if ( !is_site_admin() && get_usermeta( $user_id, 'primary_blog' ) ==
 get_site_option( 'dashboard_blog', 1 ) )
                 update_usermeta( $user_id, 'primary_blog', $blog_id );
 }}}

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/1076>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list