diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index f720e4c52a..e700eec967 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -1086,34 +1086,6 @@ if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) { add_action( 'admin_init', 'profile_page_email_warning_ob_start' ); } -function disable_some_pages() { - global $messages; - - if ( strpos( $_SERVER['PHP_SELF'], 'user-new.php' ) && !get_site_option( 'add_new_users' ) ) { - if ( is_super_admin() ) { - $messages[] = '

' . __( 'Warning! Only site administrators may see this page. Everyone else will see a page disabled message. Enable it again on the options page.' ) . '

'; - } else { - wp_die( __('Page disabled by the administrator') ); - } - } - - $pages = array( 'theme-editor.php', 'plugin-editor.php' ); - foreach( $pages as $page ) { - if ( strpos( $_SERVER['PHP_SELF'], $page ) ) { - wp_die( __('Page disabled by the administrator') ); - } - } - - $pages = array( 'theme-install.php', 'plugin-install.php' ); - foreach( $pages as $page ) { - if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_super_admin() ) { - wp_die( __( "Sorry, you're not allowed here." ) ); - } - } - -} -add_action( 'admin_init', 'disable_some_pages' ); - function blogs_listing_post() { if ( !isset( $_POST[ 'action' ] ) ) { return false; diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index 532fa94ed6..1f2db707d2 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -12,6 +12,9 @@ require_once('admin.php'); if ( !current_user_can('create_users') ) wp_die(__('Cheatin’ uh?')); +if ( is_multisite() && !get_site_option( 'add_new_users' ) ) + wp_die( __('Page disabled by the administrator') ); + /** WordPress Registration API */ require_once( ABSPATH . WPINC . '/registration.php');