web/wp-includes/ms-load.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
    67  * blog-suspended.php drop-ins.
    67  * blog-suspended.php drop-ins.
    68  *
    68  *
    69  * @return bool|string Returns true on success, or drop-in file to include.
    69  * @return bool|string Returns true on success, or drop-in file to include.
    70  */
    70  */
    71 function ms_site_check() {
    71 function ms_site_check() {
    72 	global $wpdb, $current_blog;
    72 	global $wpdb;
       
    73 
       
    74 	$blog = get_blog_details();
    73 
    75 
    74 	// Allow short-circuiting
    76 	// Allow short-circuiting
    75 	$check = apply_filters('ms_site_check', null);
    77 	$check = apply_filters('ms_site_check', null);
    76 	if ( null !== $check )
    78 	if ( null !== $check )
    77 		return true;
    79 		return true;
    78 
    80 
    79 	// Allow super admins to see blocked sites
    81 	// Allow super admins to see blocked sites
    80 	if ( is_super_admin() )
    82 	if ( is_super_admin() )
    81 		return true;
    83 		return true;
    82 
    84 
    83 	if ( '1' == $current_blog->deleted ) {
    85 	if ( '1' == $blog->deleted ) {
    84 		if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
    86 		if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
    85 			return WP_CONTENT_DIR . '/blog-deleted.php';
    87 			return WP_CONTENT_DIR . '/blog-deleted.php';
    86 		else
    88 		else
    87 			wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ), '', array( 'response' => 410 ) );
    89 			wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ), '', array( 'response' => 410 ) );
    88 	}
    90 	}
    89 
    91 
    90 	if ( '2' == $current_blog->deleted ) {
    92 	if ( '2' == $blog->deleted ) {
    91 		if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
    93 		if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
    92 			return WP_CONTENT_DIR . '/blog-inactive.php';
    94 			return WP_CONTENT_DIR . '/blog-inactive.php';
    93 		else
    95 		else
    94 			wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
    96 			wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
    95 	}
    97 	}
    96 
    98 
    97 	if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
    99 	if ( $blog->archived == '1' || $blog->spam == '1' ) {
    98 		if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
   100 		if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
    99 			return WP_CONTENT_DIR . '/blog-suspended.php';
   101 			return WP_CONTENT_DIR . '/blog-suspended.php';
   100 		else
   102 		else
   101 			wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
   103 			wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
   102 	}
   104 	}
   230 function ms_not_installed() {
   232 function ms_not_installed() {
   231 	global $wpdb, $domain, $path;
   233 	global $wpdb, $domain, $path;
   232 
   234 
   233 	wp_load_translations_early();
   235 	wp_load_translations_early();
   234 
   236 
   235 	$title = __( 'Error establishing database connection' );
   237 	$title = __( 'Error establishing a database connection' );
   236 	$msg  = '<h1>' . $title . '</h1>';
   238 	$msg  = '<h1>' . $title . '</h1>';
   237 	if ( ! is_admin() )
   239 	if ( ! is_admin() )
   238 		die( $msg );
   240 		die( $msg );
   239 	$msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
   241 	$msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
   240 	$msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
   242 	$msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';