WordPress.org

Make WordPress Core

Changeset 8060


Ignore:
Timestamp:
06/06/2008 07:21:35 PM (10 years ago)
Author:
ryan
Message:

Add delete_plugins and update_plugins caps. Props DD32. fixes #7096

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r7999 r8060  
    258258
    259259    // Delete unused options
    260     $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval');
     260    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins');
    261261    foreach ($unusedoptions as $option) :
    262262        delete_option($option);
     
    275275    populate_roles_230();
    276276    populate_roles_250();
     277    populate_roles_260();
    277278}
    278279
     
    430431}
    431432
     433function populate_roles_260() {
     434    $role = get_role( 'administrator' );
     435
     436    if ( !empty( $role ) ) {
     437        $role->add_cap( 'update_plugins' );
     438        $role->add_cap( 'delete_plugins' );
     439    }
     440}
     441
    432442?>
  • trunk/wp-admin/includes/update.php

    r8055 r8060  
    127127
    128128    echo '<tr><td colspan="5" class="plugin-update">';
    129     if ( !current_user_can('edit_plugins') )
     129    if ( ! current_user_can('update_plugins') )
    130130        printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version);
    131131    else if ( empty($r->package) )
  • trunk/wp-admin/includes/upgrade.php

    r7999 r8060  
    208208    if ( $wp_current_db_version < 7935 )
    209209        upgrade_252();
     210
     211    if ( $wp_current_db_version < 8000 )
     212        upgrade_260();
    210213
    211214    maybe_disable_automattic_widgets();
     
    741744
    742745    $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
     746}
     747
     748function upgrade_260() {
     749    populate_roles_260();
    743750}
    744751
  • trunk/wp-admin/plugins.php

    r8049 r8060  
    7373            break;
    7474        case 'delete-selected':
     75            if( ! current_user_can('delete_plugins') )
     76                wp_die(__('You do not have sufficient permissions to delete plugins for this blog.'));
    7577            check_admin_referer('mass-manage-plugins');
    7678            $plugins = $_REQUEST['checked'];
     
    251253    <div class="alignleft">
    252254        <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" />
    253 <?php if( current_user_can('edit_plugins') ) : ?>
     255<?php if( current_user_can('delete_plugins') ) : ?>
    254256        <input type="submit" name="delete-selected" value="<?php _e('Delete') ?>" class="button-secondary" />
    255257<?php endif; ?>
     
    268270    <div class="alignleft">
    269271        <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" />
    270 <?php if( current_user_can('edit_plugins') ) : ?>
     272<?php if( current_user_can('delete_plugins') ) : ?>
    271273        <input type="submit" name="delete-selected" value="<?php _e('Delete') ?>" class="button-secondary" />
    272274<?php endif; ?>
  • trunk/wp-admin/update.php

    r8009 r8060  
    33require_once('admin.php');
    44
    5 if ( !current_user_can('edit_plugins') )
    6     wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
     5if ( ! current_user_can('update_plugins') )
     6    wp_die(__('You do not have sufficient permissions to update plugins for this blog.'));
    77
    88function request_filesystem_credentials($form_post, $type = '', $error = false) {
  • trunk/wp-includes/version.php

    r7982 r8060  
    1717 * @global int $wp_db_version
    1818 */
    19 $wp_db_version = 7935;
     19$wp_db_version = 8000;
    2020
    2121?>
Note: See TracChangeset for help on using the changeset viewer.