Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 437 lines (372 sloc) 18.064 kB
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
1 <?php
2
3 /** Sets up the WordPress Environment. */
4 require( dirname(__FILE__) . '/wp-load.php' );
5
6 add_action( 'wp_head', 'signuppageheaders' ) ;
7
8 require( 'wp-blog-header.php' );
9 require_once( ABSPATH . WPINC . '/registration.php' );
10
9bea527 Coding style
ryan authored
11 if ( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
12 wp_redirect( "http://{$current_site->domain}{$current_site->path}" );
13 die();
14 }
15
16 function do_signup_header() {
17 do_action("signup_header");
18 }
19 add_action( 'wp_head', 'do_signup_header' );
20
21 function signuppageheaders() {
22 echo "<meta name='robots' content='noindex,nofollow' />\n";
23 }
24
9bea527 Coding style
ryan authored
25 if ( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) {
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
26 wp_redirect( "http://" . $current_site->domain . $current_site->path . "wp-signup.php" );
27 die();
28 }
29
30 function wpmu_signup_stylesheet() {
31 ?>
6da55f7 Trailing whitespace cleanup
ryan authored
32 <style type="text/css">
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
33 .mu_register { width: 90%; margin:0 auto; }
34 .mu_register form { margin-top: 2em; }
35 .mu_register .error { font-weight:700; padding:10px; color:#333333; background:#FFEBE8; border:1px solid #CC0000; }
36 .mu_register input[type="submit"],
37 .mu_register #blog_title,
6da55f7 Trailing whitespace cleanup
ryan authored
38 .mu_register #user_email,
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
39 .mu_register #blogname,
6da55f7 Trailing whitespace cleanup
ryan authored
40 .mu_register #user_name { width:100%; font-size: 24px; margin:5px 0; }
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
41 .mu_register .prefix_address,
6da55f7 Trailing whitespace cleanup
ryan authored
42 .mu_register .suffix_address {font-size: 18px;display:inline; }
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
43 .mu_register label { font-weight:700; font-size:15px; display:block; margin:10px 0; }
44 .mu_register label.checkbox { display:inline; }
45 .mu_register .mu_alert { font-weight:700; padding:10px; color:#333333; background:#ffffe0; border:1px solid #e6db55; }
46 </style>
47 <?php
48 }
49
50 add_action( 'wp_head', 'wpmu_signup_stylesheet' );
51 get_header();
52 ?>
53 <div id="content" class="widecolumn">
54 <div class="mu_register">
55 <?php
56 function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
57 global $current_site;
58 // Blog name
9bea527 Coding style
ryan authored
59 if ( !is_subdomain_install() )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
60 echo '<label for="blogname">' . __('Blog Name:') . '</label>';
61 else
62 echo '<label for="blogname">' . __('Blog Domain:') . '</label>';
63
64 if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
65 <p class="error"><?php echo $errmsg ?></p>
66 <?php }
67
9bea527 Coding style
ryan authored
68 if ( !is_subdomain_install() )
49cda5f Remove raquo. see #11644
ryan authored
69 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />';
9bea527 Coding style
ryan authored
70 else
49cda5f Remove raquo. see #11644
ryan authored
71 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />';
9bea527 Coding style
ryan authored
72
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
73 if ( !is_user_logged_in() ) {
74 print '(<strong>' . __( 'Your address will be ' );
9bea527 Coding style
ryan authored
75 if ( !is_subdomain_install() )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
76 print $current_site->domain . $current_site->path . __( 'blogname' );
9bea527 Coding style
ryan authored
77 else
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
78 print __( 'domain.' ) . $current_site->domain . $current_site->path;
79 echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' ) . '</p>';
80 }
81
82 // Blog Title
83 ?>
6da55f7 Trailing whitespace cleanup
ryan authored
84 <label for="blog_title"><?php _e('Blog Title:') ?></label>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
85 <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
86 <p class="error"><?php echo $errmsg ?></p>
87 <?php }
49cda5f Remove raquo. see #11644
ryan authored
88 echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_attr($blog_title).'" /></p>';
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
89 ?>
90
91 <div id="privacy">
92 <p class="privacy-intro">
93 <label for="blog_public_on"><?php _e('Privacy:') ?></label>
6da55f7 Trailing whitespace cleanup
ryan authored
94 <?php _e('I would like my blog to appear in search engines like Google and Technorati, and in public listings around this site.'); ?>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
95 <div style="clear:both;"></div>
96 <label class="checkbox" for="blog_public_on">
9bea527 Coding style
ryan authored
97 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
98 <strong><?php _e( 'Yes' ); ?></strong>
99 </label>
100 <label class="checkbox" for="blog_public_off">
9bea527 Coding style
ryan authored
101 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
102 <strong><?php _e( 'No' ); ?></strong>
103 </label>
104 </p>
105 </div>
6da55f7 Trailing whitespace cleanup
ryan authored
106
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
107 <?php
108 do_action('signup_blogform', $errors);
109 }
110
111 function validate_blog_form() {
112 $user = '';
113 if ( is_user_logged_in() )
114 $user = wp_get_current_user();
115
116 return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
117 }
118
119 function show_user_form($user_name = '', $user_email = '', $errors = '') {
120 // User name
121 echo '<label for="user_name">' . __('Username:') . '</label>';
122 if ( $errmsg = $errors->get_error_message('user_name') ) {
123 echo '<p class="error">'.$errmsg.'</p>';
124 }
49cda5f Remove raquo. see #11644
ryan authored
125 echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="50" /><br />';
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
126 _e('(Must be at least 4 characters, letters and numbers only.)');
127 ?>
128
129 <label for="user_email"><?php _e('Email&nbsp;Address:') ?></label>
130 <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?>
131 <p class="error"><?php echo $errmsg ?></p>
6da55f7 Trailing whitespace cleanup
ryan authored
132 <?php } ?>
49cda5f Remove raquo. see #11644
ryan authored
133 <input name="user_email" type="text" id="user_email" value="<?php echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('(We&#8217;ll send your password to this address, so <strong>triple-check it</strong>.)') ?>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
134 <?php
135 if ( $errmsg = $errors->get_error_message('generic') ) {
136 echo '<p class="error">'.$errmsg.'</p>';
137 }
138 do_action( 'signup_extra_fields', $errors );
139 }
140
141 function validate_user_form() {
142 return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
143 }
144
145 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
146 global $current_user, $current_site;
6da55f7 Trailing whitespace cleanup
ryan authored
147
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
148 if ( ! is_wp_error($errors) ) {
149 $errors = new WP_Error();
150 }
151
152 // allow definition of default variables
153 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
154 $blogname = $filtered_results['blogname'];
155 $blog_title = $filtered_results['blog_title'];
156 $errors = $filtered_results['errors'];
157
158 echo '<h2>' . sprintf( __('Get <em>another</em> %s blog in seconds'), $current_site->site_name ) . '</h2>';
159
160 if ( $errors->get_error_code() ) {
161 echo "<p>" . __('There was a problem, please correct the form below and try again.') . "</p>";
162 }
163 ?>
164 <p><?php printf(__("Welcome back, %s. By filling out the form below, you can <strong>add another blog to your account</strong>. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly."), $current_user->display_name) ?></p>
6da55f7 Trailing whitespace cleanup
ryan authored
165
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
166 <?php
6da55f7 Trailing whitespace cleanup
ryan authored
167 $blogs = get_blogs_of_user($current_user->ID);
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
168 if ( !empty($blogs) ) { ?>
169 <p>
170 <?php _e('Blogs you are already a member of:') ?>
171 <ul>
172 <?php foreach ( $blogs as $blog ) {
173 echo "<li><a href='http://" . $blog->domain . $blog->path . "'>" . $blog->domain . $blog->path . "</a></li>";
174 } ?>
175 </ul>
176 </p>
177 <?php } ?>
6da55f7 Trailing whitespace cleanup
ryan authored
178
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
179 <p><?php _e("If you&#8217;re not going to use a great blog domain, leave it for a new user. Now have at it!") ?></p>
180 <form id="setupform" method="post" action="wp-signup.php">
181 <input type="hidden" name="stage" value="gimmeanotherblog" />
182 <?php do_action( "signup_hidden_fields" ); ?>
183 <?php show_blog_form($blogname, $blog_title, $errors); ?>
49cda5f Remove raquo. see #11644
ryan authored
184 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Create Blog') ?>" /></p>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
185 </form>
186 <?php
187 }
188
189 function validate_another_blog_signup() {
190 global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path;
191 $current_user = wp_get_current_user();
9bea527 Coding style
ryan authored
192 if ( !is_user_logged_in() )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
193 die();
194
195 $result = validate_blog_form();
196 extract($result);
197
198 if ( $errors->get_error_code() ) {
199 signup_another_blog($blogname, $blog_title, $errors);
200 return false;
201 }
202
203 $public = (int) $_POST['blog_public'];
8a42022 Fix deprecate spelling. Props filosofo. fixes #11758
ryan authored
204 $meta = apply_filters('signup_create_blog_meta', array ('lang_id' => 1, 'public' => $public)); // deprecated
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
205 $meta = apply_filters( "add_signup_meta", $meta );
206
207 wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid );
208 confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
209 return true;
210 }
211
212 function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') {
213 ?>
214 <h2><?php printf(__('The blog %s is yours.'), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
215 <p>
216 <?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name) ?>
217 </p>
218 <?php
219 do_action('signup_finished');
220 }
221
222 function signup_user($user_name = '', $user_email = '', $errors = '') {
223 global $current_site, $active_signup;
224
225 if ( !is_wp_error($errors) )
226 $errors = new WP_Error();
9bea527 Coding style
ryan authored
227 if ( isset( $_POST[ 'signup_for' ] ) )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
228 $signup[ wp_specialchars( $_POST[ 'signup_for' ] ) ] = 'checked="checked"';
9bea527 Coding style
ryan authored
229 else
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
230 $signup[ 'blog' ] = 'checked="checked"';
231
232 // allow definition of default variables
233 $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors ));
234 $user_name = $filtered_results['user_name'];
235 $user_email = $filtered_results['user_email'];
236 $errors = $filtered_results['errors'];
237
238 ?>
6da55f7 Trailing whitespace cleanup
ryan authored
239
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
240 <h2><?php printf( __('Get your own %s account in seconds'), $current_site->site_name ) ?></h2>
241 <form id="setupform" method="post" action="wp-signup.php">
242 <input type="hidden" name="stage" value="validate-user-signup" />
243 <?php do_action( "signup_hidden_fields" ); ?>
244 <?php show_user_form($user_name, $user_email, $errors); ?>
6da55f7 Trailing whitespace cleanup
ryan authored
245
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
246 <p>
9bea527 Coding style
ryan authored
247 <?php if ( $active_signup == 'blog' ) { ?>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
248 <input id="signupblog" type="hidden" name="signup_for" value="blog" />
9bea527 Coding style
ryan authored
249 <?php } elseif ( $active_signup == 'user' ) { ?>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
250 <input id="signupblog" type="hidden" name="signup_for" value="user" />
251 <?php } else { ?>
252 <input id="signupblog" type="radio" name="signup_for" value="blog" <?php echo $signup['blog'] ?> />
6da55f7 Trailing whitespace cleanup
ryan authored
253 <label class="checkbox" for="signupblog"><?php _e('Gimme a blog!') ?></label>
254 <br />
255 <input id="signupuser" type="radio" name="signup_for" value="user" <?php echo $signup['user'] ?> />
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
256 <label class="checkbox" for="signupuser"><?php _e('Just a username, please.') ?></label>
257 <?php } ?>
258 </p>
6da55f7 Trailing whitespace cleanup
ryan authored
259
49cda5f Remove raquo. see #11644
ryan authored
260 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Next') ?>" /></p>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
261 </form>
262 <?php
263 }
264
265 function validate_user_signup() {
266 $result = validate_user_form();
267 extract($result);
268
269 if ( $errors->get_error_code() ) {
270 signup_user($user_name, $user_email, $errors);
271 return false;
272 }
273
274 if ( 'blog' == $_POST['signup_for'] ) {
275 signup_blog($user_name, $user_email);
276 return false;
277 }
278
279 wpmu_signup_user($user_name, $user_email, apply_filters( "add_signup_meta", array() ) );
280
281 confirm_user_signup($user_name, $user_email);
282 return true;
283 }
284
285 function confirm_user_signup($user_name, $user_email) {
286 ?>
287 <h2><?php printf(__('%s is your new username'), $user_name) ?></h2>
288 <p><?php _e('But, before you can start using your new username, <strong>you must activate it</strong>.') ?></p>
289 <p><?php printf(__('Check your inbox at <strong>%1$s</strong> and click the link given.'), $user_email) ?></p>
290 <p><?php _e('If you do not activate your username within two days, you will have to sign up again.'); ?></p>
291 <?php
292 do_action('signup_finished');
293 }
294
295 function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
296 if ( !is_wp_error($errors) )
297 $errors = new WP_Error();
298
299 // allow definition of default variables
300 $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
301 $user_name = $filtered_results['user_name'];
302 $user_email = $filtered_results['user_email'];
303 $blogname = $filtered_results['blogname'];
304 $blog_title = $filtered_results['blog_title'];
305 $errors = $filtered_results['errors'];
306
307 if ( empty($blogname) )
308 $blogname = $user_name;
309 ?>
310 <form id="setupform" method="post" action="wp-signup.php">
311 <input type="hidden" name="stage" value="validate-blog-signup" />
49cda5f Remove raquo. see #11644
ryan authored
312 <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" />
313 <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" />
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
314 <?php do_action( "signup_hidden_fields" ); ?>
315 <?php show_blog_form($blogname, $blog_title, $errors); ?>
49cda5f Remove raquo. see #11644
ryan authored
316 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
317 </form>
318 <?php
319 }
320
321 function validate_blog_signup() {
322 // Re-validate user info.
323 $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
324 extract($result);
325
326 if ( $errors->get_error_code() ) {
327 signup_user($user_name, $user_email, $errors);
328 return false;
329 }
330
331 $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']);
332 extract($result);
333
334 if ( $errors->get_error_code() ) {
335 signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
336 return false;
337 }
338
339 $public = (int) $_POST['blog_public'];
340 $meta = array ('lang_id' => 1, 'public' => $public);
341 $meta = apply_filters( "add_signup_meta", $meta );
342
343 wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
344 confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
345 return true;
346 }
347
348 function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) {
349 ?>
350 <h2><?php printf(__('Congratulations! Your new blog, %s, is almost ready.'), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
6da55f7 Trailing whitespace cleanup
ryan authored
351
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
352 <p><?php _e('But, before you can start using your blog, <strong>you must activate it</strong>.') ?></p>
353 <p><?php printf(__('Check your inbox at <strong>%s</strong> and click the link given. It should arrive within 30 minutes.'), $user_email) ?></p>
354 <p><?php _e('If you do not activate your blog within two days, you will have to sign up again.'); ?></p>
355 <h2><?php _e('Still waiting for your email?'); ?></h2>
356 <p>
357 <?php _e("If you haven't received your email yet, there are a number of things you can do:") ?>
358 <ul id="noemail-tips">
359 <li><p><strong><?php _e('Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.') ?></strong></p></li>
360 <li><p><?php _e('Check the junk email or spam folder of your email client. Sometime emails wind up there by mistake.') ?></p></li>
361 <li><?php printf(__("Have you entered your email correctly? We think it's %s but if you've entered it incorrectly, you won't receive it."), $user_email) ?></li>
362 </ul>
363 </p>
364 <?php
365 do_action('signup_finished');
366 }
367
368 // Main
369 $active_signup = get_site_option( 'registration' );
9bea527 Coding style
ryan authored
370 if ( !$active_signup )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
371 $active_signup = 'all';
372
373 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
374
9bea527 Coding style
ryan authored
375 if ( is_super_admin() )
fd475d2 s/wpmu/ms/ in file refs. Props Denis-de-Bernardy. see #11644
ryan authored
376 echo '<div class="mu_alert">' . sprintf( __( "Greetings Site Administrator! You are currently allowing '%s' registrations. To change or disable registration go to your <a href='wp-admin/ms-options.php'>Options page</a>." ), $active_signup ) . '</div>';
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
377
378 $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null;
379
380 $current_user = wp_get_current_user();
9bea527 Coding style
ryan authored
381 if ( $active_signup == "none" ) {
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
382 _e( "Registration has been disabled." );
9bea527 Coding style
ryan authored
383 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
384 if ( is_ssl() )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
385 $proto = 'https://';
9bea527 Coding style
ryan authored
386 else
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
387 $proto = 'http://';
388 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ));
389 echo sprintf( __( "You must first <a href=\"%s\">login</a>, and then you can create a new blog."), $login_url );
390 } else {
391 switch ($_POST['stage']) {
392 case 'validate-user-signup' :
8760e7d Coding standards, space after if
ryan authored
393 if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
394 validate_user_signup();
395 else
396 _e( "User registration has been disabled." );
397 break;
398 case 'validate-blog-signup':
9bea527 Coding style
ryan authored
399 if ( $active_signup == 'all' || $active_signup == 'blog' )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
400 validate_blog_signup();
401 else
402 _e( "Blog registration has been disabled." );
403 break;
404 case 'gimmeanotherblog':
405 validate_another_blog_signup();
406 break;
407 default :
408 $user_email = $_POST[ 'user_email' ];
409 do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere?
9bea527 Coding style
ryan authored
410 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
411 signup_another_blog($newblogname);
8760e7d Coding standards, space after if
ryan authored
412 elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
413 signup_user( $newblogname, $user_email );
8760e7d Coding standards, space after if
ryan authored
414 elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
415 _e( "I'm sorry. We're not accepting new registrations at this time." );
9bea527 Coding style
ryan authored
416 else
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
417 _e( "You're logged in already. No need to register again!" );
9bea527 Coding style
ryan authored
418
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
419 if ($newblogname) {
9bea527 Coding style
ryan authored
420 if ( !is_subdomain_install() )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
421 $newblog = 'http://' . $current_site->domain . $current_site->path . $newblogname . '/';
422 else
423 $newblog = 'http://' . $newblogname . '.' . $current_site->domain . $current_site->path;
9bea527 Coding style
ryan authored
424 if ( $active_signup == 'blog' || $active_signup == 'all' )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
425 printf(__("<p><em>The blog you were looking for, <strong>%s</strong> doesn't exist but you can create it now!</em></p>"), $newblog );
426 else
427 printf(__("<p><em>The blog you were looking for, <strong>%s</strong> doesn't exist.</em></p>"), $newblog );
428 }
429 break;
430 }
431 }
432 ?>
433 </div>
434 </div>
435
436 <?php get_footer(); ?>
Something went wrong with that request. Please try again.