wp/wp-admin/network/settings.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
    11 require_once( dirname( __FILE__ ) . '/admin.php' );
    11 require_once( dirname( __FILE__ ) . '/admin.php' );
    12 
    12 
    13 /** WordPress Translation Installation API */
    13 /** WordPress Translation Installation API */
    14 require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
    14 require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
    15 
    15 
    16 if ( ! current_user_can( 'manage_network_options' ) )
    16 if ( ! current_user_can( 'manage_network_options' ) ) {
    17 	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    17 	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    18 
    18 }
    19 $title = __( 'Network Settings' );
    19 
       
    20 $title       = __( 'Network Settings' );
    20 $parent_file = 'settings.php';
    21 $parent_file = 'settings.php';
    21 
    22 
    22 // Handle network admin email change requests
    23 // Handle network admin email change requests
    23 if ( ! empty( $_GET[ 'network_admin_hash' ] ) ) {
    24 if ( ! empty( $_GET['network_admin_hash'] ) ) {
    24 	$new_admin_details = get_site_option( 'network_admin_hash' );
    25 	$new_admin_details = get_site_option( 'network_admin_hash' );
    25 	$redirect = 'settings.php?updated=false';
    26 	$redirect          = 'settings.php?updated=false';
    26 	if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details[ 'hash' ], $_GET[ 'network_admin_hash' ] ) && ! empty( $new_admin_details[ 'newemail' ] ) ) {
    27 	if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['network_admin_hash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
    27 		update_site_option( 'admin_email', $new_admin_details[ 'newemail' ] );
    28 		update_site_option( 'admin_email', $new_admin_details['newemail'] );
    28 		delete_site_option( 'network_admin_hash' );
    29 		delete_site_option( 'network_admin_hash' );
    29 		delete_site_option( 'new_admin_email' );
    30 		delete_site_option( 'new_admin_email' );
    30 		$redirect = 'settings.php?updated=true';
    31 		$redirect = 'settings.php?updated=true';
    31 	}
    32 	}
    32 	wp_redirect( network_admin_url( $redirect ) );
    33 	wp_redirect( network_admin_url( $redirect ) );
    39 	exit;
    40 	exit;
    40 }
    41 }
    41 
    42 
    42 add_action( 'admin_head', 'network_settings_add_js' );
    43 add_action( 'admin_head', 'network_settings_add_js' );
    43 
    44 
    44 get_current_screen()->add_help_tab( array(
    45 get_current_screen()->add_help_tab(
       
    46 	array(
    45 		'id'      => 'overview',
    47 		'id'      => 'overview',
    46 		'title'   => __('Overview'),
    48 		'title'   => __( 'Overview' ),
    47 		'content' =>
    49 		'content' =>
    48 			'<p>' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&#8217;s options.') . '</p>' .
    50 			'<p>' . __( 'This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&#8217;s options.' ) . '</p>' .
    49 			'<p>' . __('Operational settings has fields for the network&#8217;s name and admin email.') . '</p>' .
    51 			'<p>' . __( 'Operational settings has fields for the network&#8217;s name and admin email.' ) . '</p>' .
    50 			'<p>' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '</p>' .
    52 			'<p>' . __( 'Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.' ) . '</p>' .
    51 			'<p>' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&#8127;s put in the first post, page, comment, comment author, and comment URL.') . '</p>' .
    53 			'<p>' . __( 'New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&#8127;s put in the first post, page, comment, comment author, and comment URL.' ) . '</p>' .
    52 			'<p>' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '</p>' .
    54 			'<p>' . __( 'Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).' ) . '</p>' .
    53 			'<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
    55 			'<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
    54 			'<p>' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '</p>' .
    56 			'<p>' . __( 'Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.' ) . '</p>' .
    55 			'<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '</p>'
    57 			'<p>' . __( 'Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.' ) . '</p>',
    56 ) );
    58 	)
       
    59 );
    57 
    60 
    58 get_current_screen()->set_help_sidebar(
    61 get_current_screen()->set_help_sidebar(
    59 	'<p><strong>' . __('For more information:') . '</strong></p>' .
    62 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    60 	'<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Settings_Screen">Documentation on Network Settings</a>') . '</p>' .
    63 	'<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Settings_Screen">Documentation on Network Settings</a>' ) . '</p>' .
    61 	'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
    64 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    62 );
    65 );
    63 
    66 
    64 if ( $_POST ) {
    67 if ( $_POST ) {
    65 	/** This action is documented in wp-admin/network/edit.php */
    68 	/** This action is documented in wp-admin/network/edit.php */
    66 	do_action( 'wpmuadminedit' );
    69 	do_action( 'wpmuadminedit' );
    67 
    70 
    68 	check_admin_referer( 'siteoptions' );
    71 	check_admin_referer( 'siteoptions' );
    69 
    72 
    70 	$checked_options = array( 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 );
    73 	$checked_options = array(
       
    74 		'menu_items'                  => array(),
       
    75 		'registrationnotification'    => 'no',
       
    76 		'upload_space_check_disabled' => 1,
       
    77 		'add_new_users'               => 0,
       
    78 	);
    71 	foreach ( $checked_options as $option_name => $option_unchecked_value ) {
    79 	foreach ( $checked_options as $option_name => $option_unchecked_value ) {
    72 		if ( ! isset( $_POST[$option_name] ) )
    80 		if ( ! isset( $_POST[ $option_name ] ) ) {
    73 			$_POST[$option_name] = $option_unchecked_value;
    81 			$_POST[ $option_name ] = $option_unchecked_value;
       
    82 		}
    74 	}
    83 	}
    75 
    84 
    76 	$options = array(
    85 	$options = array(
    77 		'registrationnotification', 'registration', 'add_new_users', 'menu_items',
    86 		'registrationnotification',
    78 		'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name',
    87 		'registration',
    79 		'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author',
    88 		'add_new_users',
    80 		'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled',
    89 		'menu_items',
    81 		'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'new_admin_email',
    90 		'upload_space_check_disabled',
       
    91 		'blog_upload_space',
       
    92 		'upload_filetypes',
       
    93 		'site_name',
       
    94 		'first_post',
       
    95 		'first_page',
       
    96 		'first_comment',
       
    97 		'first_comment_url',
       
    98 		'first_comment_author',
       
    99 		'welcome_email',
       
   100 		'welcome_user_email',
       
   101 		'fileupload_maxk',
       
   102 		'global_terms_enabled',
       
   103 		'illegal_names',
       
   104 		'limited_email_domains',
       
   105 		'banned_email_domains',
       
   106 		'WPLANG',
       
   107 		'new_admin_email',
    82 		'first_comment_email',
   108 		'first_comment_email',
    83 	);
   109 	);
    84 
   110 
    85 	// Handle translation installation.
   111 	// Handle translation installation.
    86 	if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
   112 	if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
    89 			$_POST['WPLANG'] = $language;
   115 			$_POST['WPLANG'] = $language;
    90 		}
   116 		}
    91 	}
   117 	}
    92 
   118 
    93 	foreach ( $options as $option_name ) {
   119 	foreach ( $options as $option_name ) {
    94 		if ( ! isset($_POST[$option_name]) )
   120 		if ( ! isset( $_POST[ $option_name ] ) ) {
    95 			continue;
   121 			continue;
    96 		$value = wp_unslash( $_POST[$option_name] );
   122 		}
       
   123 		$value = wp_unslash( $_POST[ $option_name ] );
    97 		update_site_option( $option_name, $value );
   124 		update_site_option( $option_name, $value );
    98 	}
   125 	}
    99 
   126 
   100 	/**
   127 	/**
   101 	 * Fires after the network options are updated.
   128 	 * Fires after the network options are updated.
   109 }
   136 }
   110 
   137 
   111 include( ABSPATH . 'wp-admin/admin-header.php' );
   138 include( ABSPATH . 'wp-admin/admin-header.php' );
   112 
   139 
   113 if ( isset( $_GET['updated'] ) ) {
   140 if ( isset( $_GET['updated'] ) ) {
   114 	?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Settings saved.' ) ?></p></div><?php
   141 	?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
       
   142 	<?php
   115 }
   143 }
   116 ?>
   144 ?>
   117 
   145 
   118 <div class="wrap">
   146 <div class="wrap">
   119 	<h1><?php echo esc_html( $title ); ?></h1>
   147 	<h1><?php echo esc_html( $title ); ?></h1>
   120 	<form method="post" action="settings.php" novalidate="novalidate">
   148 	<form method="post" action="settings.php" novalidate="novalidate">
   121 		<?php wp_nonce_field( 'siteoptions' ); ?>
   149 		<?php wp_nonce_field( 'siteoptions' ); ?>
   122 		<h2><?php _e( 'Operational Settings' ); ?></h2>
   150 		<h2><?php _e( 'Operational Settings' ); ?></h2>
   123 		<table class="form-table">
   151 		<table class="form-table" role="presentation">
   124 			<tr>
   152 			<tr>
   125 				<th scope="row"><label for="site_name"><?php _e( 'Network Title' ) ?></label></th>
   153 				<th scope="row"><label for="site_name"><?php _e( 'Network Title' ); ?></label></th>
   126 				<td>
   154 				<td>
   127 					<input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( get_network()->site_name ) ?>" />
   155 					<input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( get_network()->site_name ); ?>" />
   128 				</td>
   156 				</td>
   129 			</tr>
   157 			</tr>
   130 
   158 
   131 			<tr>
   159 			<tr>
   132 				<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
   160 				<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ); ?></label></th>
   133 				<td>
   161 				<td>
   134 					<input name="new_admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
   162 					<input name="new_admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ); ?>" />
   135 					<p class="description" id="admin-email-desc">
   163 					<p class="description" id="admin-email-desc">
   136 						<?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
   164 						<?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
   137 					</p>
   165 					</p>
   138 					<?php
   166 					<?php
   139 					$new_admin_email = get_site_option( 'new_admin_email' );
   167 					$new_admin_email = get_site_option( 'new_admin_email' );
   140 					if ( $new_admin_email && $new_admin_email != get_site_option( 'admin_email' ) ) : ?>
   168 					if ( $new_admin_email && $new_admin_email != get_site_option( 'admin_email' ) ) :
       
   169 						?>
   141 						<div class="updated inline">
   170 						<div class="updated inline">
   142 						<p><?php
   171 						<p>
       
   172 						<?php
   143 							printf(
   173 							printf(
   144 								/* translators: %s: new network admin email */
   174 								/* translators: %s: new network admin email */
   145 								__( 'There is a pending change of the network admin email to %s.' ),
   175 								__( 'There is a pending change of the network admin email to %s.' ),
   146 								'<code>' . esc_html( $new_admin_email ) . '</code>'
   176 								'<code>' . esc_html( $new_admin_email ) . '</code>'
   147 							);
   177 							);
   148 							printf(
   178 							printf(
   149 								' <a href="%1$s">%2$s</a>',
   179 								' <a href="%1$s">%2$s</a>',
   150 								esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
   180 								esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
   151 								__( 'Cancel' )
   181 								__( 'Cancel' )
   152 							);
   182 							);
   153 						?></p>
   183 						?>
       
   184 						</p>
   154 						</div>
   185 						</div>
   155 					<?php endif; ?>
   186 					<?php endif; ?>
   156 				</td>
   187 				</td>
   157 			</tr>
   188 			</tr>
   158 		</table>
   189 		</table>
   159 		<h2><?php _e( 'Registration Settings' ); ?></h2>
   190 		<h2><?php _e( 'Registration Settings' ); ?></h2>
   160 		<table class="form-table">
   191 		<table class="form-table" role="presentation">
   161 			<tr>
   192 			<tr>
   162 				<th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
   193 				<th scope="row"><?php _e( 'Allow new registrations' ); ?></th>
   163 				<?php
   194 				<?php
   164 				if ( !get_site_option( 'registration' ) )
   195 				if ( ! get_site_option( 'registration' ) ) {
   165 					update_site_option( 'registration', 'none' );
   196 					update_site_option( 'registration', 'none' );
       
   197 				}
   166 				$reg = get_site_option( 'registration' );
   198 				$reg = get_site_option( 'registration' );
   167 				?>
   199 				?>
   168 				<td>
   200 				<td>
   169 					<fieldset>
   201 					<fieldset>
   170 					<legend class="screen-reader-text"><?php _e( 'New registrations settings' ) ?></legend>
   202 					<legend class="screen-reader-text"><?php _e( 'New registrations settings' ); ?></legend>
   171 					<label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled' ); ?></label><br />
   203 					<label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none' ); ?> /> <?php _e( 'Registration is disabled' ); ?></label><br />
   172 					<label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered' ); ?></label><br />
   204 					<label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user' ); ?> /> <?php _e( 'User accounts may be registered' ); ?></label><br />
   173 					<label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog') ?> /> <?php _e( 'Logged in users may register new sites' ); ?></label><br />
   205 					<label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog' ); ?> /> <?php _e( 'Logged in users may register new sites' ); ?></label><br />
   174 					<label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all') ?> /> <?php _e( 'Both sites and user accounts can be registered' ); ?></label>
   206 					<label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all' ); ?> /> <?php _e( 'Both sites and user accounts can be registered' ); ?></label>
   175 					<?php if ( is_subdomain_install() ) {
   207 					<?php
       
   208 					if ( is_subdomain_install() ) {
   176 						echo '<p class="description">';
   209 						echo '<p class="description">';
   177 						/* translators: 1: NOBLOGREDIRECT 2: wp-config.php */
   210 						/* translators: 1: NOBLOGREDIRECT, 2: wp-config.php */
   178 						printf( __( 'If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site.' ),
   211 						printf(
       
   212 							__( 'If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site.' ),
   179 							'<code>NOBLOGREDIRECT</code>',
   213 							'<code>NOBLOGREDIRECT</code>',
   180 							'<code>wp-config.php</code>'
   214 							'<code>wp-config.php</code>'
   181 						);
   215 						);
   182 						echo '</p>';
   216 						echo '</p>';
   183 					} ?>
   217 					}
       
   218 					?>
   184 					</fieldset>
   219 					</fieldset>
   185 				</td>
   220 				</td>
   186 			</tr>
   221 			</tr>
   187 
   222 
   188 			<tr>
   223 			<tr>
   189 				<th scope="row"><?php _e( 'Registration notification' ) ?></th>
   224 				<th scope="row"><?php _e( 'Registration notification' ); ?></th>
   190 				<?php
   225 				<?php
   191 				if ( !get_site_option( 'registrationnotification' ) )
   226 				if ( ! get_site_option( 'registrationnotification' ) ) {
   192 					update_site_option( 'registrationnotification', 'yes' );
   227 					update_site_option( 'registrationnotification', 'yes' );
       
   228 				}
   193 				?>
   229 				?>
   194 				<td>
   230 				<td>
   195 					<label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account' ) ?></label>
   231 					<label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ); ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account' ); ?></label>
   196 				</td>
   232 				</td>
   197 			</tr>
   233 			</tr>
   198 
   234 
   199 			<tr id="addnewusers">
   235 			<tr id="addnewusers">
   200 				<th scope="row"><?php _e( 'Add New Users' ) ?></th>
   236 				<th scope="row"><?php _e( 'Add New Users' ); ?></th>
   201 				<td>
   237 				<td>
   202 					<label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users &rarr; Add New" page' ); ?></label>
   238 					<label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ); ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users &rarr; Add New" page' ); ?></label>
   203 				</td>
   239 				</td>
   204 			</tr>
   240 			</tr>
   205 
   241 
   206 			<tr>
   242 			<tr>
   207 				<th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
   243 				<th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ); ?></label></th>
   208 				<td>
   244 				<td>
   209 					<input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
   245 					<input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( ' ', (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
   210 					<p class="description" id="illegal-names-desc">
   246 					<p class="description" id="illegal-names-desc">
   211 						<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
   247 						<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ); ?>
   212 					</p>
   248 					</p>
   213 				</td>
   249 				</td>
   214 			</tr>
   250 			</tr>
   215 
   251 
   216 			<tr>
   252 			<tr>
   217 				<th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
   253 				<th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ); ?></label></th>
   218 				<td>
   254 				<td>
   219 					<?php $limited_email_domains = get_site_option( 'limited_email_domains' );
   255 					<?php
   220 					$limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
   256 					$limited_email_domains = get_site_option( 'limited_email_domains' );
       
   257 					$limited_email_domains = str_replace( ' ', "\n", $limited_email_domains );
       
   258 					?>
   221 					<textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
   259 					<textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
   222 <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
   260 <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
   223 					<p class="description" id="limited-email-domains-desc">
   261 					<p class="description" id="limited-email-domains-desc">
   224 						<?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
   262 						<?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ); ?>
   225 					</p>
   263 					</p>
   226 				</td>
   264 				</td>
   227 			</tr>
   265 			</tr>
   228 
   266 
   229 			<tr>
   267 			<tr>
   230 				<th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
   268 				<th scope="row"><label for="banned_email_domains"><?php _e( 'Banned Email Domains' ); ?></label></th>
   231 				<td>
   269 				<td>
   232 					<textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
   270 					<textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
   233 <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
   271 <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
   234 					<p class="description" id="banned-email-domains-desc">
   272 					<p class="description" id="banned-email-domains-desc">
   235 						<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
   273 						<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ); ?>
   236 					</p>
   274 					</p>
   237 				</td>
   275 				</td>
   238 			</tr>
   276 			</tr>
   239 
   277 
   240 		</table>
   278 		</table>
   241 		<h2><?php _e( 'New Site Settings' ); ?></h2>
   279 		<h2><?php _e( 'New Site Settings' ); ?></h2>
   242 		<table class="form-table">
   280 		<table class="form-table" role="presentation">
   243 
   281 
   244 			<tr>
   282 			<tr>
   245 				<th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
   283 				<th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ); ?></label></th>
   246 				<td>
   284 				<td>
   247 					<textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
   285 					<textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
   248 <?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea>
   286 <?php echo esc_textarea( get_site_option( 'welcome_email' ) ); ?></textarea>
   249 					<p class="description" id="welcome-email-desc">
   287 					<p class="description" id="welcome-email-desc">
   250 						<?php _e( 'The welcome email sent to new site owners.' ) ?>
   288 						<?php _e( 'The welcome email sent to new site owners.' ); ?>
   251 					</p>
   289 					</p>
   252 				</td>
   290 				</td>
   253 			</tr>
   291 			</tr>
   254 			<tr>
   292 			<tr>
   255 				<th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
   293 				<th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ); ?></label></th>
   256 				<td>
   294 				<td>
   257 					<textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
   295 					<textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
   258 <?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea>
   296 <?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ); ?></textarea>
   259 					<p class="description" id="welcome-user-email-desc">
   297 					<p class="description" id="welcome-user-email-desc">
   260 						<?php _e( 'The welcome email sent to new users.' ) ?>
   298 						<?php _e( 'The welcome email sent to new users.' ); ?>
   261 					</p>
   299 					</p>
   262 				</td>
   300 				</td>
   263 			</tr>
   301 			</tr>
   264 			<tr>
   302 			<tr>
   265 				<th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
   303 				<th scope="row"><label for="first_post"><?php _e( 'First Post' ); ?></label></th>
   266 				<td>
   304 				<td>
   267 					<textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
   305 					<textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
   268 <?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea>
   306 <?php echo esc_textarea( get_site_option( 'first_post' ) ); ?></textarea>
   269 					<p class="description" id="first-post-desc">
   307 					<p class="description" id="first-post-desc">
   270 						<?php _e( 'The first post on a new site.' ) ?>
   308 						<?php _e( 'The first post on a new site.' ); ?>
   271 					</p>
   309 					</p>
   272 				</td>
   310 				</td>
   273 			</tr>
   311 			</tr>
   274 			<tr>
   312 			<tr>
   275 				<th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
   313 				<th scope="row"><label for="first_page"><?php _e( 'First Page' ); ?></label></th>
   276 				<td>
   314 				<td>
   277 					<textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
   315 					<textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
   278 <?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea>
   316 <?php echo esc_textarea( get_site_option( 'first_page' ) ); ?></textarea>
   279 					<p class="description" id="first-page-desc">
   317 					<p class="description" id="first-page-desc">
   280 						<?php _e( 'The first page on a new site.' ) ?>
   318 						<?php _e( 'The first page on a new site.' ); ?>
   281 					</p>
   319 					</p>
   282 				</td>
   320 				</td>
   283 			</tr>
   321 			</tr>
   284 			<tr>
   322 			<tr>
   285 				<th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
   323 				<th scope="row"><label for="first_comment"><?php _e( 'First Comment' ); ?></label></th>
   286 				<td>
   324 				<td>
   287 					<textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
   325 					<textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
   288 <?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
   326 <?php echo esc_textarea( get_site_option( 'first_comment' ) ); ?></textarea>
   289 					<p class="description" id="first-comment-desc">
   327 					<p class="description" id="first-comment-desc">
   290 						<?php _e( 'The first comment on a new site.' ) ?>
   328 						<?php _e( 'The first comment on a new site.' ); ?>
   291 					</p>
   329 					</p>
   292 				</td>
   330 				</td>
   293 			</tr>
   331 			</tr>
   294 			<tr>
   332 			<tr>
   295 				<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
   333 				<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ); ?></label></th>
   296 				<td>
   334 				<td>
   297 					<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo esc_attr( get_site_option('first_comment_author') ); ?>" />
   335 					<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_author' ) ); ?>" />
   298 					<p class="description" id="first-comment-author-desc">
   336 					<p class="description" id="first-comment-author-desc">
   299 						<?php _e( 'The author of the first comment on a new site.' ) ?>
   337 						<?php _e( 'The author of the first comment on a new site.' ); ?>
   300 					</p>
   338 					</p>
   301 				</td>
   339 				</td>
   302 			</tr>
   340 			</tr>
   303 			<tr>
   341 			<tr>
   304 				<th scope="row"><label for="first_comment_email"><?php _e( 'First Comment Email' ) ?></label></th>
   342 				<th scope="row"><label for="first_comment_email"><?php _e( 'First Comment Email' ); ?></label></th>
   305 				<td>
   343 				<td>
   306 					<input type="text" size="40" name="first_comment_email" id="first_comment_email" aria-describedby="first-comment-email-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_email' ) ); ?>" />
   344 					<input type="text" size="40" name="first_comment_email" id="first_comment_email" aria-describedby="first-comment-email-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_email' ) ); ?>" />
   307 					<p class="description" id="first-comment-email-desc">
   345 					<p class="description" id="first-comment-email-desc">
   308 						<?php _e( 'The email address of the first comment author on a new site.' ) ?>
   346 						<?php _e( 'The email address of the first comment author on a new site.' ); ?>
   309 					</p>
   347 					</p>
   310 				</td>
   348 				</td>
   311 			</tr>
   349 			</tr>
   312 			<tr>
   350 			<tr>
   313 				<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
   351 				<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ); ?></label></th>
   314 				<td>
   352 				<td>
   315 					<input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
   353 					<input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ); ?>" />
   316 					<p class="description" id="first-comment-url-desc">
   354 					<p class="description" id="first-comment-url-desc">
   317 						<?php _e( 'The URL for the first comment on a new site.' ) ?>
   355 						<?php _e( 'The URL for the first comment on a new site.' ); ?>
   318 					</p>
   356 					</p>
   319 				</td>
   357 				</td>
   320 			</tr>
   358 			</tr>
   321 		</table>
   359 		</table>
   322 		<h2><?php _e( 'Upload Settings' ); ?></h2>
   360 		<h2><?php _e( 'Upload Settings' ); ?></h2>
   323 		<table class="form-table">
   361 		<table class="form-table" role="presentation">
   324 			<tr>
   362 			<tr>
   325 				<th scope="row"><?php _e( 'Site upload space' ) ?></th>
   363 				<th scope="row"><?php _e( 'Site upload space' ); ?></th>
   326 				<td>
   364 				<td>
   327 					<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
   365 					<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ); ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option( 'blog_upload_space', 100 ) ) . '" />' ); ?></label><br />
   328 					<p class="screen-reader-text" id="blog-upload-space-desc">
   366 					<p class="screen-reader-text" id="blog-upload-space-desc">
   329 						<?php _e( 'Size in megabytes' ) ?>
   367 						<?php _e( 'Size in megabytes' ); ?>
   330 					</p>
   368 					</p>
   331 				</td>
   369 				</td>
   332 			</tr>
   370 			</tr>
   333 
   371 
   334 			<tr>
   372 			<tr>
   335 				<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
   373 				<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ); ?></label></th>
   336 				<td>
   374 				<td>
   337 					<input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" />
   375 					<input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); ?>" size="45" />
   338 					<p class="description" id="upload-filetypes-desc">
   376 					<p class="description" id="upload-filetypes-desc">
   339 						<?php _e( 'Allowed file types. Separate types by spaces.' ) ?>
   377 						<?php _e( 'Allowed file types. Separate types by spaces.' ); ?>
   340 					</p>
   378 					</p>
   341 				</td>
   379 				</td>
   342 			</tr>
   380 			</tr>
   343 
   381 
   344 			<tr>
   382 			<tr>
   345 				<th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
   383 				<th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ); ?></label></th>
   346 				<td>
   384 				<td>
   347 					<?php
   385 					<?php
   348 						printf(
   386 						printf(
   349 							/* translators: %s: File size in kilobytes */
   387 							/* translators: %s: File size in kilobytes */
   350 							__( '%s KB' ),
   388 							__( '%s KB' ),
   351 							'<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />'
   389 							'<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />'
   352 						);
   390 						);
   353 					?>
   391 						?>
   354 					<p class="screen-reader-text" id="fileupload-maxk-desc">
   392 					<p class="screen-reader-text" id="fileupload-maxk-desc">
   355 						<?php _e( 'Size in kilobytes' ) ?>
   393 						<?php _e( 'Size in kilobytes' ); ?>
   356 					</p>
   394 					</p>
   357 				</td>
   395 				</td>
   358 			</tr>
   396 			</tr>
   359 		</table>
   397 		</table>
   360 
   398 
   361 		<?php
   399 		<?php
   362 		$languages = get_available_languages();
   400 		$languages    = get_available_languages();
   363 		$translations = wp_get_available_translations();
   401 		$translations = wp_get_available_translations();
   364 		if ( ! empty( $languages ) || ! empty( $translations ) ) {
   402 		if ( ! empty( $languages ) || ! empty( $translations ) ) {
   365 			?>
   403 			?>
   366 			<h2><?php _e( 'Language Settings' ); ?></h2>
   404 			<h2><?php _e( 'Language Settings' ); ?></h2>
   367 			<table class="form-table">
   405 			<table class="form-table" role="presentation">
   368 				<tr>
   406 				<tr>
   369 					<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
   407 					<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
   370 					<td>
   408 					<td>
   371 						<?php
   409 						<?php
   372 						$lang = get_site_option( 'WPLANG' );
   410 						$lang = get_site_option( 'WPLANG' );
   410 			 * default option, 'plugins' is enabled, site administrators are granted access to the Plugins
   448 			 * default option, 'plugins' is enabled, site administrators are granted access to the Plugins
   411 			 * screen in their individual sites' dashboards.
   449 			 * screen in their individual sites' dashboards.
   412 			 *
   450 			 *
   413 			 * @since MU (3.0.0)
   451 			 * @since MU (3.0.0)
   414 			 *
   452 			 *
   415 			 * @param array $admin_menus The menu items available.
   453 			 * @param string[] $admin_menus Associative array of the menu items available.
   416 			 */
   454 			 */
   417 			$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
   455 			$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
   418 			$fieldset_end = '';
   456 
   419 			if ( count( (array) $menu_items ) > 1 ) {
   457 			echo '<fieldset><legend class="screen-reader-text">' . __( 'Enable menus' ) . '</legend>';
   420 				echo '<fieldset><legend class="screen-reader-text">' . __( 'Enable menus' ) . '</legend>';
   458 
   421 				$fieldset_end = '</fieldset>';
   459 			foreach ( (array) $menu_items as $key => $val ) {
       
   460 				echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[ $key ] ) ? checked( $menu_perms[ $key ], '1', false ) : '' ) . ' /> ' . esc_html( $val ) . '</label><br/>';
   422 			}
   461 			}
   423 			foreach ( (array) $menu_items as $key => $val ) {
   462 
   424 				echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . " /> " . esc_html( $val ) . "</label><br/>";
   463 			echo '</fieldset>';
   425 			}
       
   426 			echo $fieldset_end;
       
   427 			?>
   464 			?>
   428 				</td>
   465 				</td>
   429 			</tr>
   466 			</tr>
   430 		</table>
   467 		</table>
   431 
   468 
   433 		/**
   470 		/**
   434 		 * Fires at the end of the Network Settings form, before the submit button.
   471 		 * Fires at the end of the Network Settings form, before the submit button.
   435 		 *
   472 		 *
   436 		 * @since MU (3.0.0)
   473 		 * @since MU (3.0.0)
   437 		 */
   474 		 */
   438 		do_action( 'wpmu_options' ); ?>
   475 		do_action( 'wpmu_options' );
       
   476 		?>
   439 		<?php submit_button(); ?>
   477 		<?php submit_button(); ?>
   440 	</form>
   478 	</form>
   441 </div>
   479 </div>
   442 
   480 
   443 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
   481 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>