WordPress.org

Make WordPress Core

Ticket #16297: 16297.2.diff

File 16297.2.diff, 1.1 KB (added by nacin, 3 years ago)
  • wp-login.php

     
    586586                // 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. 
    587587                if ( is_multisite() && !get_active_blog_for_user($user->id) ) 
    588588                        $redirect_to = user_admin_url(); 
    589                 elseif ( !is_multisite() && !$user->has_cap('read') ) 
     589                elseif ( is_multisite() && !$user->has_cap('read') ) 
    590590                        $redirect_to = user_admin_url(); 
    591591                elseif ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) 
    592592                        $redirect_to = admin_url('profile.php'); 
  • wp-admin/user/admin.php

     
    1111 
    1212require_once( dirname(dirname(__FILE__)) . '/admin.php'); 
    1313 
     14if ( ! is_multisite() ) { 
     15        wp_redirect( admin_url() ); 
     16        exit; 
     17} 
     18 
    1419if ( ! is_main_site() ) { 
    1520        wp_redirect( user_admin_url() ); 
    1621        exit;