Ticket #14385: 14385.patch
File 14385.patch, 4.6 KB (added by , 15 years ago) |
---|
-
wp-admin/ms-edit.php
143 143 wp_die( __( 'You do not have permission to access this page.' ) ); 144 144 145 145 if ( is_array( $_POST['blog'] ) == false ) 146 wp_die( 146 wp_die( __( 'Can’t create an empty site.' ) ); 147 147 $blog = $_POST['blog']; 148 148 $domain = ''; 149 149 if ( ! preg_match( '/(--)/', $blog['domain'] ) && preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) … … 193 193 if ( !is_super_admin( $user_id ) && get_user_option( 'primary_blog', $user_id ) == $dashboard_blog->blog_id ) 194 194 update_user_option( $user_id, 'primary_blog', $id, true ); 195 195 $content_mail = sprintf( __( "New site created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain . $path, stripslashes( $title ) ); 196 wp_mail( get_site_option('admin_email'), 196 wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); 197 197 wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); 198 198 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'add-blog' ), wp_get_referer() ) ); 199 199 exit(); … … 220 220 $allowedthemes[$theme] = true; 221 221 } 222 222 } 223 update_option( 'allowedthemes', 223 update_option( 'allowedthemes', $allowedthemes ); 224 224 225 225 // options 226 226 if ( is_array( $_POST['option'] ) ) { … … 241 241 // home and siteurl 242 242 if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) { 243 243 $blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] ); 244 if ( get_option( 'siteurl' ) != 244 if ( get_option( 'siteurl' ) != $blog_address ) 245 245 update_option( 'siteurl', $blog_address ); 246 246 247 247 if ( get_option( 'home' ) != $blog_address ) … … 435 435 exit(); 436 436 break; 437 437 438 case 'unmatureblog': 439 check_admin_referer( 'unmatureblog' ); 440 if ( ! current_user_can( 'manage_sites' ) ) 441 wp_die( __( 'You do not have permission to access this page.' ) ); 442 443 update_blog_status( $id, 'mature', '0' ); 444 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) ); 445 exit(); 446 break; 447 448 case 'matureblog': 449 check_admin_referer( 'matureblog' ); 450 if ( ! current_user_can( 'manage_sites' ) ) 451 wp_die( __( 'You do not have permission to access this page.' ) ); 452 453 update_blog_status( $id, 'mature', '1' ); 454 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) ); 455 exit(); 456 break; 457 438 458 // Themes 439 459 case 'updatethemes': 440 460 if ( ! current_user_can( 'manage_network_themes' ) ) 441 461 wp_die( __( 'You do not have permission to access this page.' ) ); 442 462 443 463 if ( is_array( $_POST['theme'] ) ) { 444 464 $themes = get_themes(); 445 465 reset( $themes ); 446 466 $allowed_themes = array(); … … 450 470 } 451 471 update_site_option( 'allowedthemes', $allowed_themes ); 452 472 } 453 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'themes' ), 473 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'themes' ), wp_get_referer() ) ); 454 474 exit(); 455 475 break; 456 476 … … 504 524 echo '<div class="wrap">'; 505 525 confirm_delete_users( $_POST['allusers'] ); 506 526 echo '</div>'; 507 508 527 require_once( 'admin-footer.php' ); 528 exit(); 509 529 } else { 510 530 wp_redirect( admin_url( 'ms-users.php' ) ); 511 531 } … … 531 551 echo '<div class="wrap">'; 532 552 confirm_delete_users( $_POST['allusers'] ); 533 553 echo '</div>'; 534 535 536 554 require_once( 'admin-footer.php' ); 555 exit(); 556 break; 537 557 538 558 case 'spam': 539 559 $user = new WP_User( $val ); … … 617 637 $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); 618 638 619 639 if ( false == $user_id ) 620 640 wp_die( __( 'Duplicated username or email address.' ) ); 621 641 else 622 642 wp_new_user_notification( $user_id, $password ); 623 643