Changeset 42343 for trunk/src/wp-activate.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-activate.php
r41579 r42343 10 10 11 11 /** Sets up the WordPress Environment. */ 12 require( dirname( __FILE__) . '/wp-load.php' );12 require( dirname( __FILE__ ) . '/wp-load.php' ); 13 13 14 14 require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 15 15 16 if ( ! is_multisite() ) {16 if ( ! is_multisite() ) { 17 17 wp_redirect( wp_registration_url() ); 18 18 die(); 19 19 } 20 20 21 if ( is_object( $wp_object_cache ) ) 21 if ( is_object( $wp_object_cache ) ) { 22 22 $wp_object_cache->cache_enabled = false; 23 } 23 24 24 25 // Fix for page title … … 44 45 * 45 46 * Fires on the {@see 'wp_head'} action. 46 47 48 49 47 * 48 * @since 3.0.0 49 */ 50 do_action( 'activate_wp_head' ); 50 51 } 51 52 add_action( 'wp_head', 'do_activate_header' ); … … 74 75 <div id="signup-content" class="widecolumn"> 75 76 <div class="wp-activate-container"> 76 <?php if ( empty( $_GET['key']) && empty($_POST['key']) ) { ?>77 <?php if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) { ?> 77 78 78 <h2><?php _e( 'Activation Key Required')?></h2>79 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php'); ?>">79 <h2><?php _e( 'Activation Key Required' ); ?></h2> 80 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php' ); ?>"> 80 81 <p> 81 <label for="key"><?php _e('Activation Key:')?></label>82 82 <label for="key"><?php _e( 'Activation Key:' ); ?></label> 83 <br /><input type="text" name="key" id="key" value="" size="50" /> 83 84 </p> 84 85 <p class="submit"> 85 <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate')?>" />86 <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e( 'Activate' ); ?>" /> 86 87 </p> 87 88 </form> 88 89 89 <?php } else { 90 <?php 91 } else { 90 92 91 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];92 93 if ( is_wp_error($result) ) {94 95 96 97 <h2><?php _e('Your account is now active!'); ?></h2>93 $key = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key']; 94 $result = wpmu_activate_signup( $key ); 95 if ( is_wp_error( $result ) ) { 96 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { 97 $signup = $result->get_error_data(); 98 ?> 99 <h2><?php _e( 'Your account is now active!' ); ?></h2> 98 100 <?php 99 101 echo '<p class="lead-in">'; … … 118 120 } 119 121 echo '</p>'; 120 121 122 122 } else { 123 ?> 124 <h2><?php _e( 'An error occurred during the activation' ); ?></h2> 123 125 <p><?php echo $result->get_error_message(); ?></p> 124 126 <?php 125 126 127 $url= isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';128 129 130 <h2><?php _e('Your account is now active!'); ?></h2>127 } 128 } else { 129 $url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : ''; 130 $user = get_userdata( (int) $result['user_id'] ); 131 ?> 132 <h2><?php _e( 'Your account is now active!' ); ?></h2> 131 133 132 134 <div id="signup-welcome"> 133 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login?></p>134 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $result['password']; ?></p>135 <p><span class="h3"><?php _e( 'Username:' ); ?></span> <?php echo $user->user_login; ?></p> 136 <p><span class="h3"><?php _e( 'Password:' ); ?></span> <?php echo $result['password']; ?></p> 135 137 </div> 136 138 137 <?php if ( $url && $url != network_home_url( '', 'http' ) ) : 139 <?php 140 if ( $url && $url != network_home_url( '', 'http' ) ) : 138 141 switch_to_blog( (int) $result['blog_id'] ); 139 142 $login_url = wp_login_url(); 140 143 restore_current_blog(); 141 144 ?> 142 <p class="view"><?php 145 <p class="view"> 146 <?php 143 147 /* translators: 1: site URL, 2: login URL */ 144 148 printf( __( 'Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>' ), $url, esc_url( $login_url ) ); 145 ?></p> 146 <?php else: ?> 147 <p class="view"><?php 149 ?> 150 </p> 151 <?php else : ?> 152 <p class="view"> 153 <?php 148 154 /* translators: 1: login URL, 2: network home URL */ 149 155 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() ); 150 ?></p> 151 <?php endif; 152 } 156 ?> 157 </p> 158 <?php 159 endif; 153 160 } 161 } 154 162 ?> 155 163 </div> … … 159 167 key_input && key_input.focus(); 160 168 </script> 161 <?php get_footer( 'wp-activate' ); 169 <?php 170 get_footer( 'wp-activate' );
Note: See TracChangeset
for help on using the changeset viewer.