diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 0e6a07275c..77a4feead0 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -410,6 +410,8 @@ function set_screen_options() { switch ( $map_option ) { case 'edit_per_page': + case 'ms_sites_per_page': + case 'ms_users_per_page': case 'edit_comments_per_page': case 'upload_per_page': case 'categories_per_page': diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index df00d2cfca..385747f8c2 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -3767,6 +3767,12 @@ function screen_options($screen) { case 'edit-pages': $per_page_label = __('Pages per page:'); break; + case 'ms-sites': + $per_page_label = __('Sites per page:'); + break; + case 'ms-users': + $per_page_label = __('Users per page:'); + break; case 'edit-comments': $per_page_label = __('Comments per page:'); break; diff --git a/wp-admin/ms-edit.php b/wp-admin/ms-edit.php index 910bc49870..8f19e707a0 100644 --- a/wp-admin/ms-edit.php +++ b/wp-admin/ms-edit.php @@ -221,6 +221,9 @@ switch ( $_GET['action'] ) { // rewrite rules can't be flushed during switch to blog delete_option( 'rewrite_rules' ); + // update blogs count + delete_site_transient( "blog_count" ); + // update blogs table $blog_data = stripslashes_deep($_POST[ 'blog' ]); update_blog_details($id, $blog_data); @@ -292,35 +295,52 @@ switch ( $_GET['action'] ) { if ( $id != '0' && $id != $current_site->blog_id ) wpmu_delete_blog( $id, true ); - + wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) ); exit(); break; case "allblogs": - check_admin_referer('allblogs'); + if ( isset($_POST['doaction']) || isset($_POST['doaction2']) ) { + check_admin_referer('bulk-sites'); + if ( ! current_user_can( 'manage_sites' ) ) wp_die( __('You do not have permission to access this page.') ); + if ( $_GET['action'] != -1 || $_POST['action2'] != -1 ) + $doaction = $doaction = ($_POST['action'] != -1) ? $_POST['action'] : $_POST['action2']; + + foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) { if ( $val != '0' && $val != $current_site->blog_id ) { - if ( isset($_POST['allblog_delete']) ) { - $blogfunction = 'all_delete'; - wpmu_delete_blog( $val, true ); - } elseif ( isset($_POST['allblog_spam']) ) { - $blogfunction = 'all_spam'; - update_blog_status( $val, "spam", '1', 0 ); - set_time_limit(60); - } elseif ( isset($_POST['allblog_notspam']) ) { - $blogfunction = 'all_notspam'; - update_blog_status( $val, "spam", '0', 0 ); - set_time_limit(60); + switch ( $doaction ) { + case 'delete': + $blogfunction = 'all_delete'; + wpmu_delete_blog( $val, true ); + break; + case 'spam': + $blogfunction = 'all_spam'; + update_blog_status( $val, "spam", '1', 0 ); + set_time_limit(60); + break; + case 'notspam': + $blogfunction = 'all_notspam'; + update_blog_status( $val, "spam", '0', 0 ); + set_time_limit(60); + break; } - } - } + } else { + wp_die( __('You are not allowed to change one of this sites.') ); + exit(); + }; + }; wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) ); exit(); + + } else { + wp_redirect( admin_url("ms-sites.php") ); + } break; case "archiveblog": @@ -397,7 +417,6 @@ switch ( $_GET['action'] ) { case "unmature": update_blog_status( $id, 'mature', '0' ); do_action( 'unmature_blog', $id ); - wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'umature'), $_POST['ref'] ) ); exit(); break; diff --git a/wp-admin/ms-sites.php b/wp-admin/ms-sites.php index d7addba151..37294e2992 100644 --- a/wp-admin/ms-sites.php +++ b/wp-admin/ms-sites.php @@ -156,7 +156,7 @@ switch ( $action ) {
-option_name ) ) ?> | -+ |
---|
- $column_display_name) { - $column_link = " + + + $column_display_name) { + $column_link = " $order2, 'paged' => $pagenum, 'sortby' => $column_id ), $_SERVER['REQUEST_URI'] ) ); + $column_link .= "'>{$column_display_name}"; $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; - ?> - | + ?> + | + + | |||||
---|---|---|---|---|---|---|---|
+ + | + $column_display_name) { + $column_link = " $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) ); + $column_link .= "'>{$column_display_name}"; + $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; + ?> ++ + | + ++ |
- ' . get_blog_option( $blog['blog_id'], 'blogname' ) . '- ' . get_blog_option( $blog['blog_id'], 'blogdescription ' ) . ''; + $actions = array(); $actions[] = '' . __('Edit') . ''; $actions[] = "" . __('Backend') . ''; @@ -539,17 +633,21 @@ switch ( $action ) { case 'lastupdated': ?> | - g:i:s a'), $blog['last_updated']); ?> - | + g:i:s a'; + echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?> + + case 'registered': ?>- g:i:s a'), $blog['registered']); ?> + | -
' . __( 'More' ) . '';
}
- foreach ( $blogusers as $key => $val )
- echo '' . $val->user_login . ' ('.$val->user_email.') '; + foreach ( $blogusers as $key => $val ) { + echo '' . $val->user_login . ' '; + if ( 'list' != $mode ) + echo '(' . $val->user_email . ')'; + echo ' '; + } if ( $blogusers_warning != '' ) echo '' . $blogusers_warning . ' '; } @@ -592,7 +694,7 @@ switch ( $action ) { - | |