WordPress.org

Make WordPress Core

Changeset 17048


Ignore:
Timestamp:
12/18/10 18:43:35 (3 years ago)
Author:
nacin
Message:

Use the update_core, update_plugins and update_themes caps in update-core.php. fixes #15866.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r16815 r17048  
    5252    $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; 
    5353 
    54     $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'install_plugins',  'update-core.php'); 
     54    $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'update_core',  'update-core.php'); 
    5555    unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress); 
    5656} 
  • trunk/wp-admin/network/menu.php

    r17029 r17048  
    6262 
    6363$menu[30] = array(sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div'); 
    64 $submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), 'install_plugins',  'update-core.php' ); 
     64$submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), 'update_core',  'update-core.php' ); 
    6565$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' ); 
    6666unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress); 
  • trunk/wp-admin/update-core.php

    r17040 r17048  
    1515} 
    1616 
    17 if ( ! current_user_can( 'update_plugins' ) ) 
     17if ( ! current_user_can( 'update_core' ) ) 
    1818    wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 
    1919 
     
    165165    dismissed_updates(); 
    166166 
    167     list_plugin_updates(); 
    168     list_theme_updates(); 
     167    if ( current_user_can( 'update_plugins' ) ) 
     168        list_plugin_updates(); 
     169    if ( current_user_can( 'update_themes' ) ) 
     170        list_theme_updates(); 
    169171    do_action('core_upgrade_preamble'); 
    170172    echo '</div>'; 
     
    407409 
    408410if ( 'upgrade-core' == $action ) { 
     411 
    409412    wp_version_check(); 
    410413    require_once(ABSPATH . 'wp-admin/admin-header.php'); 
    411414    core_upgrade_preamble(); 
     415 
    412416} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 
    413417    check_admin_referer('upgrade-core'); 
     
    430434 
    431435} elseif ( 'do-plugin-upgrade' == $action ) { 
     436 
     437    if ( ! current_user_can( 'update_plugins' ) ) 
     438        wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 
     439 
    432440    check_admin_referer('upgrade-core'); 
    433441 
     
    452460    echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 
    453461    echo '</div>'; 
     462 
    454463} elseif ( 'do-theme-upgrade' == $action ) { 
     464 
     465    if ( ! current_user_can( 'update_themes' ) ) 
     466        wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 
     467 
    455468    check_admin_referer('upgrade-core'); 
    456469 
Note: See TracChangeset for help on using the changeset viewer.