WordPress.org

Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.