Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 120 lines (105 sloc) 4.665 kb
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
1 <?php
a69abc1f »
2012-08-06 Docs for wp-activate.php. props lgedeon. fixes #20429.
2 /**
3 * Confirms that the activation key that is sent in an email after a user signs
4 * up for a new blog matchs the key for that user and then displays confirmation.
5 *
6 * @package WordPress
7 */
8
9 /** Define ABSPATH as this file's directory */
10f5e5f4 »
2011-04-17 Use static strings and respect coding standards in wp-activate.php. F…
10 define( 'WP_INSTALLING', true );
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
11
12 /** Sets up the WordPress Environment. */
13 require( dirname(__FILE__) . '/wp-load.php' );
14
6ec7cb45 »
2010-04-18 Use relative paths when including files, avoiding include_path. fixes…
15 require( './wp-blog-header.php' );
70940e96 »
2010-01-26 Redirect wp-activate.php to register when not multisite, See #11644
16
17 if ( !is_multisite() ) {
432f2a44 »
2010-10-27 Use the api to build site urls. Props nacin.
18 wp_redirect( site_url( '/wp-login.php?action=register' ) );
70940e96 »
2010-01-26 Redirect wp-activate.php to register when not multisite, See #11644
19 die();
20 }
21
f9a92c25 »
2010-01-15 Coding style cleanups
22 if ( is_object( $wp_object_cache ) )
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
23 $wp_object_cache->cache_enabled = false;
24
10f5e5f4 »
2011-04-17 Use static strings and respect coding standards in wp-activate.php. F…
25 do_action( 'activate_header' );
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
26
a69abc1f »
2012-08-06 Docs for wp-activate.php. props lgedeon. fixes #20429.
27 /**
28 * Adds an action hook specific to this page that fires on wp_head
29 *
30 * @since MU
31 */
c644b160 »
2010-02-13 add activate_wp_head hook to wp-activate.php, fixes #12166
32 function do_activate_header() {
10f5e5f4 »
2011-04-17 Use static strings and respect coding standards in wp-activate.php. F…
33 do_action( 'activate_wp_head' );
c644b160 »
2010-02-13 add activate_wp_head hook to wp-activate.php, fixes #12166
34 }
35 add_action( 'wp_head', 'do_activate_header' );
36
a69abc1f »
2012-08-06 Docs for wp-activate.php. props lgedeon. fixes #20429.
37 /**
38 * Loads styles specific to this page.
39 *
40 * @since MU
41 */
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
42 function wpmu_activate_stylesheet() {
43 ?>
6da55f77 »
2010-01-15 Trailing whitespace cleanup
44 <style type="text/css">
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
45 form { margin-top: 2em; }
46 #submit, #key { width: 90%; font-size: 24px; }
47 #language { margin-top: .5em; }
48 .error { background: #f66; }
498c93cb »
2011-01-22 Revert [17327] and [15858]. Props markmcwilliams, JohnONolan, et al. …
49 span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; }
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
50 </style>
51 <?php
52 }
53 add_action( 'wp_head', 'wpmu_activate_stylesheet' );
54
55 get_header();
56 ?>
57
58 <div id="content" class="widecolumn">
59 <?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
6da55f77 »
2010-01-15 Trailing whitespace cleanup
60
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
61 <h2><?php _e('Activation Key Required') ?></h2>
8e4859a3 »
2010-03-29 Use network_*_url(). see #12736
62 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>">
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
63 <p>
64 <label for="key"><?php _e('Activation Key:') ?></label>
65 <br /><input type="text" name="key" id="key" value="" size="50" />
66 </p>
c99f4a99 »
2010-12-25 Revert [15830] for wp-activate.php. see #15064, fixes #15976.
67 <p class="submit">
68 <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" />
69 </p>
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
70 </form>
6da55f77 »
2010-01-15 Trailing whitespace cleanup
71
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
72 <?php } else {
73
74 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
6da55f77 »
2010-01-15 Trailing whitespace cleanup
75 $result = wpmu_activate_signup($key);
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
76 if ( is_wp_error($result) ) {
77 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
78 $signup = $result->get_error_data();
79 ?>
80 <h2><?php _e('Your account is now active!'); ?></h2>
81 <?php
1e3b8496 »
2010-04-19 Take out opening and closing <p> tags from translation strings. Focus…
82 echo '<p class="lead-in">';
83 if ( $signup->domain . $signup->path == '' ) {
07ff8b21 »
2011-12-13 Use one space, not two, after trailing punctuation. fixes #19537
84 printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() );
1e3b8496 »
2010-04-19 Take out opening and closing <p> tags from translation strings. Focus…
85 } else {
07ff8b21 »
2011-12-13 Use one space, not two, after trailing punctuation. fixes #19537
86 printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() );
1e3b8496 »
2010-04-19 Take out opening and closing <p> tags from translation strings. Focus…
87 }
88 echo '</p>';
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
89 } else {
90 ?>
91 <h2><?php _e('An error occurred during the activation'); ?></h2>
92 <?php
93 echo '<p>'.$result->get_error_message().'</p>';
94 }
95 } else {
96 extract($result);
97 $url = get_blogaddress_by_id( (int) $blog_id);
7127ed11 »
2012-08-03 Move most instances of new WP_User to get_userdata(). see #21120.
98 $user = get_userdata( (int) $user_id);
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
99 ?>
100 <h2><?php _e('Your account is now active!'); ?></h2>
6da55f77 »
2010-01-15 Trailing whitespace cleanup
101
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
102 <div id="signup-welcome">
103 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p>
104 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p>
105 </div>
6da55f77 »
2010-01-15 Trailing whitespace cleanup
106
8e4859a3 »
2010-03-29 Use network_*_url(). see #12736
107 <?php if ( $url != network_home_url('', 'http') ) : ?>
87f06616 »
2011-05-07 A few "login" used as a verb fixes. props xibe. fixes #17335
108 <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php' ); ?></p>
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
109 <?php else: ?>
87f06616 »
2011-05-07 A few "login" used as a verb fixes. props xibe. fixes #17335
110 <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?></p>
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
111 <?php endif;
6da55f77 »
2010-01-15 Trailing whitespace cleanup
112 }
336bec59 »
2010-01-06 Set svn-eolstyle on some files. See #11644.
113 }
114 ?>
115 </div>
1e3b8496 »
2010-04-19 Take out opening and closing <p> tags from translation strings. Focus…
116 <script type="text/javascript">
117 var key_input = document.getElementById('key');
118 key_input && key_input.focus();
119 </script>
120 <?php get_footer(); ?>
Something went wrong with that request. Please try again.