summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wp-activate.php2
-rw-r--r--wp-includes/wpmu-functions.php7
-rw-r--r--wpmu-settings.php43
3 files changed, 37 insertions, 15 deletions
diff --git a/wp-activate.php b/wp-activate.php
index f9846a8..57c3a17 100644
--- a/wp-activate.php
+++ b/wp-activate.php
@@ -68,7 +68,7 @@ form { margin-top: 2em; }
</td>
</tr>
</table>
-<h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://' . $_SERVER[ 'SERVER_NAME' ] . '/' ); ?></h3>
+<h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://' . $url . '/wp-login.php' ); ?></h3>
<?php
}
}
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index 4dd1269..a84be1d 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -1026,10 +1026,10 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai
if( constant( "VHOST" ) == 'no' ) {
$activate_url = "http://" . $current_site->domain . $current_site->path . "wp-activate.php?key=$key";
} else {
- $activate_url = "http://{$domain}{$path}/wp-activate.php?key=$key";
+ $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key";
}
$message_headers = 'From: ' . stripslashes($title) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>';
- $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://$domain.$path");
+ $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://{$domain}{$path}");
// TODO: Don't hard code activation link.
$subject = sprintf(__('Activate %s'), $domain.$path);
wp_mail($user_email, $subject, $message, $message_headers);
@@ -1038,8 +1038,7 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai
function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
// Send email with activation link.
$message_headers = 'From: ' . stripslashes($user) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>';
- $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"),
- "http://{$_SERVER[ 'SERVER_NAME' ]}/wp-activate.php?key=$key", "http://{$_SERVER[ 'SERVER_NAME' ]}");
+ $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"), "http://{$_SERVER[ 'SERVER_NAME' ]}/wp-activate.php?key=$key" );
// TODO: Don't hard code activation link.
$subject = sprintf(__('Activate %s'), $user);
wp_mail($user_email, $subject, $message, $message_headers);
diff --git a/wpmu-settings.php b/wpmu-settings.php
index 8cda5a3..c349e36 100644
--- a/wpmu-settings.php
+++ b/wpmu-settings.php
@@ -15,24 +15,45 @@ $path = preg_replace( '|(/[a-z0-9-]+?/).*|', '$1', $path );
$wpdb->hide_errors();
-// Get site and blog details
-if( defined( "WP_INSTALLING" ) == false ) {
+#$sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" );
+#if( count( $sites ) == 1 ) {
+ #$current_site = $sites[0];
+#}
+
+if( isset( $current_site ) == false ) {
+ $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
if( constant( 'VHOST' ) == 'yes' ) {
- $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'");
- if( $current_blog != null )
- $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'");
+ $sitedomain = substr( $domain, 1 + strpos( $domain, '.' ) );
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" );
+ if( $current_site == null ) {
+ $path = '/';
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" );
+ if( $current_site == null && defined( "WP_INSTALLING" ) == false )
+ die( "No WPMU site defined on this host." );
+ }
} else {
- $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
$current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" );
if( $current_site == null ) {
$path = '/';
$current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" );
- if( $current_site == null )
+ if( $current_site == null && defined( "WP_INSTALLING" ) == false )
die( "No WPMU site defined on this host." );
}
- $blogname = htmlspecialchars( str_replace( $path, '', $_SERVER[ 'REQUEST_URI' ] ) );
- $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) );
- if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' ) {
+ }
+}
+
+
+// Get site and blog details
+if( defined( "WP_INSTALLING" ) == false ) {
+ if( constant( 'VHOST' ) == 'yes' ) {
+ $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'");
+ if( $current_blog != null )
+ $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'");
+ } else {
+ $blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );
+ if( strpos( $blogname, '/' ) )
+ $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) );
+ if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' || $blogname == 'feed' ) {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'");
} else {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '{$path}{$blogname}/'");
@@ -50,6 +71,8 @@ if( defined( "WP_INSTALLING" ) == false ) {
$site_id = 1;
$current_site->site_name = $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = '$site_id' AND meta_key = 'site_name'" );
+ if( $current_site->site_name == null )
+ $current_site->site_name = ucfirst( $current_site->domain );
}
if( $blog_id == false ) {
// no blog found, are we installing? Check if the table exists.