Ticket #17829: 17829.2.diff
| File 17829.2.diff, 1.5 KB (added by nacin, 2 years ago) |
|---|
-
wp-login.php
586 586 587 587 if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { 588 588 // 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 ) ) 590 590 $redirect_to = user_admin_url(); 591 591 elseif ( is_multisite() && !$user->has_cap('read') ) 592 592 $redirect_to = get_dashboard_url( $user->id ); -
wp-includes/link-template.php
2302 2302 $user_id = (int) $user_id; 2303 2303 2304 2304 $blogs = get_blogs_of_user( $user_id ); 2305 if ( empty($blogs) ) {2305 if ( ! is_super_admin() && empty($blogs) ) { 2306 2306 $url = user_admin_url( $path, $scheme ); 2307 2307 } elseif ( ! is_multisite() ) { 2308 2308 $url = admin_url( $path, $scheme ); 2309 2309 } else { 2310 2310 $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 ) ) ) ) { 2312 2312 $url = admin_url( $path, $scheme ); 2313 2313 } else { 2314 2314 $active = get_active_blog_for_user( $user_id );
