diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 5fb04d5258..86a9a80776 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -257,7 +257,7 @@ function populate_options() { add_option('avatar_default', 'mystery'); // Delete unused options - $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'); + $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'); foreach ($unusedoptions as $option) : delete_option($option); endforeach; @@ -274,6 +274,7 @@ function populate_roles() { populate_roles_210(); populate_roles_230(); populate_roles_250(); + populate_roles_260(); } function populate_roles_160() { @@ -429,4 +430,13 @@ function populate_roles_250() { } } +function populate_roles_260() { + $role = get_role( 'administrator' ); + + if ( !empty( $role ) ) { + $role->add_cap( 'update_plugins' ); + $role->add_cap( 'delete_plugins' ); + } +} + ?> diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index eb96385adf..b7592c689f 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -126,7 +126,7 @@ function wp_plugin_update_row( $file, $plugin_data ) { $r = $current->response[ $file ]; echo ''; - if ( !current_user_can('edit_plugins') ) + if ( ! current_user_can('update_plugins') ) printf( __('There is a new version of %1$s available. Download version %3$s here.'), $plugin_data['Name'], $r->url, $r->new_version); else if ( empty($r->package) ) printf( __('There is a new version of %1$s available. Download version %3$s here automatic upgrade unavailable for this plugin.'), $plugin_data['Name'], $r->url, $r->new_version); diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 8ec4acc262..97cf9d3a23 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -208,6 +208,9 @@ function upgrade_all() { if ( $wp_current_db_version < 7935 ) upgrade_252(); + if ( $wp_current_db_version < 8000 ) + upgrade_260(); + maybe_disable_automattic_widgets(); $wp_rewrite->flush_rules(); @@ -742,6 +745,10 @@ function upgrade_252() { $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); } +function upgrade_260() { + populate_roles_260(); +} + // The functions we use to actually do stuff // General diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index b60406427f..148cdd7754 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -72,6 +72,8 @@ if( !empty($action) ) { exit; break; case 'delete-selected': + if( ! current_user_can('delete_plugins') ) + wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); check_admin_referer('mass-manage-plugins'); $plugins = $_REQUEST['checked']; include(ABSPATH . 'wp-admin/update.php'); @@ -250,7 +252,7 @@ function print_plugins_table($plugins, $context = '') {
- +
@@ -267,7 +269,7 @@ function print_plugins_table($plugins, $context = '') {
- +
diff --git a/wp-admin/update.php b/wp-admin/update.php index 5c77b1717b..c3cd28924a 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -2,8 +2,8 @@ require_once('admin.php'); -if ( !current_user_can('edit_plugins') ) - wp_die('

'.__('You do not have sufficient permissions to update plugins for this blog.').'

'); +if ( ! current_user_can('update_plugins') ) + wp_die(__('You do not have sufficient permissions to update plugins for this blog.')); function request_filesystem_credentials($form_post, $type = '', $error = false) { $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error); diff --git a/wp-includes/version.php b/wp-includes/version.php index e9bf67da66..3e818326b8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,6 +16,6 @@ $wp_version = '2.6-bleeding2'; * * @global int $wp_db_version */ -$wp_db_version = 7935; +$wp_db_version = 8000; ?>