WordPress.org

Make WordPress Core

Changeset 13506


Ignore:
Timestamp:
02/28/2010 07:24:25 PM (8 years ago)
Author:
wpmuguru
Message:

more ms delete user tweaks, props ocean90, see #12386

File:
1 edited

Legend:

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

    r13504 r13506  
    181181    $admin_out = "<option value='$current_user->ID'>$current_user->user_login</option>";
    182182
    183     foreach ( (array) $_POST['allusers'] as $key => $val ) {
     183    foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
    184184        if ( $val != '' && $val != '0' ) {
    185             $allusers[] = $val;
    186             $user = new WP_User( $val );
     185            $delete_user = new WP_User( $val );
    187186           
    188             if ( in_array( $user->user_login, $site_admins ) )
    189                 wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $user->user_login ) );
     187            if ( in_array( $delete_user->user_login, $site_admins ) )
     188                wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $delete_user->user_login ) );
    190189               
    191190            echo "<input type='hidden' name='user[]' value='{$val}'/>\n";
     
    193192           
    194193            if ( !empty( $blogs ) ) {
    195                 echo '<p><strong>' . sprintf( __( 'Blogs from %s:' ), $user->user_login ) . '</strong></p>';
     194                echo '<p><strong>' . sprintf( __( 'Sites from %s:' ), $delete_user->user_login ) . '</strong></p>';
    196195                foreach ( (array) $blogs as $key => $details ) {
    197196                    $blog_users = get_users_of_blog( $details->userblog_id );
     
    201200                        $out = '';
    202201                        foreach ( $blog_users as $user ) {
    203                             if ( $user->user_id != $val && !in_array( $val, $allusers ) )
     202                            if ( $user->user_id != $val && !in_array( $user->user_id, $allusers ) )
    204203                                $out .= "<option value='{$user->user_id}'>{$user->user_login}</option>";
    205204                        }
Note: See TracChangeset for help on using the changeset viewer.