Wordpress 3.1.1
[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><strong>' . __('For more information:') . '</strong></p>' .
32         '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Settings_Screen" target="_blank">Documentation on Network Settings</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('options-general'); ?>
47         <h2><?php _e( 'Settings' ) ?></h2>
48         <form method="post" action="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( 'Registration Settings' ); ?></h3>
71                 <table class="form-table">
72                         <tr valign="top">
73                                 <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
74                                 <?php
75                                 if ( !get_site_option( 'registration' ) )
76                                         update_site_option( 'registration', 'none' );
77                                 $reg = get_site_option( 'registration' );
78                                 ?>
79                                 <td>
80                                         <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
81                                         <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
82                                         <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 />
83                                         <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 />
84                                         <?php if ( is_subdomain_install() )
85                                                 _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.' );
86                                         ?>
87                                 </td>
88                         </tr>
89
90                         <tr valign="top">
91                                 <th scope="row"><?php _e( 'Registration notification' ) ?></th>
92                                 <?php
93                                 if ( !get_site_option( 'registrationnotification' ) )
94                                         update_site_option( 'registrationnotification', 'yes' );
95                                 ?>
96                                 <td>
97                                         <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>
98                                 </td>
99                         </tr>
100
101                         <tr valign="top" id="addnewusers">
102                                 <th scope="row"><?php _e( 'Add New Users' ) ?></th>
103                                 <td>
104                                         <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>
105                                 </td>
106                         </tr>
107
108                         <tr valign="top">
109                                 <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
110                                 <td>
111                                         <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" />
112                                         <br />
113                                         <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
114                                 </td>
115                         </tr>
116
117                         <tr valign="top">
118                                 <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
119                                 <td>
120                                         <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
121                                         $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
122                                         <textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
123 <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
124                                         <br />
125                                         <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
126                                 </td>
127                         </tr>
128
129                         <tr valign="top">
130                                 <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
131                                 <td>
132                                         <textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
133 <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
134                                         <br />
135                                         <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
136                                 </td>
137                         </tr>
138
139                 </table>
140                 <h3><?php _e('New Site Settings'); ?></h3>
141                 <table class="form-table">
142
143                         <tr valign="top">
144                                 <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
145                                 <td>
146                                         <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
147 <?php echo esc_textarea( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
148                                         <br />
149                                         <?php _e( 'The welcome email sent to new site owners.' ) ?>
150                                 </td>
151                         </tr>
152                         <tr valign="top">
153                                 <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
154                                 <td>
155                                         <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
156 <?php echo esc_textarea( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
157                                         <br />
158                                         <?php _e( 'The welcome email sent to new users.' ) ?>
159                                 </td>
160                         </tr>
161                         <tr valign="top">
162                                 <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
163                                 <td>
164                                         <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
165 <?php echo esc_textarea( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
166                                         <br />
167                                         <?php _e( 'The first post on a new site.' ) ?>
168                                 </td>
169                         </tr>
170                         <tr valign="top">
171                                 <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
172                                 <td>
173                                         <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
174 <?php echo esc_textarea( stripslashes( get_site_option('first_page') ) ) ?></textarea>
175                                         <br />
176                                         <?php _e( 'The first page on a new site.' ) ?>
177                                 </td>
178                         </tr>
179                         <tr valign="top">
180                                 <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
181                                 <td>
182                                         <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
183 <?php echo esc_textarea( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
184                                         <br />
185                                         <?php _e( 'The first comment on a new site.' ) ?>
186                                 </td>
187                         </tr>
188                         <tr valign="top">
189                                 <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
190                                 <td>
191                                         <input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
192                                         <br />
193                                         <?php _e( 'The author of the first comment on a new site.' ) ?>
194                                 </td>
195                         </tr>
196                         <tr valign="top">
197                                 <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
198                                 <td>
199                                         <input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
200                                         <br />
201                                         <?php _e( 'The URL for the first comment on a new site.' ) ?>
202                                 </td>
203                         </tr>
204                 </table>
205                 <h3><?php _e( 'Upload Settings' ); ?></h3>
206                 <table class="form-table">
207                         <tr valign="top">
208                                 <th scope="row"><?php _e( 'Media upload buttons' ) ?></th>
209                                 <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
210                                 <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 />
211                                 <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 />
212                                 <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 />
213                                 <?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>
214                         </tr>
215
216                         <tr valign="top">
217                                 <th scope="row"><?php _e( 'Site upload space' ) ?></th>
218                                 <td>
219                                 <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 />
220                                 </td>
221                         </tr>
222
223                         <tr valign="top">
224                                 <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
225                                 <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>
226                         </tr>
227
228                         <tr valign="top">
229                                 <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
230                                 <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>
231                         </tr>
232                 </table>
233
234 <?php
235                 $languages = get_available_languages();
236                 if ( ! empty( $languages ) ) {
237                         $lang = get_site_option( 'WPLANG' );
238 ?>
239                 <h3><?php _e( 'Language Settings' ); ?></h3>
240                 <table class="form-table">
241                                 <tr valign="top">
242                                         <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
243                                         <td>
244                                                 <select name="WPLANG" id="WPLANG">
245                                                         <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
246                                                 </select>
247                                         </td>
248                                 </tr>
249                 </table>
250 <?php
251                 } // languages
252 ?>
253
254                 <h3><?php _e( 'Menu Settings' ); ?></h3>
255                 <table id="menu" class="form-table">
256                         <tr valign="top">
257                                 <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
258                                 <td>
259                         <?php
260                         $menu_perms = get_site_option( 'menu_items' );
261                         $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
262                         foreach ( (array) $menu_items as $key => $val ) {
263                                 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/>";
264                         }
265                         ?>
266                                 </td>
267                         </tr>
268                 </table>
269
270                 <?php do_action( 'wpmu_options' ); // Add more options here ?>
271
272                 <?php submit_button(); ?>
273         </form>
274 </div>
275
276 <?php include( '../admin-footer.php' ); ?>