WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2010 07:26:40 PM (9 years ago)
Author:
ryan
Message:

Fix user edit urls for network admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r15679 r15717  
    503503
    504504    $blog = get_active_blog_for_user( get_current_user_id() );
    505     $dashboard_blog = get_dashboard_blog();
     505
    506506    if ( is_object( $blog ) ) {
    507507        wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case"
    508508        exit;
    509     }
    510 
    511     /*
    512        If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,
    513        then update the primary_blog record to match the user's blog
    514      */
    515     $blogs = get_blogs_of_user( get_current_user_id() );
    516 
    517     if ( !empty( $blogs ) ) {
    518         foreach( $blogs as $blogid => $blog ) {
    519             if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) {
    520                 update_user_meta( get_current_user_id(), 'primary_blog', $blogid );
    521                 continue;
    522             }
    523         }
    524         $blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) );
    525             wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) );
    526         exit;
    527     }
     509    } else {
     510        wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case"
     511    }
     512
    528513    wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
    529514}
Note: See TracChangeset for help on using the changeset viewer.