From eb14ca3036a64e23ca9db70c539214e5934eeb50 Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 3 Apr 2010 00:10:44 +0000 Subject: [PATCH] More MS cleanups. props ocean90. see #12460 git-svn-id: http://svn.automattic.com/wordpress/trunk@13953 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/ms-delete-site.php | 2 - wp-admin/ms-options.php | 8 ++-- wp-admin/ms-sites.php | 80 ++++++++++++++++++++----------------- wp-admin/ms-themes.php | 6 +-- wp-admin/ms-users.php | 8 ++-- 5 files changed, 54 insertions(+), 50 deletions(-) diff --git a/wp-admin/ms-delete-site.php b/wp-admin/ms-delete-site.php index e17981047..0ed25a3e1 100644 --- a/wp-admin/ms-delete-site.php +++ b/wp-admin/ms-delete-site.php @@ -17,8 +17,6 @@ if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) } } -$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash'; - $title = __( 'Delete Site' ); $parent_file = 'tools.php'; require_once( './admin-header.php' ); diff --git a/wp-admin/ms-options.php b/wp-admin/ms-options.php index f304a7bc4..a86b137da 100644 --- a/wp-admin/ms-options.php +++ b/wp-admin/ms-options.php @@ -1,17 +1,17 @@

diff --git a/wp-admin/ms-sites.php b/wp-admin/ms-sites.php index 6b1db06e7..f8dab451d 100644 --- a/wp-admin/ms-sites.php +++ b/wp-admin/ms-sites.php @@ -4,6 +4,9 @@ require_once( './admin.php' ); if ( !is_multisite() ) wp_die( __( 'Multisite support is not enabled.' ) ); +if ( ! current_user_can( 'manage_sites' ) ) + wp_die( __( 'You do not have permission to access this page.' ) ); + $title = __( 'Sites' ); $parent_file = 'ms-admin.php'; @@ -11,9 +14,6 @@ wp_enqueue_script( 'admin-forms' ); require_once( './admin-header.php' ); -if ( ! current_user_can( 'manage_sites' ) ) - wp_die( __( 'You do not have permission to access this page.' ) ); - $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0; if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) { @@ -22,10 +22,10 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET[' public, 0 ); ?> /> + @@ -132,13 +133,6 @@ switch ( $action ) { - - - - - - - @@ -153,6 +147,14 @@ switch ( $action ) { + + + + + + + +

@@ -549,35 +551,39 @@ switch ( $action ) { if ( 'list' != $mode ) echo '

' . sprintf( _x( '%1$s – %2$s', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '

'; - $actions = array(); - $actions[] = '' . __( 'Edit' ) . ''; - $actions[] = "" . __( 'Backend' ) . ''; + // Preordered. + $actions = array( + 'edit' => '', 'backend' => '', + 'activate' => '', 'deactivate' => '', + 'archive' => '', 'unarchive' => '', + 'spam' => '', 'unspam' => '', + 'delete' => '', + 'visit' => '', + ); + + $actions['edit'] = '' . __( 'Edit' ) . ''; + $actions['backend'] = "" . __( 'Backend' ) . ''; if ( $current_site->blog_id != $blog['blog_id'] ) { if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' ) - $actions[] = '' . __( 'Activate' ) . ''; + $actions['activate'] = '' . __( 'Activate' ) . ''; else - $actions[] = '' . __( 'Deactivate' ) . ''; - + $actions['deactivate'] = '' . __( 'Deactivate' ) . ''; + if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' ) - $actions[] = '' . __( 'Unarchive' ) . ''; + $actions['unarchive'] = '' . __( 'Unarchive' ) . ''; else - $actions[] = '' . __( 'Archive' ) . ''; - + $actions['archive'] = '' . __( 'Archive' ) . ''; + if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' ) - $actions[] = '' . __( 'Not Spam' ) . ''; + $actions['unspam'] = '' . __( 'Not Spam' ) . ''; else - $actions[] = '' . __( 'Spam' ) . ''; - - if ( get_blog_status( $blog['blog_id'], 'mature' ) == '1' ) - $actions[] = '' . __( 'Not Mature' ) . ''; - else - $actions[] = '' . __( 'Mature' ) . ''; - - $actions[] = '' . __( 'Delete' ) . ''; + $actions['spam'] = '' . __( 'Spam' ) . ''; + + $actions['delete'] = '' . __( 'Delete' ) . ''; } - $actions[] = "" . __( 'Visit' ) . ''; - + $actions['visit'] = "" . __( 'Visit' ) . ''; + $actions = array_filter( $actions ); if ( count( $actions ) ) : ?>
@@ -600,7 +606,7 @@ switch ( $action ) { break; case 'registered': ?> -

diff --git a/wp-admin/ms-users.php b/wp-admin/ms-users.php index 6ea7d4c36..01787697d 100644 --- a/wp-admin/ms-users.php +++ b/wp-admin/ms-users.php @@ -4,6 +4,9 @@ require_once( './admin.php' ); if ( !is_multisite() ) wp_die( __( 'Multisite support is not enabled.' ) ); +if ( ! current_user_can( 'manage_network_users' ) ) + wp_die( __( 'You do not have permission to access this page.' ) ); + $title = __( 'Users' ); $parent_file = 'ms-admin.php'; @@ -11,9 +14,6 @@ wp_enqueue_script( 'admin-forms' ); require_once( './admin-header.php' ); -if ( ! current_user_can( 'manage_network_users' ) ) - wp_die( __( 'You do not have permission to access this page.' ) ); - if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) { ?>

@@ -26,7 +26,7 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET[' _e( 'Users marked as spam.' ); break; case 'all_notspam': - _e( 'Users marked as not spam.' ); + _e( 'Users removed from spam.' ); break; case 'all_delete': _e( 'Users deleted.' );