]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/ms-options.php
Wordpress 3.0.3
[autoinstalls/wordpress.git] / wp-admin / ms-options.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 require_once( './admin.php' );
11
12 if ( ! is_multisite() )
13         wp_die( __( 'Multisite support is not enabled.' ) );
14
15 if ( ! current_user_can( 'manage_network_options' ) )
16         wp_die( __( 'You do not have permission to access this page.' ) );
17
18 $title = __( 'Network Options' );
19 $parent_file = 'ms-admin.php';
20
21 add_contextual_help($current_screen,
22         '<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>' .
23         '<p>' . __('Operational settings has fields for the network&#8217;s name and admin email.') . '</p>' .
24         '<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>' .
25         '<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>' .
26         '<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>' .
27         '<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>' .
28         '<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>' .
29         '<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>' .
30         '<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Super 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>' .
31         '<p><strong>' . __('For more information:') . '</strong></p>' .
32         '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Options_SubPanel" target="_blank">Network Options Documentation</a>') . '</p>' .
33         '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
34 );
35
36 include( './admin-header.php' );
37
38 if (isset($_GET['updated'])) {
39         ?>
40         <div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div>
41         <?php
42 }
43 ?>
44
45 <div class="wrap">
46         <?php screen_icon(); ?>
47         <h2><?php _e( 'Network Options' ) ?></h2>
48         <form method="post" action="ms-edit.php?action=siteoptions">
49                 <?php wp_nonce_field( 'siteoptions' ); ?>
50                 <h3><?php _e( 'Operational Settings' ); ?></h3>
51                 <table class="form-table">
52                         <tr valign="top">
53                                 <th scope="row"><label for="site_name"><?php _e( 'Network Name' ) ?></label></th>
54                                 <td>
55                                         <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( $current_site->site_name ) ?>" />
56                                         <br />
57                                         <?php _e( 'What you would like to call this website.' ) ?>
58                                 </td>
59                         </tr>
60
61                         <tr valign="top">
62                                 <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
63                                 <td>
64                                         <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
65                                         <br />
66                                         <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
67                                 </td>
68                         </tr>
69                 </table>
70                 <h3><?php _e( 'Dashboard Settings' ); ?></h3>
71                 <table class="form-table">
72                         <tr valign="top">
73                                 <th scope="row"><label for="dashboard_blog"><?php _e( 'Dashboard Site' ) ?></label></th>
74                                 <td>
75                                         <?php
76                                         if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {
77                                                 $details = get_blog_details( $dashboard_blog );
78                                                 $blogname = untrailingslashit( sanitize_user( str_replace( '.', '', str_replace( $current_site->domain . $current_site->path, '', $details->domain . $details->path ) ) ) );
79                                         } else {
80                                                 $blogname = '';
81                                         }?>
82                                         <input name="dashboard_blog_orig" type="hidden" id="dashboard_blog_orig" value="<?php echo esc_attr( $blogname ); ?>" />
83                                         <input name="dashboard_blog" type="text" id="dashboard_blog" value="<?php echo esc_attr( $blogname ); ?>" class="regular-text" />
84                                         <br />
85                                         <?php _e( 'Site path (&#8220;dashboard&#8221;, &#8220;control&#8221;, &#8220;manager&#8221;, etc.) or blog ID.<br />New users are added to this site as the user role defined below if they don&#8217;t have a site. Leave blank for the main site. Users with the Subscriber role on the old site will be moved to the new site if changed. The new site will be created if it does not exist.' ); ?>
86                                 </td>
87                         </tr>
88                         <tr valign="top">
89                                 <th scope="row"><label for="default_user_role"><?php _e( 'Dashboard User Default Role' ) ?></label></th>
90                                 <td>
91                                         <select name="default_user_role" id="default_user_role"><?php
92                                         wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
93                                         ?>
94                                         </select>
95                                         <br />
96                                         <?php _e( 'The default role for new users on the Dashboard site. &#8220;Subscriber&#8221; or &#8220;Contributor&#8221; roles are recommended.' ); ?>
97                                 </td>
98                         </tr>
99                         <tr valign="top">
100                                 <th scope="row"><label for="admin_notice_feed"><?php _e( 'Admin Notice Feed' ) ?></label></th>
101                                 <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />
102                                 <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />
103
104                                 <?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) )
105                                         echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td>
106                         </tr>
107                 </table>
108                 <h3><?php _e( 'Registration Settings' ); ?></h3>
109                 <table class="form-table">
110                         <tr valign="top">
111                                 <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
112                                 <?php
113                                 if ( !get_site_option( 'registration' ) )
114                                         update_site_option( 'registration', 'none' );
115                                 $reg = get_site_option( 'registration' );
116                                 ?>
117                                 <td>
118                                         <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
119                                         <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
120                                         <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 />
121                                         <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 />
122                                         <p><?php _e( 'Disable or enable registration and who or what can be registered. (Default is disabled.)' ); ?></p>
123                                         <?php if ( is_subdomain_install() ) {
124                                                 echo '<p>' . __( '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.' ) . '</p>';
125                                         } ?>
126                                 </td>
127                         </tr>
128
129                         <tr valign="top">
130                                 <th scope="row"><?php _e( 'Registration notification' ) ?></th>
131                                 <?php
132                                 if ( !get_site_option( 'registrationnotification' ) )
133                                         update_site_option( 'registrationnotification', 'yes' );
134                                 ?>
135                                 <td>
136                                         <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>
137                                 </td>
138                         </tr>
139
140                         <tr valign="top" id="addnewusers">
141                                 <th scope="row"><?php _e( 'Add New Users' ) ?></th>
142                                 <td>
143                                         <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->Add New" page.' ); ?></label>
144                                 </td>
145                         </tr>
146
147                         <tr valign="top">
148                                 <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
149                                 <td>
150                                         <input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
151                                         <br />
152                                         <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
153                                 </td>
154                         </tr>
155
156                         <tr valign="top">
157                                 <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
158                                 <td>
159                                         <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
160                                         $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
161                                         <textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
162 <?php echo wp_htmledit_pre( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
163                                         <br />
164                                         <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
165                                 </td>
166                         </tr>
167
168                         <tr valign="top">
169                                 <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
170                                 <td>
171                                         <textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
172 <?php echo wp_htmledit_pre( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
173                                         <br />
174                                         <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
175                                 </td>
176                         </tr>
177
178                 </table>
179                 <h3><?php _e('New Site Settings'); ?></h3>
180                 <table class="form-table">
181
182                         <tr valign="top">
183                                 <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
184                                 <td>
185                                         <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
186 <?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
187                                         <br />
188                                         <?php _e( 'The welcome email sent to new site owners.' ) ?>
189                                 </td>
190                         </tr>
191                         <tr valign="top">
192                                 <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
193                                 <td>
194                                         <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
195 <?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
196                                         <br />
197                                         <?php _e( 'The welcome email sent to new users.' ) ?>
198                                 </td>
199                         </tr>
200                         <tr valign="top">
201                                 <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
202                                 <td>
203                                         <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
204 <?php echo wp_htmledit_pre( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
205                                         <br />
206                                         <?php _e( 'The first post on a new site.' ) ?>
207                                 </td>
208                         </tr>
209                         <tr valign="top">
210                                 <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
211                                 <td>
212                                         <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
213 <?php echo wp_htmledit_pre( stripslashes( get_site_option('first_page') ) ) ?></textarea>
214                                         <br />
215                                         <?php _e( 'The first page on a new site.' ) ?>
216                                 </td>
217                         </tr>
218                         <tr valign="top">
219                                 <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
220                                 <td>
221                                         <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
222 <?php echo wp_htmledit_pre( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
223                                         <br />
224                                         <?php _e( 'The first comment on a new site.' ) ?>
225                                 </td>
226                         </tr>
227                         <tr valign="top">
228                                 <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
229                                 <td>
230                                         <input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
231                                         <br />
232                                         <?php _e( 'The author of the first comment on a new site.' ) ?>
233                                 </td>
234                         </tr>
235                         <tr valign="top">
236                                 <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
237                                 <td>
238                                         <input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
239                                         <br />
240                                         <?php _e( 'The URL for the first comment on a new site.' ) ?>
241                                 </td>
242                         </tr>
243                 </table>
244                 <h3><?php _e( 'Upload Settings' ); ?></h3>
245                 <table class="form-table">
246                         <tr valign="top">
247                                 <th scope="row"><?php _e( 'Media upload buttons' ) ?></th>
248                                 <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
249                                 <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 />
250                                 <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 />
251                                 <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 />
252                                 <?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>
253                         </tr>
254
255                         <tr valign="top">
256                                 <th scope="row"><?php _e( 'Site upload space' ) ?></th>
257                                 <td>
258                                 <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 />
259                                 </td>
260                         </tr>
261
262                         <tr valign="top">
263                                 <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
264                                 <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>
265                         </tr>
266
267                         <tr valign="top">
268                                 <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
269                                 <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>
270                         </tr>
271                 </table>
272
273 <?php
274                 $languages = get_available_languages();
275                 if ( ! empty( $languages ) ) {
276                         $lang = get_site_option( 'WPLANG' );
277 ?>
278                 <h3><?php _e( 'Network Wide Settings' ); ?></h3>
279                 <div class="updated inline"><p><strong><?php _e( 'Notice:' ); ?></strong> <?php _e( 'These settings may be overridden by site owners.' ); ?></p></div>
280                 <table class="form-table">
281                         <?php
282                                 ?>
283                                 <tr valign="top">
284                                         <th><label for="WPLANG"><?php _e( 'Default Language' ) ?></label></th>
285                                         <td>
286                                                 <select name="WPLANG" id="WPLANG">
287                                                         <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
288                                                 </select>
289                                         </td>
290                                 </tr>
291                 </table>
292 <?php
293                 } // languages
294 ?>
295
296                 <h3><?php _e( 'Menu Settings' ); ?></h3>
297                 <table id="menu" class="form-table">
298                         <tr valign="top">
299                                 <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
300                                 <td>
301                         <?php
302                         $menu_perms = get_site_option( 'menu_items' );
303                         $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
304                         foreach ( (array) $menu_items as $key => $val ) {
305                                 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/>";
306                         }
307                         ?>
308                                 </td>
309                         </tr>
310                 </table>
311
312                 <?php do_action( 'wpmu_options' ); // Add more options here ?>
313
314                 <p class="submit"><input type="submit" class="button-primary" name="Submit" value="<?php esc_attr_e( 'Save Changes' ) ?>" /></p>
315         </form>
316 </div>
317
318 <?php include( './admin-footer.php' ); ?>