From a997f1635f7070c4b519bf9b06e546beab48aa26 Mon Sep 17 00:00:00 2001 From: donncha Date: Sat, 25 Oct 2008 10:20:39 +0000 Subject: Redirect user to login page when signup is for existing users only. Props harking, fixes #758 git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1515 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-signup.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'wp-signup.php') diff --git a/wp-signup.php b/wp-signup.php index 602fa61..0a7965a 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -380,10 +380,15 @@ $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0- $current_user = wp_get_current_user(); if( $active_signup == "none" ) { _e( "Registration has been disabled." ); +} elseif( $active_signup == 'blog' && !is_user_logged_in() ){ + if( is_ssl() ) { + $proto = 'https://'; + } else { + $proto = 'http://'; + } + $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' )); + echo sprintf( __( "You must first login, and then you can create a new blog."), $login_url ); } else { - if( $active_signup == 'blog' && !is_user_logged_in() ) - wp_die( 'You must be logged in to register a blog.' ); - switch ($_POST['stage']) { case 'validate-user-signup' : if( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) -- cgit