root/trunk/wp-activate.php

Revision 1434, 4.2 kB (checked in by donncha, 3 months ago)

CSS Upgrade for the activate script thanks to momo360modena, fixes #724

Line 
1 <?php
2 define( "WP_INSTALLING", true );
3
4 /** Sets up the WordPress Environment. */
5 require( dirname(__FILE__) . '/wp-load.php' );
6
7 require( 'wp-blog-header.php' );
8 require_once( ABSPATH . WPINC . '/registration.php');
9
10 if( is_object( $wp_object_cache ) )
11     $wp_object_cache->cache_enabled = false;
12
13 do_action("activate_header");
14
15 function wpmu_activate_stylesheet() {
16     ?>
17     <style type="text/css">   
18         form { margin-top: 2em; }
19         #submit, #key { width: 90%; font-size: 24px; }
20         #language { margin-top: .5em; }
21         .error { background: #f66; }
22         span.h3 { padding:0 8px; font-size:1.3em; font-family:'Trebuchet MS','Lucida Grande',Verdana,Arial,Sans-Serif; font-weight:700; color:#333333; }
23     </style>
24     <?php
25 }
26 add_action( 'wp_head', 'wpmu_activate_stylesheet' );
27
28 get_header();
29 ?>
30
31 <div id="content" class="widecolumn">
32     <?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
33        
34         <h2><?php _e('Activation Key Required') ?></h2>
35         <form name="activateform" id="activateform" method="post" action="<?php echo 'http://' . $current_site->domain . $current_site->path ?>wp-activate.php">
36             <p>
37                 <label for="key"><?php _e('Activation Key:') ?></label>
38                 <br /><input type="text" name="key" id="key" value="" size="50" />
39             </p>
40             <p class="submit">
41                 <input id="submit" type="submit" name="Submit" class="submit" value="<?php _e('Activate &raquo;') ?>" />
42             </p>
43         </form>
44        
45     <?php } else {
46
47         $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
48         $result = wpmu_activate_signup($key);       
49         if ( is_wp_error($result) ) {
50             if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
51                 $signup = $result->get_error_data();
52                 ?>
53                 <h2><?php _e('Your account is now active!'); ?></h2>
54                 <?php
55                 if( $signup->domain . $signup->path == '' ) {
56                     printf(__('<p class="lead-in">Your account has been activated. You may now <a href="%1$s">login</a> to the site using your chosen username of "%2$s".  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>.</p>'), 'http://' . $current_site->domain . $current_site->path . 'wp-login.php', $signup->user_login, $signup->user_email, 'http://' . $current_site->domain . $current_site->path . 'wp-login.php?action=lostpassword');
57                 } else {
58                     printf(__('<p class="lead-in">Your blog at <a href="%1$s">%2$s</a> is active. You may now login to your blog using your chosen username of "%3$s".  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>.</p>'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, 'http://' . $current_site->domain . $current_site->path . 'wp-login.php?action=lostpassword');
59                 }
60             } else {
61                 ?>
62                 <h2><?php _e('An error occurred during the activation'); ?></h2>
63                 <?php
64                 echo '<p>'.$result->get_error_message().'</p>';
65             }
66         } else {
67             extract($result);
68             $url = get_blogaddress_by_id( (int) $blog_id);
69             $user = new WP_User( (int) $user_id);
70             ?>
71             <h2><?php _e('Your account is now active!'); ?></h2>
72            
73             <div id="signup-welcome">
74                 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p>
75                 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p>
76             </div>
77                    
78             <?php if( $url != 'http://' . $current_site->domain . $current_site->path ) : ?>
79                 <p class="view"><?php printf(__('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, $url . 'wp-login.php' ); ?></p>
80             <?php else: ?>
81                 <p class="view"><?php printf( __( 'Your account is now activated. <a href="%1$s">Login</a> or go back to the <a href="%2$s">homepage</a>.' ), 'http://' . $current_site->domain . $current_site->path . 'wp-login.php', 'http://' . $current_site->domain . $current_site->path ); ?></p>
82             <?php endif;
83         }       
84     }
85     ?>
86 </div>
87
88 <?php get_footer(); ?>
89
Note: See TracBrowser for help on using the browser.