38 */ |
38 */ |
39 function do_activate_header() { |
39 function do_activate_header() { |
40 /** |
40 /** |
41 * Fires before the Site Activation page is loaded, but on the wp_head action. |
41 * Fires before the Site Activation page is loaded, but on the wp_head action. |
42 * |
42 * |
43 * @since 3.0 |
43 * @since 3.0.0 |
44 */ |
44 */ |
45 do_action( 'activate_wp_head' ); |
45 do_action( 'activate_wp_head' ); |
46 } |
46 } |
47 add_action( 'wp_head', 'do_activate_header' ); |
47 add_action( 'wp_head', 'do_activate_header' ); |
48 |
48 |
82 </form> |
82 </form> |
83 |
83 |
84 <?php } else { |
84 <?php } else { |
85 |
85 |
86 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key']; |
86 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key']; |
87 $result = wpmu_activate_signup($key); |
87 $result = wpmu_activate_signup( $key ); |
88 if ( is_wp_error($result) ) { |
88 if ( is_wp_error($result) ) { |
89 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { |
89 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { |
90 $signup = $result->get_error_data(); |
90 $signup = $result->get_error_data(); |
91 ?> |
91 ?> |
92 <h2><?php _e('Your account is now active!'); ?></h2> |
92 <h2><?php _e('Your account is now active!'); ?></h2> |
103 <h2><?php _e('An error occurred during the activation'); ?></h2> |
103 <h2><?php _e('An error occurred during the activation'); ?></h2> |
104 <?php |
104 <?php |
105 echo '<p>'.$result->get_error_message().'</p>'; |
105 echo '<p>'.$result->get_error_message().'</p>'; |
106 } |
106 } |
107 } else { |
107 } else { |
108 extract($result); |
108 $url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int) $result['blog_id'] ) : ''; |
109 $url = get_blogaddress_by_id( (int) $blog_id); |
109 $user = get_userdata( (int) $result['user_id'] ); |
110 $user = get_userdata( (int) $user_id); |
|
111 ?> |
110 ?> |
112 <h2><?php _e('Your account is now active!'); ?></h2> |
111 <h2><?php _e('Your account is now active!'); ?></h2> |
113 |
112 |
114 <div id="signup-welcome"> |
113 <div id="signup-welcome"> |
115 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p> |
114 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p> |
116 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p> |
115 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $result['password']; ?></p> |
117 </div> |
116 </div> |
118 |
117 |
119 <?php if ( $url != network_home_url('', 'http') ) : ?> |
118 <?php if ( $url && $url != network_home_url( '', 'http' ) ) : ?> |
120 <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> |
119 <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> |
121 <?php else: ?> |
120 <?php else: ?> |
122 <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> |
121 <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> |
123 <?php endif; |
122 <?php endif; |
124 } |
123 } |