From 63f9a62af6ffbd9132ed90089b148c7aaa93a7ab Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 25 Jan 2010 22:01:43 +0000 Subject: [PATCH] phpdoc and cleanup. see #11644 git-svn-id: http://svn.automattic.com/wordpress/trunk@12826 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ms.php | 49 ++++++++++++++++++++++++------------ wp-includes/ms-functions.php | 4 +-- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index b7bfabc2b..d1ee71cb3 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -1,8 +1,17 @@ user_id, $blog_id); + if ( !empty($users) ) { + foreach ($users as $user) { + remove_user_from_blog($user->user_id, $blog_id); + } } update_blog_status( $blog_id, 'deleted', 1 ); @@ -61,13 +81,13 @@ function wpmu_delete_blog($blog_id, $drop = false) { $stack = array($dir); $index = 0; - while ($index < count($stack)) { + while ( $index < count($stack) ) { # Get indexed directory from stack $dir = $stack[$index]; $dh = @ opendir($dir); - if ($dh) { - while (($file = @ readdir($dh)) !== false) { + if ( $dh ) { + while ( ($file = @ readdir($dh)) !== false ) { if ($file == '.' or $file == '..') continue; @@ -81,7 +101,7 @@ function wpmu_delete_blog($blog_id, $drop = false) { } $stack = array_reverse($stack); // Last added dirs are deepest - foreach( (array) $stack as $dir) { + foreach( (array) $stack as $dir ) { if ( $dir != $top_dir) @rmdir($dir); } @@ -89,10 +109,9 @@ function wpmu_delete_blog($blog_id, $drop = false) { $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->usermeta} WHERE meta_key = %s", 'wp_{$blog_id}_autosave_draft_ids') ); $blogs = get_site_option( "blog_list" ); if ( is_array( $blogs ) ) { - foreach( $blogs as $n => $blog ) { - if ( $blog[ 'blog_id' ] == $blog_id ) { + foreach ( $blogs as $n => $blog ) { + if ( $blog[ 'blog_id' ] == $blog_id ) unset( $blogs[ $n ] ); - } } update_site_option( 'blog_list', $blogs ); } @@ -152,9 +171,8 @@ function confirm_delete_users( $users ) { foreach ( (array) $_POST['allusers'] as $key => $val ) { if ( $val != '' && $val != '0' ) { $user = new WP_User( $val ); - if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) { + if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a site admnistrator.' ), $user->user_login ) ); - } echo "\n"; $blogs = get_blogs_of_user( $val, true ); if ( !empty( $blogs ) ) { @@ -164,7 +182,7 @@ function confirm_delete_users( $users ) { echo "

{$details->blogname} "; echo "