X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9c2096d803812dacbdf6cf8efe90053e39f00b96..11be15bd505d66a91e2c80062190b13e315a04a9:/wp-admin/update-core.php diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index c071dc23..c8f58774 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -18,7 +18,7 @@ if ( is_multisite() && ! is_network_admin() ) { exit(); } -if ( ! current_user_can( 'update_core' ) ) +if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) ) wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); function list_core_update( $update ) { @@ -36,7 +36,7 @@ function list_core_update( $update ) { $mysql_version = $wpdb->db_version(); $show_buttons = true; if ( 'development' == $update->response ) { - $message = __('You are using a development version of WordPress. You can update to the latest nightly build automatically or download the nightly build and install it manually:'); + $message = __('You are using a development version of WordPress. You can update to the latest nightly build automatically or download the nightly build and install it manually:'); $download = __('Download nightly build'); } else { if ( $current ) { @@ -74,7 +74,7 @@ function list_core_update( $update ) { echo ''; if ( $show_buttons ) { if ( $first_pass ) { - submit_button( $submit, $current ? 'button' : 'primary', 'upgrade', false ); + submit_button( $submit, $current ? 'button' : 'primary regular', 'upgrade', false ); $first_pass = false; } else { submit_button( $submit, 'button', 'upgrade', false ); @@ -131,28 +131,9 @@ function dismissed_updates() { * @return null */ function core_upgrade_preamble() { - global $upgrade_error, $wp_version; + global $wp_version; $updates = get_core_updates(); -?> -
- -

-

'; - if ( $upgrade_error == 'themes' ) - _e('Please select one or more themes to update.'); - else - _e('Please select one or more plugins to update.'); - echo '

'; - } - - echo '

'; - /* translators: %1 date, %2 time. */ - printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) ); - echo '   ' . __( 'Check Again' ) . ''; - echo '

'; if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { echo '

'; @@ -180,16 +161,9 @@ function core_upgrade_preamble() { echo '

' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '

'; } else { list( $normalized_version ) = explode( '-', $wp_version ); - echo '

' . sprintf( __( 'Learn more about WordPress %s.' ), esc_url( admin_url( 'about.php' ) ), $normalized_version ) . '

'; + echo '

' . sprintf( __( 'Learn more about WordPress %s.' ), esc_url( self_admin_url( 'about.php' ) ), $normalized_version ) . '

'; } dismissed_updates(); - - if ( current_user_can( 'update_plugins' ) ) - list_plugin_updates(); - if ( current_user_can( 'update_themes' ) ) - list_theme_updates(); - do_action('core_upgrade_preamble'); - echo ''; } function list_plugin_updates() { @@ -214,7 +188,7 @@ function list_plugin_updates() { ?>

-
+

@@ -260,7 +234,7 @@ function list_plugin_updates() { $upgrade_notice = ''; } - $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&TB_iframe=true&width=640&height=662'); + $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '§ion=changelog&TB_iframe=true&width=640&height=662'); $details_text = sprintf(__('View version %1$s details'), $plugin_data->update->new_version); $details = sprintf('%3$s.', esc_url($details_url), esc_attr($plugin_data->Name), $details_text); @@ -292,7 +266,7 @@ function list_theme_updates() {

Please Note: Any customizations you have made to theme files will be lost. Please consider using child themes for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?>

- +

@@ -311,13 +285,11 @@ function list_theme_updates() { $theme_data) { - $screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot; - + foreach ( $themes as $stylesheet => $theme ) { echo " - - + + "; } ?> @@ -352,7 +324,6 @@ function do_core_upgrade( $reinstall = false ) { if ( !$update ) return; - if ( ! WP_Filesystem($credentials, ABSPATH) ) { request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again return; @@ -383,12 +354,12 @@ function do_core_upgrade( $reinstall = false ) { } show_message( __('WordPress updated successfully') ); - show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); - show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '' ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '' ); ?> add_help_tab( array( '

' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '

' ) ); - get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Updating WordPress') . '

' . @@ -458,10 +428,41 @@ if ( 'upgrade-core' == $action ) { wp_version_check(); require_once(ABSPATH . 'wp-admin/admin-header.php'); - core_upgrade_preamble(); + ?> +
+ +

+

'; + if ( $upgrade_error == 'themes' ) + _e('Please select one or more themes to update.'); + else + _e('Please select one or more plugins to update.'); + echo '

'; + } + + echo '

'; + /* translators: %1 date, %2 time. */ + printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) ); + echo '   ' . __( 'Check Again' ) . ''; + echo '

'; + + if ( current_user_can( 'update_core' ) ) + core_upgrade_preamble(); + if ( current_user_can( 'update_plugins' ) ) + list_plugin_updates(); + if ( current_user_can( 'update_themes' ) ) + list_theme_updates(); + do_action('core_upgrade_preamble'); + echo ''; include(ABSPATH . 'wp-admin/admin-footer.php'); } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { + + if ( ! current_user_can( 'update_core' ) ) + wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); + check_admin_referer('upgrade-core'); // do the (un)dismiss actions before headers,
{$theme_data->Name}" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . "" . $theme->display('Name') . ' ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "