X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/80b7979fccf09a75af3f4c111fa27060ae6dbf85..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-admin/ms-delete-site.php diff --git a/wp-admin/ms-delete-site.php b/wp-admin/ms-delete-site.php index 95f0aa09..6bc3cfcd 100644 --- a/wp-admin/ms-delete-site.php +++ b/wp-admin/ms-delete-site.php @@ -7,31 +7,32 @@ * @since 3.0.0 */ -require_once( './admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( !is_multisite() ) wp_die( __( 'Multisite support is not enabled.' ) ); -// @todo Create a delete blog cap. -if ( ! current_user_can( 'manage_options' ) ) - wp_die(__( 'You do not have sufficient permissions to delete this site.')); +if ( ! current_user_can( 'delete_site' ) ) + wp_die(__( 'Sorry, you are not allowed to delete this site.')); if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) { - if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) { + if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) { wpmu_delete_blog( $wpdb->blogid ); - wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), $current_site->site_name ) ); + wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) ); } else { wp_die( __( "I'm sorry, the link you clicked is stale. Please select another option." ) ); } } +$blog = get_site(); +$user = wp_get_current_user(); + $title = __( 'Delete Site' ); $parent_file = 'tools.php'; -require_once( './admin-header.php' ); +require_once( ABSPATH . 'wp-admin/admin-header.php' ); echo '
Delete My Site Permanently you will be sent an email with a link in it. Click on this link to delete your site.'), $current_site->site_name); ?>
+Delete My Site Permanently you will be sent an email with a link in it. Click on this link to delete your site.'), get_network()->site_name); ?>
'; -include( './admin-footer.php' ); +include( ABSPATH . 'wp-admin/admin-footer.php' );