summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-27 14:11:27 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-27 14:11:27 +0000
commitbc96ad1ac715d2db115b24880fef67aae6b3903b (patch)
treefee5fa352bb1109127663aebb728727f09c7ee5e
parentd7a0e0bed98dccdcd11a1b21cdff9423c3cc59c7 (diff)
Redirect to signup form if blog not found (#28)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@603 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-signup.php2
-rw-r--r--wpmu-settings.php11
2 files changed, 11 insertions, 2 deletions
diff --git a/wp-signup.php b/wp-signup.php
index c7bd7bd..a951fa9 100644
--- a/wp-signup.php
+++ b/wp-signup.php
@@ -332,7 +332,7 @@ switch ($_POST['stage']) {
if ( is_user_logged_in() )
signup_another_blog($blog_id);
else
- signup_user();
+ signup_user( $blog_id );
if ($blog_id) {
?><p><em>The blog you were looking for, <strong><?php echo $blog_id ?>.<?php echo $current_site->domain ?></strong> doesn't exist but you can create it now!</em></p><?php
diff --git a/wpmu-settings.php b/wpmu-settings.php
index e80999b..9cb37d6 100644
--- a/wpmu-settings.php
+++ b/wpmu-settings.php
@@ -53,12 +53,17 @@ if( isset( $current_site ) == false ) {
if( constant( 'VHOST' ) == 'yes' ) {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'");
- if( $current_blog != null )
+ if( $current_blog != null ) {
$current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'");
+ } else {
+ $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
+ }
} else {
$blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );
if( strpos( $blogname, '/' ) )
$blogname = substr( $blogname, 0, strpos( $blogname, '/' ) );
+ if( strpos( $blogname, '?' ) )
+ $blogname = substr( $blogname, 0, strpos( $blogname, '?' ) );
if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' || $blogname == 'feed' || is_file( $blogname ) ) {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'");
} else {
@@ -67,6 +72,10 @@ if( constant( 'VHOST' ) == 'yes' ) {
}
if( defined( "WP_INSTALLING" ) == false ) {
+ if( $current_site && $current_blog == null ) {
+ header( "Location: http://{$current_site->domain}{$current_site->path}wp-signup.php?new=" . urlencode( $blogname ) );
+ die();
+ }
if( $current_blog == false || $current_site == false )
is_installed();
}