11
11
require_once( dirname( __FILE__ ) . '/admin.php' );
13
13
if ( ! current_user_can('manage_sites') )
14
wp_die(__('Sorry, you are not allowed to edit this site.'));
14
wp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 );
16
16
$wp_list_table = _get_list_table('WP_Users_List_Table');
17
17
$wp_list_table->prepare_items();
19
get_current_screen()->add_help_tab( array(
21
'title' => __('Overview'),
23
'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
24
'<p>' . __('<strong>Info</strong> — 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.') . '</p>' .
25
'<p>' . __('<strong>Users</strong> — 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.') . '</p>' .
26
'<p>' . sprintf( __('<strong>Themes</strong> — 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 <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
27
'<p>' . __('<strong>Settings</strong> — 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.') . '</p>'
30
get_current_screen()->set_help_sidebar(
31
'<p><strong>' . __('For more information:') . '</strong></p>' .
32
'<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
33
'<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
19
get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
20
get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
36
22
get_current_screen()->set_screen_reader_content( array(
37
23
'heading_views' => __( 'Filter site users list' ),
80
66
if ( false === $user_id ) {
81
67
$update = 'err_new_dup';
83
add_user_to_blog( $id, $user_id, $_POST['new_role'] );
86
* Fires after a user has been created via the network site-users.php page.
90
* @param int $user_id ID of the newly created user.
92
do_action( 'network_site_users_created_user', $user_id );
69
$result = add_user_to_blog( $id, $user_id, $_POST['new_role'] );
71
if ( is_wp_error( $result ) ) {
72
$update = 'err_add_fail';
76
* Fires after a user has been created via the network site-users.php page.
80
* @param int $user_id ID of the newly created user.
82
do_action( 'network_site_users_created_user', $user_id );
101
92
$newuser = $_POST['newuser'];
102
93
$user = get_user_by( 'login', $newuser );
103
94
if ( $user && $user->exists() ) {
104
if ( ! is_user_member_of_blog( $user->ID, $id ) )
105
add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
95
if ( ! is_user_member_of_blog( $user->ID, $id ) ) {
96
$result = add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
98
if ( is_wp_error( $result ) ) {
99
$update = 'err_add_fail';
107
102
$update = 'err_add_member';
109
105
$update = 'err_add_notfound';
117
113
if ( ! current_user_can( 'remove_users' ) ) {
118
wp_die( __( 'Sorry, you are not allowed to remove users.' ) );
114
wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
121
117
check_admin_referer( 'bulk-users' );
148
144
if ( empty( $editable_roles[ $role ] ) ) {
149
wp_die( __( 'Sorry, you are not allowed to give users that role.' ) );
145
wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
152
148
if ( isset( $_REQUEST['users'] ) ) {
300
299
<th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th>
301
300
<td><select name="new_role" id="new_role_adduser">
302
<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
302
switch_to_blog( $id );
303
wp_dropdown_roles( get_option( 'default_role' ) );
304
restore_current_blog();
333
336
<th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th>
334
337
<td><select name="new_role" id="new_role_newuser">
335
<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
339
switch_to_blog( $id );
340
wp_dropdown_roles( get_option( 'default_role' ) );
341
restore_current_blog();
338
345
<tr class="form-field">