]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/network/settings.php
Wordpress 3.2-scripts
[autoinstalls/wordpress.git] / wp-admin / network / settings.php
1 <?php
2 /**
3  * Multisite network settings administration panel.
4  *
5  * @package WordPress
6  * @subpackage Multisite
7  * @since 3.0.0
8  */
9
10 /** Load WordPress Administration Bootstrap */
11 require_once( './admin.php' );
12
13 if ( ! is_multisite() )
14         wp_die( __( 'Multisite support is not enabled.' ) );
15
16 if ( ! current_user_can( 'manage_network_options' ) )
17         wp_die( __( 'You do not have permission to access this page.' ) );
18
19 $title = __( 'Settings' );
20 $parent_file = 'settings.php';
21
22 add_contextual_help($current_screen,
23         '<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>' .
24         '<p>' . __('Operational settings has fields for the network&#8217;s name and admin email.') . '</p>' .
25         '<p>' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '</p>' .
26         '<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>' .
27         '<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>' .
28         '<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>' .
29         '<p>' . __('Checkboxes for media upload buttons set which are shown in the visual editor. If unchecked, a generic upload button is still visible; other media types can still be uploaded if on the allowed file types list.') . '</p>' .
30         '<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>' .
31         '<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>' .
32         '<p><strong>' . __('For more information:') . '</strong></p>' .
33         '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Settings_Screen" target="_blank">Documentation on Network Settings</a>') . '</p>' .
34         '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
35 );
36
37 include( '../admin-header.php' );
38
39 if (isset($_GET['updated'])) {
40         ?>
41         <div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div>
42         <?php
43 }
44 ?>
45
46 <div class="wrap">
47         <?php screen_icon('options-general'); ?>
48         <h2><?php _e( 'Settings' ) ?></h2>
49         <form method="post" action="edit.php?action=siteoptions">
50                 <?php wp_nonce_field( 'siteoptions' ); ?>
51                 <h3><?php _e( 'Operational Settings' ); ?></h3>
52                 <table class="form-table">
53                         <tr valign="top">
54                                 <th scope="row"><label for="site_name"><?php _e( 'Network Name' ) ?></label></th>
55                                 <td>
56                                         <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( $current_site->site_name ) ?>" />
57                                         <br />
58                                         <?php _e( 'What you would like to call this website.' ) ?>
59                                 </td>
60                         </tr>
61
62                         <tr valign="top">
63                                 <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
64                                 <td>
65                                         <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
66                                         <br />
67                                         <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
68                                 </td>
69                         </tr>
70                 </table>
71                 <h3><?php _e( 'Registration Settings' ); ?></h3>
72                 <table class="form-table">
73                         <tr valign="top">
74                                 <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
75                                 <?php
76                                 if ( !get_site_option( 'registration' ) )
77                                         update_site_option( 'registration', 'none' );
78                                 $reg = get_site_option( 'registration' );
79                                 ?>
80                                 <td>
81                                         <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
82                                         <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
83                                         <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 />
84                                         <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><br />
85                                         <?php if ( is_subdomain_install() )
86                                                 _e( 'If registration is disabled, please set <code>NOBLOGREDIRECT</code> in <code>wp-config.php</code> to a URL you will redirect visitors to if they visit a non-existent site.' );
87                                         ?>
88                                 </td>
89                         </tr>
90
91                         <tr valign="top">
92                                 <th scope="row"><?php _e( 'Registration notification' ) ?></th>
93                                 <?php
94                                 if ( !get_site_option( 'registrationnotification' ) )
95                                         update_site_option( 'registrationnotification', 'yes' );
96                                 ?>
97                                 <td>
98                                         <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>
99                                 </td>
100                         </tr>
101
102                         <tr valign="top" id="addnewusers">
103                                 <th scope="row"><?php _e( 'Add New Users' ) ?></th>
104                                 <td>
105                                         <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>
106                                 </td>
107                         </tr>
108
109                         <tr valign="top">
110                                 <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
111                                 <td>
112                                         <input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
113                                         <br />
114                                         <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
115                                 </td>
116                         </tr>
117
118                         <tr valign="top">
119                                 <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
120                                 <td>
121                                         <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
122                                         $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
123                                         <textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
124 <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
125                                         <br />
126                                         <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
127                                 </td>
128                         </tr>
129
130                         <tr valign="top">
131                                 <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
132                                 <td>
133                                         <textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
134 <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
135                                         <br />
136                                         <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
137                                 </td>
138                         </tr>
139
140                 </table>
141                 <h3><?php _e('New Site Settings'); ?></h3>
142                 <table class="form-table">
143
144                         <tr valign="top">
145                                 <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
146                                 <td>
147                                         <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
148 <?php echo esc_textarea( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
149                                         <br />
150                                         <?php _e( 'The welcome email sent to new site owners.' ) ?>
151                                 </td>
152                         </tr>
153                         <tr valign="top">
154                                 <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
155                                 <td>
156                                         <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
157 <?php echo esc_textarea( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
158                                         <br />
159                                         <?php _e( 'The welcome email sent to new users.' ) ?>
160                                 </td>
161                         </tr>
162                         <tr valign="top">
163                                 <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
164                                 <td>
165                                         <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
166 <?php echo esc_textarea( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
167                                         <br />
168                                         <?php _e( 'The first post on a new site.' ) ?>
169                                 </td>
170                         </tr>
171                         <tr valign="top">
172                                 <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
173                                 <td>
174                                         <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
175 <?php echo esc_textarea( stripslashes( get_site_option('first_page') ) ) ?></textarea>
176                                         <br />
177                                         <?php _e( 'The first page on a new site.' ) ?>
178                                 </td>
179                         </tr>
180                         <tr valign="top">
181                                 <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
182                                 <td>
183                                         <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
184 <?php echo esc_textarea( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
185                                         <br />
186                                         <?php _e( 'The first comment on a new site.' ) ?>
187                                 </td>
188                         </tr>
189                         <tr valign="top">
190                                 <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
191                                 <td>
192                                         <input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
193                                         <br />
194                                         <?php _e( 'The author of the first comment on a new site.' ) ?>
195                                 </td>
196                         </tr>
197                         <tr valign="top">
198                                 <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
199                                 <td>
200                                         <input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
201                                         <br />
202                                         <?php _e( 'The URL for the first comment on a new site.' ) ?>
203                                 </td>
204                         </tr>
205                 </table>
206                 <h3><?php _e( 'Upload Settings' ); ?></h3>
207                 <table class="form-table">
208                         <tr valign="top">
209                                 <th scope="row"><?php _e( 'Media upload buttons' ) ?></th>
210                                 <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
211                                 <td><label><input type="checkbox" id="mu_media_buttons_image" name="mu_media_buttons[image]" value="1"<?php checked( ! empty( $mu_media_buttons['image'] ) ) ?>/> <?php _e( 'Images' ); ?></label><br />
212                                 <label><input type="checkbox" id="mu_media_buttons_video" name="mu_media_buttons[video]" value="1"<?php checked( ! empty( $mu_media_buttons['video'] ) ) ?>/> <?php _e( 'Videos' ); ?></label><br />
213                                 <label><input type="checkbox" id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value="1"<?php checked( ! empty( $mu_media_buttons['audio'] ) ) ?>/> <?php _e( 'Music' ); ?></label><br />
214                                 <?php _e( 'The media upload buttons to display on the &#8220;Write Post&#8221; page. Make sure you update the allowed upload file types below as well.' ); ?></td>
215                         </tr>
216
217                         <tr valign="top">
218                                 <th scope="row"><?php _e( 'Site upload space' ) ?></th>
219                                 <td>
220                                 <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="text" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 10) ) . '" size="3" />' ); ?></label><br />
221                                 </td>
222                         </tr>
223
224                         <tr valign="top">
225                                 <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
226                                 <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
227                         </tr>
228
229                         <tr valign="top">
230                                 <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
231                                 <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="text" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" size="5" />' ); ?></td>
232                         </tr>
233                 </table>
234
235 <?php
236                 $languages = get_available_languages();
237                 if ( ! empty( $languages ) ) {
238                         $lang = get_site_option( 'WPLANG' );
239 ?>
240                 <h3><?php _e( 'Language Settings' ); ?></h3>
241                 <table class="form-table">
242                                 <tr valign="top">
243                                         <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
244                                         <td>
245                                                 <select name="WPLANG" id="WPLANG">
246                                                         <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
247                                                 </select>
248                                         </td>
249                                 </tr>
250                 </table>
251 <?php
252                 } // languages
253 ?>
254
255                 <h3><?php _e( 'Menu Settings' ); ?></h3>
256                 <table id="menu" class="form-table">
257                         <tr valign="top">
258                                 <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
259                                 <td>
260                         <?php
261                         $menu_perms = get_site_option( 'menu_items' );
262                         $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
263                         foreach ( (array) $menu_items as $key => $val ) {
264                                 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/>";
265                         }
266                         ?>
267                                 </td>
268                         </tr>
269                 </table>
270
271                 <?php do_action( 'wpmu_options' ); // Add more options here ?>
272
273                 <?php submit_button(); ?>
274         </form>
275 </div>
276
277 <?php include( '../admin-footer.php' ); ?>