From d48e85e0ac5e675ca33fac173f30c75403d1033f Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 22 Jun 2006 18:31:50 +0000 Subject: Moved everything in wp-inst down a directory. Uses's Ryan Boren's htaccess rules and mods If you're upgrading, try this on a test server first! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@591 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-signup.php | 345 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100644 wp-signup.php (limited to 'wp-signup.php') diff --git a/wp-signup.php b/wp-signup.php new file mode 100644 index 0000000..c7bd7bd --- /dev/null +++ b/wp-signup.php @@ -0,0 +1,345 @@ +domain != $current_site->domain ) { + header( "Location: http://" . $current_site->domain . $current_site->path . "wp-signup.php" ); + die(); +} + +get_header(); +?> +
+ +get_error_message('blog_id') ) + print ''; + else + print ''; + + if( constant( "VHOST" ) == 'no' ) + echo '' . __('Blog Name:') . ''; + else + echo '' . __('Blog Domain:') . ''; + + if ( $errmsg = $errors->get_error_message('blog_id') ) { + ?>

' . $current_site->domain . $current_site->path . '
'; + } else { + print '' . $current_site->domain . $current_site->path . '
'; + } + if ( !is_user_logged_in() ) { + print '(Your address will be '; + if( constant( "VHOST" ) == 'no' ) { + print $current_site->domain . $current_site->path . 'blogname'; + } else { + print 'domain.' . $current_site->domain . $current_site->path; + } + print '. Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!) '; + } + + // Blog Title + if ( $errors->get_error_message('blog_title')) { + print ''; + } else { + print ''; + } +?>Blog Title:get_error_message('blog_title') ) { +?>

+ '; +?> + +Privacy: + + +get_error_message('user_name') ) { + print ''; + } else { + print ''; + } + + echo '' . __('Username:') . ''; + + if ( $errmsg = $errors->get_error_message('user_name') ) { + ?>


'; + print '(Must be at least 4 characters, letters and numbers only.) '; + + // User Email + if ( $errors->get_error_message('user_email') ) { + print ''; + } else { + print ''; + } +?>Email Address:get_error_message('user_email') ) { +?>


(We’ll send your password to this address, so triple-check it.) + '; + + if ( $errmsg = $errors->get_error_message('generic') ) + print ' '.$errmsg.' '; +} + +function validate_user_form() { + $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); + + return $result; +} + +function signup_another_blog($blog_id = '', $blog_title = '', $errors = '') { + global $current_user, $wpdb, $domain, $current_site; + + if ( ! is_wp_error($errors) ) + $errors = new WP_Error(); + + echo '

' . sprintf( __('Get another %s blog in seconds'), $current_site->site_name ) . '

'; + + if ( $errors->get_error_code() ) { + print "

There was a problem, please correct the form below and try again.

"; + } + +?> +

Welcome back, display_name; ?>. By filling out the form below, you can add another blog to your account. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly.

+

Here are the blogs you already have:

+ +

+
+ + + + + + + +
 
+
+get_error_code() ) { + signup_another_blog($blog_id, $blog_title, $errors); + return; + } + + $public = (int) $_POST['blog_public']; + $meta = array ('lang_id' => 'en', 'public' => $public); + + wpmu_create_blog($domain, $path, $blog_title, $current_user->id, $meta); + confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); +} + +function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { +?> +

+

http://%2$s is your new blog. Login as "%4$s" using your existing password.'), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name) ?>

+ +

site_name ) ?>

+

Fill out this one-step form and you'll be blogging seconds later!

+
+ + + + + + + + + + +
  +

+ + +
+ + +

+
 
+
+get_error_code() ) { + signup_user($user_name, $user_email, $errors); + return; + } + + if ( 'blog' == $_POST['signup_for'] ) { + signup_blog($user_name, $user_email); + return; + } + + wpmu_signup_user($user_name, $user_email); + + confirm_user_signup($user_name, $user_email); +} + +function confirm_user_signup($user_name, $user_email) { +?> +

+

you must activate it.') ?>

+

%1$s and click the link given. '), $user_email) ?>

+

+ +
+ + + + + + + + + +
 
+
+get_error_code() ) { + signup_user($user_name, $user_email, $errors); + return; + } + + $result = wpmu_validate_blog_signup($_POST['blog_id'], $_POST['blog_title']); + extract($result); + + if ( $errors->get_error_code() ) { + signup_blog($user_name, $user_email, $blog_id, $blog_title, $errors); + return; + } + + $public = (int) $_POST['blog_public']; + $meta = array ('lang_id' => 'en', 'public' => $public); + + wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); + + confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta); +} + +function confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { +?> +

+

you must activate it.') ?>

+

%1$s and click the link given. '), $user_email) ?>

+

+

The blog you were looking for, .domain ?> doesn't exist but you can create it now!

+
+ + -- cgit