WordPress.org

Make WordPress Core

Changeset 18328


Ignore:
Timestamp:
06/22/11 19:45:28 (3 years ago)
Author:
ryan
Message:

Fix handing of super admins that don't have a blog in get_dashboard_url() and login. Props nacin. fixes #17829

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r18254 r18328  
    23032303 
    23042304    $blogs = get_blogs_of_user( $user_id ); 
    2305     if ( empty($blogs) ) { 
     2305    if ( ! is_super_admin() && empty($blogs) ) { 
    23062306        $url = user_admin_url( $path, $scheme ); 
    23072307    } elseif ( ! is_multisite() ) { 
     
    23092309    } else { 
    23102310        $current_blog = get_current_blog_id(); 
    2311         if ( $current_blog  && in_array($current_blog, array_keys($blogs)) ) { 
     2311        if ( $current_blog  && ( is_super_admin( $user_id ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) { 
    23122312            $url = admin_url( $path, $scheme ); 
    23132313        } else { 
  • trunk/wp-login.php

    r18223 r18328  
    587587        if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { 
    588588            // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. 
    589             if ( is_multisite() && !get_active_blog_for_user($user->id) ) 
     589            if ( is_multisite() && !get_active_blog_for_user($user->id) && !is_super_admin( $user->id ) ) 
    590590                $redirect_to = user_admin_url(); 
    591591            elseif ( is_multisite() && !$user->has_cap('read') ) 
Note: See TracChangeset for help on using the changeset viewer.