summaryrefslogtreecommitdiffstats
path: root/wp-signup.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-10-25 10:20:39 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-10-25 10:20:39 +0000
commita997f1635f7070c4b519bf9b06e546beab48aa26 (patch)
treee7b2131622fd3ade781238902ef73f4a5a00e940 /wp-signup.php
parenta7dd2f6a5eba8bf9705d6f8dcedf19dfae36bb05 (diff)
downloadwordpress-mu-a997f1635f7070c4b519bf9b06e546beab48aa26.zip
wordpress-mu-a997f1635f7070c4b519bf9b06e546beab48aa26.tar.gz
wordpress-mu-a997f1635f7070c4b519bf9b06e546beab48aa26.tar.xz
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
Diffstat (limited to 'wp-signup.php')
-rw-r--r--wp-signup.php11
1 files changed, 8 insertions, 3 deletions
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 <a href=\"%s\">login</a>, 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' )