WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/14/2010 02:02:19 AM (10 years ago)
Author:
wpmuguru
Message:

merge wp-admin user, plugins, themes, upgrade , See #11644

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin

    • Property svn:ignore set to
      .themes.php.swp
      .user-edit.php.swp
      .user-new.php.swp
      .users.php.swp
  • trunk/wp-admin/users.php

    r12546 r12722  
    9999        switch($_REQUEST['delete_option']) {
    100100        case 'delete':
    101             wp_delete_user($id);
     101            if ( !is_multisite() ) {
     102                wp_delete_user($id);
     103            } else {
     104                remove_user_from_blog($id, $blog_id); // WPMU only remove user from blog
     105            }
    102106            break;
    103107        case 'reassign':
    104             wp_delete_user($id, $_REQUEST['reassign_user']);
     108            if ( !is_multisite() ) {
     109                wp_delete_user($id, $_REQUEST['reassign_user']);
     110            } else {
     111                remove_user_from_blog($id, $blog_id, $_REQUEST['reassign_user']);
     112            }
    105113            break;
    106114        }
     
    154162        }
    155163    }
    156     $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login");
     164    if ( !is_multisite() ) {
     165        $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login");
     166    } else {
     167        // WPMU only searches users of current blog
     168        $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ORDER BY user_login");
     169    }
    157170    $user_dropdown = '<select name="reassign_user">';
    158171    foreach ( (array) $all_logins as $login )
     
    240253<div class="wrap">
    241254<?php screen_icon(); ?>
    242 <h2><?php echo esc_html( $title ); ?>  <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a> <?php
     255<h2><?php echo esc_html( $title ); if ( !is_multisite() || get_site_option( 'add_new_users' ) ) { ?>  <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a><?php }
    243256if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
    244257    printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $_GET['usersearch'] ) ); ?>
     
    386399</div>
    387400
     401<?php
     402if ( is_multisite() ) {
     403    foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) {
     404        $var = 'new_' . $var;
     405        $$var = isset($_REQUEST[$formpost]) ? esc_attr(stripslashes($_REQUEST[$formpost])) : '';
     406    }
     407    unset($name);
     408}
     409?>
     410
    388411<br class="clear" />
    389412<?php
Note: See TracChangeset for help on using the changeset viewer.