Changeset 12632
- Timestamp:
- 01/07/2010 04:27:46 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r12625 r12632 48 48 49 49 if ( $drop ) { 50 $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A); 51 $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); 50 $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A); 51 $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); 52 52 53 53 reset( $drop_tables ); … … 220 220 ); 221 221 update_option( 'adminhash', $new_admin_email ); 222 222 223 223 $content = apply_filters( 'new_admin_email_content', __("Dear user, 224 224 225 You recently requested to have the administration email address on 225 You recently requested to have the administration email address on 226 226 your blog changed. 227 227 If this is correct, please click on the following link to change it: … … 236 236 All at ###SITENAME### 237 237 ###SITEURL###"), $new_admin_email ); 238 238 239 239 $content = str_replace('###ADMIN_URL###', clean_url(get_option( "siteurl" ).'/wp-admin/options.php?adminhash='.$hash), $content); 240 240 $content = str_replace('###EMAIL###', $value, $content); 241 241 $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content); 242 242 $content = str_replace('###SITEURL###', 'http://' . $current_site->domain . $current_site->path, $content); 243 243 244 244 wp_mail( $value, sprintf(__('[%s] New Admin Email Address'), get_option('blogname')), $content ); 245 245 } … … 355 355 function get_space_allowed() { 356 356 $spaceAllowed = get_option("blog_upload_space"); 357 if( $spaceAllowed == false ) 357 if( $spaceAllowed == false ) 358 358 $spaceAllowed = get_site_option("blog_upload_space"); 359 359 if( empty($spaceAllowed) || !is_numeric($spaceAllowed) ) … … 377 377 } 378 378 ?> 379 <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong> 379 <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong> 380 380 <?php 381 381 } 382 382 383 383 // Display File upload quota on dashboard 384 function dashboard_quota() { 384 function dashboard_quota() { 385 385 if ( get_site_option( 'upload_space_check_disabled' ) ) { 386 386 return true; … … 413 413 // Edit blog upload space setting on Edit Blog page 414 414 function upload_space_setting( $id ) { 415 $quota = get_blog_option($id, "blog_upload_space"); 415 $quota = get_blog_option($id, "blog_upload_space"); 416 416 if( !$quota ) 417 417 $quota = ''; 418 418 419 419 ?> 420 420 <tr> … … 433 433 if( $refresh == 1 ) 434 434 refresh_user_details($id); 435 435 436 436 if( $pref == 'spam' ) { 437 if( $value == 1 ) 437 if( $value == 1 ) 438 438 do_action( "make_spam_user", $id ); 439 439 else … … 446 446 function refresh_user_details($id) { 447 447 $id = (int) $id; 448 448 449 449 if ( !$user = get_userdata( $id ) ) 450 450 return false; … … 465 465 466 466 $dirName = trailingslashit( BLOGUPLOADDIR ); 467 if (!(is_dir($dirName) && is_readable($dirName))) 468 return; 467 if (!(is_dir($dirName) && is_readable($dirName))) 468 return; 469 469 470 470 $dir = dir($dirName); … … 513 513 if ( isset( $_GET[ 'c' ] ) ) 514 514 $c = (int)$_GET[ 'c' ]; 515 515 516 516 if ( $c >= 5 ) { 517 517 wp_die( __( "You don’t have permission to view this blog. Please contact the system administrator." ) ); … … 522 522 $dashboard_blog = get_dashboard_blog(); 523 523 if( is_object( $blog ) ) { 524 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 524 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 525 525 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" 526 526 exit; 527 527 } 528 528 529 /* 530 If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, 529 /* 530 If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, 531 531 then update the primary_blog record to match the user's blog 532 532 */ … … 541 541 } 542 542 $blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) ); 543 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 543 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 544 544 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" 545 545 exit; … … 559 559 $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' ); 560 560 } 561 $removed = array( 561 $removed = array( 562 562 'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ), 563 563 'reading' => array( 'gzipcompression' ), … … 585 585 586 586 function mu_dropdown_languages( $lang_files = array(), $current = '' ) { 587 $flag = false; 587 $flag = false; 588 588 $output = array(); 589 589 590 590 foreach ( (array) $lang_files as $val ) { 591 591 $code_lang = basename( $val, '.mo' ); 592 592 593 593 if ( $code_lang == 'en_US' ) { // American English 594 594 $flag = true; … … 603 603 $output[$translated] = '<option value="'.$code_lang.'"'.(($current == $code_lang) ? ' selected="selected"' : '').'> '.$translated.'</option>'; 604 604 } 605 606 } 607 605 606 } 607 608 608 if ( $flag === false ) { // WordPress english 609 609 $output[] = '<option value=""'.((empty($current)) ? ' selected="selected"' : '').'>'.__('English')."</option>"; 610 610 } 611 611 612 612 // Order by name 613 613 uksort($output, 'strnatcasecmp'); 614 615 $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current); 616 echo implode("\n\t", $output); 614 615 $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current); 616 echo implode("\n\t", $output); 617 617 } 618 618 … … 763 763 if ( !isset( $_GET['sitewide'] ) ) 764 764 return false; 765 765 766 766 /* Add the plugin to the list of sitewide active plugins */ 767 767 $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); 768 768 769 769 /* Add the activated plugin to the list */ 770 770 $active_sitewide_plugins[ $_GET['plugin'] ] = time(); … … 776 776 return true; 777 777 } 778 add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); 778 add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); 779 779 780 780 /** … … 786 786 if ( !$plugin ) 787 787 $plugin = $_GET['plugin']; 788 788 789 789 /* Get the active sitewide plugins */ 790 790 $active_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); … … 798 798 if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) ) 799 799 wp_redirect( 'plugins.php?error=true' ); 800 800 801 801 return true; 802 802 } 803 add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); 804 add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); 803 add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); 804 add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); 805 805 806 806 /** … … 812 812 if ( !is_site_admin() ) 813 813 return false; 814 814 815 815 if ( 'sitewide-active' == $context ) 816 816 return false; 817 817 818 818 if ( is_plugin_active( $file ) ) 819 819 return false; 820 820 821 821 echo '<tr><td colspan="5" style="background: #f5f5f5; text-align: right;">'; 822 822 … … 835 835 /* Open the plugin file for reading to check if this is a ms-plugin. */ 836 836 $fp = @fopen( WP_PLUGIN_DIR . '/' . $file, 'r' ); 837 837 838 838 /* Pull only the first 8kiB of the file in. */ 839 839 $plugin_data = @fread( $fp, 8192 ); 840 840 841 841 /* PHP will close file handle, but we are good citizens. */ 842 842 @fclose($fp); 843 843 844 844 if ( preg_match( '|Site Wide Only:(.*)true$|mi', $plugin_data ) ) 845 845 return true; … … 859 859 if ( !is_site_admin() ) 860 860 return false; 861 861 862 862 $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins') ); 863 863 $context = 'sitewide-active'; 864 864 865 if ( $active_sitewide_plugins ) { 865 if ( $active_sitewide_plugins ) { 866 866 ?> 867 867 <h3><?php _e( 'Currently Active Site Wide Plugins' ) ?></h3> 868 868 869 869 <p><?php _e( 'Plugins that appear in the list below are activate for all blogs across this installation.' ) ?></p> 870 870 … … 899 899 900 900 $plugin_data = $all_plugins[$plugin_file]; 901 901 902 902 echo " 903 903 <tr class='$context' style='background: #eef2ff;'> … … 932 932 echo "</td> 933 933 </tr>\n"; 934 934 935 935 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context ); 936 936 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context ); … … 939 939 </tbody> 940 940 </table> 941 941 942 942 <p><?php _e( 'Plugins that are enabled site wide can only be disabled by a site administrator.' ) ?></p> 943 943 944 944 <?php 945 945 } … … 960 960 } 961 961 962 /* Now unset any sitewide only plugins if the user is not a site admin */ 962 /* Now unset any sitewide only plugins if the user is not a site admin */ 963 963 if ( !is_site_admin() ) { 964 964 foreach ( $inactive_plugins as $plugin_name => $activated_time ) { … … 967 967 } 968 968 } 969 969 970 970 return $inactive_plugins; 971 971 } … … 984 984 unset( $active_plugins[ $sitewide_plugin ] ); 985 985 } 986 986 987 987 return $active_plugins; 988 988 } … … 997 997 function check_is_wpmu_plugin_on_activate() { 998 998 /*** 999 * On plugin activation on a blog level, check to see if this is actually a 999 * On plugin activation on a blog level, check to see if this is actually a 1000 1000 * site wide MU plugin. If so, deactivate and activate it site wide. 1001 1001 */ 1002 1002 if ( is_wpmu_sitewide_plugin( $_GET['plugin'] ) || isset( $_GET['sitewide'] ) ) { 1003 1003 deactivate_plugins( $_GET['plugin'], true ); 1004 1004 1005 1005 /* Silently activate because the activate_* hook has already run. */ 1006 1006 if ( is_site_admin() ) { … … 1023 1023 if ( is_site_admin() ) 1024 1024 activate_sitewide_plugin( $plugin ); 1025 } 1025 } 1026 1026 } 1027 1027 } … … 1051 1051 ?> 1052 1052 <select name="primary_blog"> 1053 <?php foreach( (array) $all_blogs as $blog ) { 1053 <?php foreach( (array) $all_blogs as $blog ) { 1054 1054 if( $primary_blog == $blog->userblog_id ) 1055 1055 $found = true; 1056 ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php 1056 ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php 1057 1057 } ?> 1058 1058 </select> … … 1074 1074 </tr> 1075 1075 </table> 1076 <?php 1076 <?php 1077 1077 } 1078 1078 add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' ); … … 1145 1145 <?php 1146 1146 do_action( 'myblogs_allblogs_options' ); 1147 ?><table class='widefat'> <?php 1147 ?><table class='widefat'> <?php 1148 1148 $settings_html = apply_filters( 'myblogs_options', '', 'global' ); 1149 1149 if ( $settings_html != '' ) { … … 1166 1166 $split = $split + $cols; 1167 1167 } 1168 1168 1169 1169 foreach( $rows as $row ) { 1170 1170 $c = $c == "alternate" ? "" : "alternate"; … … 1217 1217 foreach( $rows as $row ) { 1218 1218 $value = $row->meta_value; 1219 if ( !@unserialize( $value ) ) 1220 $value = stripslashes( $value ); 1219 if ( !@unserialize( $value ) ) 1220 $value = stripslashes( $value ); 1221 1221 if ( $value !== $row->meta_value ) { 1222 1222 update_site_option( $row->meta_key, $value ); … … 1231 1231 foreach( $rows as $row ) { 1232 1232 $value = $row->option_value; 1233 if ( !@unserialize( $value ) ) 1234 $value = stripslashes( $value ); 1233 if ( !@unserialize( $value ) ) 1234 $value = stripslashes( $value ); 1235 1235 if ( $value !== $row->option_value ) { 1236 1236 update_blog_option( $blog_id, $row->option_name, $value ); -
trunk/wp-admin/ms-admin.php
r12628 r12632 31 31 32 32 <div class="wrap"> 33 <h2><?php echo wp_specialchars( $title ); ?></h2> 33 <h2><?php echo wp_specialchars( $title ); ?></h2> 34 34 35 35 <ul class="subsubsub"> … … 45 45 <p> 46 46 <input type="hidden" name="action" value="users" /> 47 <input type="text" name="s" value="" size="17" /> 47 <input type="text" name="s" value="" size="17" /> 48 48 <input class="button" type="submit" name="submit" value="<?php esc_attr_e("Search Users"); ?>" /> 49 </p> 49 </p> 50 50 </form> 51 51 -
trunk/wp-admin/ms-edit.php
r12624 r12632 11 11 do_action('wpmuadminedit', ''); 12 12 13 if( isset($_GET[ 'id' ]) ) { 14 $id = intval( $_GET[ 'id' ] ); 15 } elseif( isset($_POST[ 'id' ]) ) { 16 $id = intval( $_POST[ 'id' ] ); 13 if( isset($_GET[ 'id' ]) ) { 14 $id = intval( $_GET[ 'id' ] ); 15 } elseif( isset($_POST[ 'id' ]) ) { 16 $id = intval( $_POST[ 'id' ] ); 17 17 } 18 18 … … 144 144 if ( empty($domain) || empty($email)) 145 145 wp_die( __('Missing blog address or email address.') ); 146 if( !is_email( $email ) ) 147 wp_die( __('Invalid email address') ); 146 if( !is_email( $email ) ) 147 wp_die( __('Invalid email address') ); 148 148 149 149 if( constant( 'VHOST' ) == 'yes' ) { … … 219 219 update_option( 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 220 220 } 221 221 222 222 $wp_rewrite->flush_rules(); 223 223 … … 318 318 $blogfunction = 'all_spam'; 319 319 update_blog_status( $val, "spam", '1', 0 ); 320 set_time_limit(60); 320 set_time_limit(60); 321 321 } elseif ( isset($_POST['allblog_notspam']) ) { 322 322 $blogfunction = 'all_notspam'; 323 323 update_blog_status( $val, "spam", '0', 0 ); 324 set_time_limit(60); 324 set_time_limit(60); 325 325 } 326 326 } … … 432 432 <?php wp_nonce_field( $_GET['action2'] ) ?> 433 433 <p><?php echo wp_specialchars( stripslashes($_GET['msg']) ); ?></p> 434 <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p> 434 <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p> 435 435 </form> 436 436 </body> -
trunk/wp-admin/ms-options.php
r12627 r12632 281 281 <?php 282 282 $menu_perms = get_site_option( "menu_items" ); 283 $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) ); 283 $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) ); 284 284 foreach ( (array) $menu_items as $key => $val ) { 285 285 echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . (( $menu_perms[$key] == '1' ) ? ' checked="checked"' : '') . " /></td></tr>"; -
trunk/wp-admin/ms-sites.php
r12629 r12632 82 82 <form method="post" action="ms-edit.php?action=updateblog"> 83 83 <?php wp_nonce_field('editblog'); ?> 84 <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> 84 <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> 85 85 <div class='metabox-holder' style='width:49%;float:left;'> 86 86 <div id="blogedit_bloginfo" class="postbox " > … … 89 89 <table class="form-table"> 90 90 <tr class="form-field form-required"> 91 <th scope="row"><?php _e('Domain') ?></th> 91 <th scope="row"><?php _e('Domain') ?></th> 92 92 <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td> 93 </tr> 93 </tr> 94 94 <tr class="form-field form-required"> 95 <th scope="row"><?php _e('Path') ?></th> 95 <th scope="row"><?php _e('Path') ?></th> 96 96 <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' /> 97 97 <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td> 98 </tr> 98 </tr> 99 99 <tr class="form-field"> 100 <th scope="row"><?php _e('Registered') ?></th> 101 <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td> 102 </tr> 100 <th scope="row"><?php _e('Registered') ?></th> 101 <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td> 102 </tr> 103 103 <tr class="form-field"> 104 <th scope="row"><?php _e('Last Updated') ?></th> 105 <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td> 106 </tr> 104 <th scope="row"><?php _e('Last Updated') ?></th> 105 <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td> 106 </tr> 107 107 <tr class="form-field"> 108 <th scope="row"><?php _e('Public') ?></th> 108 <th scope="row"><?php _e('Public') ?></th> 109 109 <td> 110 110 <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 111 111 <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 112 </td> 113 </tr> 112 </td> 113 </tr> 114 114 <tr class="form-field"> 115 <th scope="row"><?php _e( 'Archived' ); ?></th> 115 <th scope="row"><?php _e( 'Archived' ); ?></th> 116 116 <td> 117 117 <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 118 118 <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 119 </td> 120 </tr> 119 </td> 120 </tr> 121 121 <tr class="form-field"> 122 <th scope="row"><?php _e( 'Mature' ); ?></th> 122 <th scope="row"><?php _e( 'Mature' ); ?></th> 123 123 <td> 124 124 <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 125 125 <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 126 </td> 127 </tr> 126 </td> 127 </tr> 128 128 <tr class="form-field"> 129 <th scope="row"><?php _e( 'Spam' ); ?></th> 129 <th scope="row"><?php _e( 'Spam' ); ?></th> 130 130 <td> 131 131 <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 132 132 <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 133 </td> 134 </tr> 133 </td> 134 </tr> 135 135 <tr class="form-field"> 136 <th scope="row"><?php _e( 'Deleted' ); ?></th> 136 <th scope="row"><?php _e( 'Deleted' ); ?></th> 137 137 <td> 138 138 <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 139 139 <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 140 </td> 141 </tr> 140 </td> 141 </tr> 142 142 </table> 143 143 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p> 144 144 </div></div> 145 145 146 146 <div id="blogedit_blogoptions" class="postbox " > 147 147 <h3 class='hndle'><span><?php printf( __('Blog options (wp_%s_options)'), $id ); ?></span></h3> … … 166 166 ?> 167 167 <tr class="form-field"> 168 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 168 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 169 169 <td><textarea rows="5" cols="40" name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>"<?php echo $disabled ?>><?php echo wp_specialchars( stripslashes( $val['option_value'] ), 1 ) ?></textarea></td> 170 170 </tr> … … 173 173 ?> 174 174 <tr class="form-field"> 175 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 176 <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td> 177 </tr> 175 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 176 <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td> 177 </tr> 178 178 <?php 179 179 } … … 184 184 </div></div> 185 185 </div> 186 186 187 187 <div class='metabox-holder' style='width:49%;float:right;'> 188 188 <?php … … 200 200 $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : ''; 201 201 $out .= '<tr class="form-field form-required"> 202 <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th> 203 <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td> 202 <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th> 203 <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td> 204 204 </tr>'; 205 205 } 206 206 } 207 207 208 208 if ( $out != '' ) { 209 209 ?> … … 218 218 </div></div> 219 219 <?php } ?> 220 220 221 221 <?php 222 222 // Blog users … … 237 237 ?> 238 238 <td> 239 <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php 239 <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php 240 240 foreach( $editblog_roles as $role => $role_assoc ){ 241 241 $name = translate_with_context($role_assoc['name']); … … 261 261 } 262 262 ?> 263 263 264 264 <div id="blogedit_blogadduser" class="postbox"> 265 265 <h3 class='hndle'><span><?php _e('Add a new user'); ?></span></h3> … … 275 275 <td> 276 276 <select name="new_role" id="new_role"> 277 <?php 277 <?php 278 278 reset( $editblog_roles ); 279 279 foreach( $editblog_roles as $role => $role_assoc ){ … … 289 289 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p> 290 290 </div></div> 291 291 292 292 <div id="blogedit_miscoptions" class="postbox"> 293 293 <h3 class='hndle'><span><?php _e('Misc Blog Actions') ?></span></h3> … … 298 298 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p> 299 299 </div></div> 300 300 301 301 </div> 302 302 303 303 <div style="clear:both;"></div> 304 304 </form> … … 325 325 AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id 326 326 AND {$wpdb->registration_log}.IP LIKE ('%{$s}%')"; 327 } 327 } 328 328 329 329 if( isset( $_GET['sortby'] ) == false ) { … … 408 408 'users' => __('Users') 409 409 ); 410 410 411 411 if( has_filter( 'wpmublogsaction' ) ) 412 412 $posts_columns['plugins'] = __('Actions'); 413 413 414 414 $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns); 415 415 … … 428 428 <?php foreach($posts_columns as $column_id => $column_display_name) { 429 429 $column_link = "<a href='ms-blogs.php?{$sortby_url}&sortby={$column_id}&"; 430 if( $_GET['sortby'] == $column_id ) { 430 if( $_GET['sortby'] == $column_id ) { 431 431 $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&' : 'order=DESC&'; 432 432 } … … 444 444 $bgcolor = $class = ''; 445 445 $status_list = array( "archived" => "#fee", "spam" => "#faa", "deleted" => "#f55" ); 446 foreach ($blog_list as $blog) { 446 foreach ($blog_list as $blog) { 447 447 $class = ('alternate' == $class) ? '' : 'alternate'; 448 448 reset( $status_list ); … … 456 456 echo "<tr $bgcolour class='$class'>"; 457 457 458 $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; 458 $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; 459 459 foreach( $posts_columns as $column_name=>$column_display_name ) { 460 460 switch($column_name) { … … 468 468 <?php 469 469 break; 470 470 471 471 case 'blogname': ?> 472 472 <td valign="top"> … … 477 477 $controlActions[] = '<a href="ms-blogs.php?action=editblog&id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>'; 478 478 $controlActions[] = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>'; 479 479 480 480 if( get_blog_status( $blog['blog_id'], "deleted" ) == '1' ) 481 481 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=activateblog&ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>'; 482 482 else 483 483 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=deactivateblog&ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>'; 484 484 485 485 if( get_blog_status( $blog['blog_id'], "archived" ) == '1' ) 486 486 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>'; 487 487 else 488 488 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>'; 489 489 490 490 if( get_blog_status( $blog['blog_id'], "spam" ) == '1' ) 491 491 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>'; 492 492 else 493 493 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to mark the blog %s as spam" ), $blogname ) ) . '">' . __("Spam") . '</a>'; 494 494 495 495 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . __("Delete") . '</a>'; 496 496 497 497 $controlActions[] = "<a href='http://{$blog['domain']}{$blog['path']}' rel='permalink'>" . __('Visit') . '</a>'; 498 498 ?> 499 499 500 500 <?php if (count($controlActions)) : ?> 501 501 <div class="row-actions"> … … 506 506 <?php 507 507 break; 508 508 509 509 case 'lastupdated': ?> 510 510 <td valign="top"> … … 523 523 <td valign="top"> 524 524 <?php 525 $blogusers = get_users_of_blog( $blog['blog_id'] ); 525 $blogusers = get_users_of_blog( $blog['blog_id'] ); 526 526 if ( is_array( $blogusers ) ) { 527 527 $blogusers_warning = ''; … … 531 531 } 532 532 foreach ( $blogusers as $key => $val ) { 533 echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />'; 533 echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />'; 534 534 } 535 535 if( $blogusers_warning != '' ) { … … 549 549 <?php } ?> 550 550 <?php break; 551 551 552 552 default: ?> 553 553 <?php if( has_filter( 'manage_blogs_custom_column' ) ) { ?> … … 564 564 } 565 565 } else { ?> 566 <tr style='background-color: <?php echo $bgcolor; ?>'> 567 <td colspan="8"><?php _e('No blogs found.') ?></td> 568 </tr> 566 <tr style='background-color: <?php echo $bgcolor; ?>'> 567 <td colspan="8"><?php _e('No blogs found.') ?></td> 568 </tr> 569 569 <?php 570 570 } // end if ($blogs) … … 586 586 <td> 587 587 <?php if ( constant( "VHOST" ) == 'yes' ) { ?> 588 <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?> 588 <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?> 589 589 <?php } else { 590 590 echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/> 591 <?php } 591 <?php } 592 592 echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>"; 593 593 ?> -
trunk/wp-admin/ms-upgrade-site.php
r12627 r12632 38 38 } 39 39 do_action( 'after_mu_upgrade', $response ); 40 do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] ); 40 do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] ); 41 41 } 42 42 } … … 55 55 } 56 56 break; 57 default: 57 default: 58 58 ?><p><?php _e("You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade."); ?></p> 59 59 <p><a class="button" href="ms-upgrade-site.php?action=upgrade"><?php _e("Upgrade Site"); ?></a></p><?php -
trunk/wp-admin/ms-users.php
r12627 r12632 27 27 _e('Users marked as spam !'); 28 28 break; 29 case 'all_notspam': 30 _e('Users marked as not spam !'); 31 break; 29 case 'all_notspam': 30 _e('Users marked as not spam !'); 31 break; 32 32 case 'all_delete': 33 33 _e('Users deleted !'); … … 86 86 // Pagination 87 87 $user_navigation = paginate_links( array( 88 'total' => ceil($total / $num), 88 'total' => ceil($total / $num), 89 89 'current' => $apage, 90 90 'base' => add_query_arg( 'apage', '%#%' ), 91 91 'format' => '' 92 92 )); 93 93 94 94 if ( $user_navigation ) { 95 95 $user_navigation = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s', … … 100 100 ); 101 101 } 102 102 103 103 ?> 104 104 <div class="wrap"> … … 158 158 <?php if ($user_list) { 159 159 $bgcolor = ''; 160 foreach ( (array) $user_list as $user) { 160 foreach ( (array) $user_list as $user) { 161 161 $class = ('alternate' == $class) ? '' : 'alternate'; 162 162 163 163 $status_list = array( "spam" => "#faa", "deleted" => "#f55" ); 164 164 165 165 $bgcolour = ""; 166 166 foreach ( $status_list as $status => $col ) { … … 178 178 case 'checkbox': ?> 179 179 <th scope="row" class="check-column"><input type='checkbox' id='user_<?php echo $user['ID'] ?>' name='allusers[]' value='<?php echo esc_attr($user['ID']) ?>' /></th> 180 <?php 180 <?php 181 181 break; 182 182 … … 213 213 break; 214 214 215 case 'blogs': 215 case 'blogs': 216 216 $blogs = get_blogs_of_user( $user['ID'], true ); 217 217 ?> … … 223 223 echo '<a href="ms-blogs.php?action=editblog&id=' . $val->userblog_id . '">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>'; 224 224 echo ' <small class="row-actions">'; 225 225 226 226 // Edit 227 227 echo '<a href="ms-blogs.php?action=editblog&id=' . $val->userblog_id . '">' . __('Edit') . '</a> | '; 228 228 229 229 // View 230 echo '<a '; 230 echo '<a '; 231 231 if( get_blog_status( $val->userblog_id, 'spam' ) == 1 ) 232 232 echo 'style="background-color: #f66" '; 233 233 echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>'; 234 235 echo '</small><br />'; 234 235 echo '</small><br />'; 236 236 } 237 237 } … … 248 248 endforeach 249 249 ?> 250 </tr> 250 </tr> 251 251 <?php 252 252 } 253 253 } else { 254 254 ?> 255 <tr style='background-color: <?php echo $bgcolor; ?>'> 256 <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td> 257 </tr> 255 <tr style='background-color: <?php echo $bgcolor; ?>'> 256 <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td> 257 </tr> 258 258 <?php 259 259 } // end if ($users) 260 ?> 260 ?> 261 261 </tbody> 262 262 </table> 263 263 264 264 <div class="tablenav"> 265 265 <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?> -
trunk/wp-includes/ms-functions.php
r12628 r12632 78 78 function get_admin_users_for_domain( $sitedomain = '', $path = '' ) { 79 79 global $wpdb; 80 80 81 81 if( $sitedomain == '' ) { 82 82 $site_id = $wpdb->siteid; … … 188 188 * 189 189 * @deprecated Use {@link is_keymaster()} 190 * 190 * 191 191 */ 192 192 function is_site_admin( $user_login = '' ) { … … 270 270 function add_blog_option( $id, $key, $value ) { 271 271 $id = (int) $id; 272 272 273 273 switch_to_blog($id); 274 274 add_option( $key, $value ); … … 279 279 function delete_blog_option( $id, $key ) { 280 280 $id = (int) $id; 281 281 282 282 switch_to_blog($id); 283 283 delete_option( $key ); … … 288 288 function update_blog_option( $id, $key, $value, $refresh = true ) { 289 289 $id = (int) $id; 290 290 291 291 switch_to_blog($id); 292 292 update_option( $key, $value ); … … 309 309 $switched_stack[] = $blog_id; 310 310 311 /* If we're switching to the same blog id that we're on, 312 * set the right vars, do the associated actions, but skip 311 /* If we're switching to the same blog id that we're on, 312 * set the right vars, do the associated actions, but skip 313 313 * the extra unnecessary work */ 314 314 if ( $blog_id == $new_blog ) { … … 408 408 do_action('switch_blog', $blog_id, $prev_blog_id); 409 409 410 /* If we still have items in the switched stack, consider ourselves still 'switched' */ 410 /* If we still have items in the switched stack, consider ourselves still 'switched' */ 411 411 $switched = ( is_array( $switched_stack ) && count( $switched_stack ) > 0 ); 412 412 return true; … … 512 512 $user_id = (int) $user_id; 513 513 $blog_id = (int) $blog_id; 514 514 515 515 if( $blog_id == 0 ) { 516 516 global $wpdb; 517 517 $blog_id = $wpdb->blogid; 518 518 } 519 519 520 520 $blogs = get_blogs_of_user( $user_id ); 521 521 if( is_array( $blogs ) ) { … … 907 907 function is_email_address_unsafe( $user_email ) { 908 908 $banned_names = get_site_option( "banned_email_domains" ); 909 if ($banned_names && !is_array( $banned_names )) { 910 $banned_names = explode( "\n", $banned_names); 911 } 909 if ($banned_names && !is_array( $banned_names )) { 910 $banned_names = explode( "\n", $banned_names); 911 } 912 912 if ( is_array( $banned_names ) && empty( $banned_names ) == false ) { 913 913 $email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) ); … … 1117 1117 $path = $wpdb->escape($path); 1118 1118 $title = $wpdb->escape($title); 1119 1119 1120 1120 $wpdb->insert( $wpdb->signups, array( 1121 'domain' => $domain, 1122 'path' => $path, 1121 'domain' => $domain, 1122 'path' => $path, 1123 1123 'title' => $title, 1124 'user_login' => $user, 1125 'user_email' => $user_email, 1124 'user_login' => $user, 1125 'user_email' => $user_email, 1126 1126 'registered' => current_time('mysql', true), 1127 'activation_key' => $key, 1127 'activation_key' => $key, 1128 1128 'meta' => $meta 1129 1129 ) ); … … 1140 1140 $key = substr( md5( time() . rand() . $user_email ), 0, 16 ); 1141 1141 $meta = serialize($meta); 1142 1142 1143 1143 $wpdb->insert( $wpdb->signups, array( 1144 'domain' => '', 1145 'path' => '', 1144 'domain' => '', 1145 'path' => '', 1146 1146 'title' => '', 1147 'user_login' => $user, 1148 'user_email' => $user_email, 1147 'user_login' => $user, 1148 'user_email' => $user_email, 1149 1149 'registered' => current_time('mysql', true), 1150 'activation_key' => $key, 1150 'activation_key' => $key, 1151 1151 'meta' => $meta 1152 1152 ) ); … … 1344 1344 if( get_site_option( 'registrationnotification' ) != 'yes' ) 1345 1345 return false; 1346 1346 1347 1347 $email = get_site_option( 'admin_email' ); 1348 1348 if( is_email($email) == false ) 1349 1349 return false; 1350 1350 1351 1351 $options_site_url = clean_url("http://{$current_site->domain}{$current_site->path}wp-admin/ms-options.php"); 1352 1352 … … 1355 1355 $siteurl = get_option( 'siteurl' ); 1356 1356 restore_current_blog(); 1357 1357 1358 1358 $msg = sprintf( __( "New Blog: %1s 1359 1359 URL: %2s … … 1362 1362 Disable these notifications: %4s"), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url); 1363 1363 $msg = apply_filters( 'newblog_notify_siteadmin', $msg ); 1364 1364 1365 1365 wp_mail( $email, sprintf( __( "New Blog Registration: %s" ), $siteurl ), $msg ); 1366 1366 return true; … … 1371 1371 if( get_site_option( 'registrationnotification' ) != 'yes' ) 1372 1372 return false; 1373 1373 1374 1374 $email = get_site_option( 'admin_email' ); 1375 1375 if( is_email($email) == false ) … … 1382 1382 1383 1383 Disable these notifications: %3s"), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url); 1384 1384 1385 1385 $msg = apply_filters( 'newuser_notify_siteadmin', $msg ); 1386 1386 wp_mail( $email, sprintf(__("New User Registration: %s"), $user->user_login), $msg ); … … 1417 1417 require_once( ABSPATH . 'wp-admin/includes/upgrade.php'); 1418 1418 1419 if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) 1419 if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) 1420 1420 die(__('<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>') . '</body></html>'); 1421 1421 $wpdb->suppress_errors( false); … … 1445 1445 $cat_name = __('Blogroll'); 1446 1446 $cat_slug = sanitize_title($cat_name); 1447 1447 1448 1448 $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); 1449 1449 if( $blogroll_id == null ) { … … 1488 1488 $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post ); 1489 1489 $wpdb->insert( $wpdb->posts, array( 1490 'post_author' => $user_id, 1491 'post_date' => $now, 1490 'post_author' => $user_id, 1491 'post_date' => $now, 1492 1492 'post_date_gmt' => $now_gmt, 1493 'post_content' => stripslashes( $first_post ), 1494 'post_excerpt' => '', 1493 'post_content' => stripslashes( $first_post ), 1494 'post_excerpt' => '', 1495 1495 'post_title' => __('Hello world!'), 1496 1496 'post_name' => __('hello-world'), … … 1507 1507 // First page 1508 1508 $wpdb->insert( $wpdb->posts, array( 1509 'post_author' => $user_id, 1510 'post_date' => $now, 1509 'post_author' => $user_id, 1510 'post_date' => $now, 1511 1511 'post_date_gmt' => $now_gmt, 1512 1512 'post_content' => get_site_option( 'first_page' ), 1513 'post_excerpt' => '', 1513 'post_excerpt' => '', 1514 1514 'post_title' => __('About'), 1515 1515 'post_name' => __('about'), … … 1522 1522 'post_content_filtered' => '' 1523 1523 ) ); 1524 1524 1525 1525 // Flush rules to pick up the new page. 1526 1526 $wp_rewrite->init(); … … 1529 1529 // Default comment 1530 1530 $wpdb->insert( $wpdb->comments, array( 1531 'comment_post_ID' => '1', 1531 'comment_post_ID' => '1', 1532 1532 'comment_author' => __( get_site_option( 'first_comment_author' ) ), 1533 1533 'comment_author_email' => '', 1534 1534 'comment_author_url' => get_site_option( 'first_comment_url' ), 1535 'comment_author_IP' => '127.0.0.1', 1535 'comment_author_IP' => '127.0.0.1', 1536 1536 'comment_date' => $now, 1537 'comment_date_gmt' => $now_gmt, 1537 'comment_date_gmt' => $now_gmt, 1538 1538 'comment_content' => __( get_site_option( 'first_comment' ) ) 1539 1539 ) ); 1540 1540 1541 1541 $user = new WP_User($user_id); 1542 1542 $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') ); … … 1545 1545 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'user_level') ); 1546 1546 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') ); 1547 1547 1548 1548 // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id. 1549 1549 if ( !is_site_admin( $user->user_login ) && $user_id != 1 ) … … 1606 1606 return false; 1607 1607 1608 $welcome_email = get_site_option( 'welcome_user_email' ); 1608 $welcome_email = get_site_option( 'welcome_user_email' ); 1609 1609 1610 1610 $user = new WP_User($user_id); … … 1747 1747 $spaceAllowed = get_space_allowed(); 1748 1748 if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) 1749 $spaceAllowed = 10; // Default space allowed is 10 MB 1750 1749 $spaceAllowed = 10; // Default space allowed is 10 MB 1750 1751 1751 $dirName = BLOGUPLOADDIR; 1752 1752 $size = get_dirsize($dirName) / 1024 / 1024; 1753 1754 if( ($spaceAllowed-$size) < 0 ) { 1753 1754 if( ($spaceAllowed-$size) < 0 ) { 1755 1755 if( $echo ) 1756 1756 _e( "Sorry, you have used your space allocation. Please delete some files to upload more files." ); //No space left … … 1788 1788 return 0; 1789 1789 } 1790 1790 1791 1791 $spaceAllowed = 1024 * 1024 * get_space_allowed(); 1792 1792 $dirName = BLOGUPLOADDIR; … … 1802 1802 function graceful_fail( $message ) { 1803 1803 $message = apply_filters('graceful_fail', $message); 1804 $message_template = apply_filters( 'graceful_fail_template', 1804 $message_template = apply_filters( 'graceful_fail_template', 1805 1805 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1806 1806 <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11"> … … 1844 1844 1845 1845 if( $this->reallydeleteblog == true ) { 1846 wpmu_delete_blog( $wpdb->blogid ); 1846 wpmu_delete_blog( $wpdb->blogid ); 1847 1847 } 1848 1848 } … … 1863 1863 $url_delete = get_option( "siteurl" ) . "/wp-admin/options-general.php?page=delete-blog&h=" . $hash; 1864 1864 $msg = __("Dear User, 1865 You recently clicked the 'Delete Blog' link on your blog and filled in a 1865 You recently clicked the 'Delete Blog' link on your blog and filled in a 1866 1866 form on that page. 1867 1867 If you really want to delete your blog, click the link below. You will not … … 1870 1870 1871 1871 If you delete your blog, please consider opening a new blog here 1872 some time in the future! (But remember your current blog and username 1872 some time in the future! (But remember your current blog and username 1873 1873 are gone forever.) 1874 1874 … … 1933 1933 clean_term_cache($term_id); 1934 1934 1935 return $global_id; 1936 } 1935 return $global_id; 1936 } 1937 1937 1938 1938 function redirect_this_site( $deprecated = '' ) { … … 1945 1945 return $upload; 1946 1946 if( strlen( $upload[ 'bits' ] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) { 1947 return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 )); 1947 return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 )); 1948 1948 } 1949 1949 … … 2113 2113 } 2114 2114 2115 /* Short circuit the update checks. Make sure update informtion is 2115 /* Short circuit the update checks. Make sure update informtion is 2116 2116 stored in wp_sitemeta rather than the options table of individual blogs */ 2117 2117 … … 2198 2198 2199 2199 $dashboard_blog = get_dashboard_blog(); 2200 if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) { 2201 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 2200 if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) { 2201 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 2202 2202 wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' ); 2203 2203 die(); … … 2223 2223 if( $blog_id == 0 ) 2224 2224 $blog_id = $wpdb->blogid; 2225 2225 2226 2226 $local_key = $wpdb->base_prefix . $blog_id . "_" . $key; 2227 2227 if( isset( $current_user->$local_key ) ) … … 2347 2347 if ( !$active_sitewide_plugins ) 2348 2348 return $active_plugins; 2349 2349 2350 2350 $plugins = array_merge( (array) $active_plugins, array_keys( (array) $active_sitewide_plugins ) ); 2351 2351 sort( $plugins ); -
trunk/wp-includes/ms-settings.php
r12610 r12632 54 54 if( $current_site ) 55 55 return $current_site; 56 56 57 57 $wpdb->suppress_errors(); 58 58 $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site
Note: See TracChangeset
for help on using the changeset viewer.