X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..c81aba3d563f7459dc79140e4c5be67bcf506b92:/wp-admin/network/site-users.php diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index b5a6ab72..54ba6b68 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -24,18 +24,24 @@ get_current_screen()->add_help_tab( array( 'title' => __('Overview'), 'content' => '

' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '

' . - '

' . __('Info - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '

' . - '

' . __('Users - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '

' . - '

' . sprintf( __('Themes - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the Network Themes screen.' ), network_admin_url( 'themes.php' ) ) . '

' . - '

' . __('Settings - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '

' + '

' . __('Info — The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '

' . + '

' . __('Users — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '

' . + '

' . sprintf( __('Themes — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the Network Themes screen.' ), network_admin_url( 'themes.php' ) ) . '

' . + '

' . __('Settings — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '

' ) ); get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Site Management') . '

' . + '

' . __('Documentation on Site Management') . '

' . '

' . __('Support Forums') . '

' ); +get_current_screen()->set_screen_reader_content( array( + 'heading_views' => __( 'Filter site users list' ), + 'heading_pagination' => __( 'Site users list navigation' ), + 'heading_list' => __( 'Site users list' ), +) ); + $_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] ); $referer = remove_query_arg( 'update', wp_get_referer() ); @@ -49,8 +55,12 @@ if ( ! $id ) wp_die( __('Invalid site ID.') ); $details = get_blog_details( $id ); +if ( ! $details ) { + wp_die( __( 'The requested site does not exist.' ) ); +} + if ( ! can_edit_network( $details->site_id ) ) - wp_die( __( 'You do not have permission to access this page.' ) ); + wp_die( __( 'You do not have permission to access this page.' ), 403 ); $is_main_site = is_main_site( $id ); @@ -70,12 +80,19 @@ if ( $action ) { $password = wp_generate_password( 12, false); $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); - if ( false == $user_id ) { + if ( false === $user_id ) { $update = 'err_new_dup'; } else { - wp_new_user_notification( $user_id, $password ); add_user_to_blog( $id, $user_id, $_POST['new_role'] ); $update = 'newuser'; + /** + * Fires after a user has been created via the network site-users.php page. + * + * @since 4.4.0 + * + * @param int $user_id ID of the newly created user. + */ + do_action( 'network_site_users_created_user', $user_id ); } } break; @@ -132,8 +149,13 @@ if ( $action ) { $user_id = (int) $user_id; // If the user doesn't already belong to the blog, bail. - if ( !is_user_member_of_blog( $user_id ) ) - wp_die( __( 'Cheatin’ uh?' ), 403 ); + if ( ! is_user_member_of_blog( $user_id ) ) { + wp_die( + '

' . __( 'Cheatin’ uh?' ) . '

' . + '

' . __( 'One of the selected users is not a member of this site.' ) . '

', + 403 + ); + } $user = get_userdata( $user_id ); $user->set_role( $_REQUEST['new_role'] ); @@ -155,11 +177,9 @@ if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { exit(); } -add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) ); +add_screen_option( 'per_page' ); -$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) ); -$title_site_url_linked = sprintf( __('Edit Site: %2$s'), get_blogaddress_by_id( $id ), $site_url_no_http ); -$title = sprintf( __('Edit Site: %s'), $site_url_no_http ); +$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); $parent_file = 'sites.php'; $submenu_file = 'sites.php'; @@ -177,15 +197,14 @@ if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

-

+

|

+

' . __( 'User added.' ) . '

'; + echo '

' . __( 'User added.' ) . '

'; break; case 'err_add_member': - echo '

' . __( 'User is already a member of this site.' ) . '

'; + echo '

' . __( 'User is already a member of this site.' ) . '

'; break; case 'err_add_notfound': - echo '

' . __( 'Enter the username of an existing user.' ) . '

'; + echo '

' . __( 'Enter the username of an existing user.' ) . '

'; break; case 'promote': - echo '

' . __( 'Changed roles.' ) . '

'; + echo '

' . __( 'Changed roles.' ) . '

'; break; case 'err_promote': - echo '

' . __( 'Select a user to change role.' ) . '

'; + echo '

' . __( 'Select a user to change role.' ) . '

'; break; case 'remove': - echo '

' . __( 'User removed from this site.' ) . '

'; + echo '

' . __( 'User removed from this site.' ) . '

'; break; case 'err_remove': - echo '

' . __( 'Select a user to remove.' ) . '

'; + echo '

' . __( 'Select a user to remove.' ) . '

'; break; case 'newuser': - echo '

' . __( 'User created.' ) . '

'; + echo '

' . __( 'User created.' ) . '

'; break; case 'err_new': - echo '

' . __( 'Enter the username and email.' ) . '

'; + echo '

' . __( 'Enter the username and email.' ) . '

'; break; case 'err_new_dup': - echo '

' . __( 'Duplicated username or email address.' ) . '

'; + echo '

' . __( 'Duplicated username or email address.' ) . '

'; break; } endif; ?> -
+ search_box( __( 'Search Users' ), 'user' ); ?>
@@ -259,17 +278,17 @@ do_action( 'network_site_users_after_list_table' ); /** This filter is documented in wp-admin/network/site-users.php */ if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?> -

+

- + - - + @@ -288,26 +307,26 @@ if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_us * @param bool $bool Whether to show the Add New User form. Default true. */ if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?> -

+

- - + + - - + + - - + - +