summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-09-19 13:05:29 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-09-19 13:05:29 +0000
commitfceaa31bd8c35850ef9ab42c612e6c39a500c71c (patch)
treedc80d714618991f9a96eefa6a9fab659cc82ce3e
parent97133b20063404913537feb138e31bcabec590e5 (diff)
downloadwordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.tar.gz
wordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.tar.xz
wordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.zip
Add mu version blog count to update request.
Add current_site details to User Agent with "currentsite_on_version_check" filter. Store current version details in a site option. Only show update messages to site admins. git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1481 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/includes/mu.php4
-rw-r--r--wp-admin/includes/update.php14
-rw-r--r--wp-includes/update.php16
3 files changed, 17 insertions, 17 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 648f9bb..9db85a3 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -694,10 +694,6 @@ function mu_dashboard() {
}
add_action( 'wp_dashboard_setup', 'mu_dashboard' );
-/* Unused update message called from Dashboard */
-function update_right_now_message() {
-}
-
function profile_update_primary_blog() {
global $current_user;
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index 5cc83f7..ddfc10c 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -1,13 +1,14 @@
<?php
-/*
// The admin side of our 1.1 update system
function core_update_footer( $msg = '' ) {
+ if( !is_site_admin() )
+ return false;
if ( !current_user_can('manage_options') )
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
- $cur = get_option( 'update_core' );
+ $cur = get_site_option( 'update_core' );
switch ( $cur->response ) {
case 'development' :
@@ -29,7 +30,9 @@ function core_update_footer( $msg = '' ) {
add_filter( 'update_footer', 'core_update_footer' );
function update_nag() {
- $cur = get_option( 'update_core' );
+ if( !is_site_admin() )
+ return false;
+ $cur = get_site_option( 'update_core' );
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
return false;
@@ -45,7 +48,9 @@ add_action( 'admin_notices', 'update_nag', 3 );
// Called directly from dashboard
function update_right_now_message() {
- $cur = get_option( 'update_core' );
+ if( !is_site_admin() )
+ return false;
+ $cur = get_site_option( 'update_core' );
$msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') )
@@ -53,7 +58,6 @@ function update_right_now_message() {
echo "<span id='wp-version-message'>$msg</span>";
}
-*/
function wp_plugin_update_row( $file, $plugin_data ) {
if( !is_site_admin() )
diff --git a/wp-includes/update.php b/wp-includes/update.php
index 2aa3a6c..437e938 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -22,27 +22,27 @@ function wp_version_check() {
if ( !function_exists('fsockopen') || defined('WP_INSTALLING') )
return;
- global $wp_version, $current_site;
+ global $wp_version, $wpmu_version, $current_site;
$php_version = phpversion();
- $current = get_option( 'update_core' );
+ $current = get_site_option( 'update_core' );
$locale = get_locale();
if (
isset( $current->last_checked ) &&
43200 > ( time() - $current->last_checked ) &&
- $current->version_checked == $wp_version
+ $current->version_checked == $wpmu_version
)
return false;
$new_option = '';
$new_option->last_checked = time(); // this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day
- $new_option->version_checked = $wp_version;
+ $new_option->version_checked = $wpmu_version;
- $http_request = "GET /core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n";
+ $http_request = "GET /core/version-check/1.1/?version=$wp_version&wpmuversion=$wpmu_version&php=$php_version&locale=$locale&blogs=" . get_blog_count() . " HTTP/1.0\r\n";
$http_request .= "Host: api.wordpress.org\r\n";
$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
- $http_request .= 'User-Agent: WordPress MU/' . $wpmu_version . '; ' . get_bloginfo('url') . '; http://' . $current_site->domain . $current_site->path . "\r\n";
+ $http_request .= 'User-Agent: WordPress MU/' . $wpmu_version . '; ' . apply_filters( 'currentsite_on_version_check', 'http://' . $current_site->domain . $current_site->path ) . "\r\n";
$http_request .= "\r\n";
$response = '';
@@ -63,11 +63,11 @@ function wp_version_check() {
$new_option->response = attribute_escape( $returns[0] );
if ( isset( $returns[1] ) )
- $new_option->url = clean_url( $returns[1] );
+ $new_option->url = 'http://mu.wordpress.org/';
if ( isset( $returns[2] ) )
$new_option->current = attribute_escape( $returns[2] );
}
- update_option( 'update_core', $new_option );
+ update_site_option( 'update_core', $new_option );
}
add_action( 'init', 'wp_version_check' );