Skip to content
Newer
Older
100644 95 lines (79 sloc) 4.26 KB
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
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' );
70940e9 Redirect wp-activate.php to register when not multisite, See #11644
wpmuguru authored
8
9 if ( !is_multisite() ) {
10 wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
11 die();
12 }
13
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
14 require_once( ABSPATH . WPINC . '/registration.php');
15
f9a92c2 Coding style cleanups
ryan authored
16 if ( is_object( $wp_object_cache ) )
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
17 $wp_object_cache->cache_enabled = false;
18
19 do_action("activate_header");
20
21 function wpmu_activate_stylesheet() {
22 ?>
6da55f7 Trailing whitespace cleanup
ryan authored
23 <style type="text/css">
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
24 form { margin-top: 2em; }
25 #submit, #key { width: 90%; font-size: 24px; }
26 #language { margin-top: .5em; }
27 .error { background: #f66; }
28 span.h3 { padding:0 8px; font-size:1.3em; font-family:'Trebuchet MS','Lucida Grande',Verdana,Arial,Sans-Serif; font-weight:700; color:#333333; }
29 </style>
30 <?php
31 }
32 add_action( 'wp_head', 'wpmu_activate_stylesheet' );
33
34 get_header();
35 ?>
36
37 <div id="content" class="widecolumn">
38 <?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
6da55f7 Trailing whitespace cleanup
ryan authored
39
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
40 <h2><?php _e('Activation Key Required') ?></h2>
41 <form name="activateform" id="activateform" method="post" action="<?php echo 'http://' . $current_site->domain . $current_site->path ?>wp-activate.php">
42 <p>
43 <label for="key"><?php _e('Activation Key:') ?></label>
44 <br /><input type="text" name="key" id="key" value="" size="50" />
45 </p>
46 <p class="submit">
49cda5f Remove raquo. see #11644
ryan authored
47 <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" />
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
48 </p>
49 </form>
6da55f7 Trailing whitespace cleanup
ryan authored
50
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
51 <?php } else {
52
53 $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
6da55f7 Trailing whitespace cleanup
ryan authored
54 $result = wpmu_activate_signup($key);
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
55 if ( is_wp_error($result) ) {
56 if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
57 $signup = $result->get_error_data();
58 ?>
59 <h2><?php _e('Your account is now active!'); ?></h2>
60 <?php
f9a92c2 Coding style cleanups
ryan authored
61 if ( $signup->domain . $signup->path == '' ) {
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
62 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');
63 } else {
64 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');
65 }
66 } else {
67 ?>
68 <h2><?php _e('An error occurred during the activation'); ?></h2>
69 <?php
70 echo '<p>'.$result->get_error_message().'</p>';
71 }
72 } else {
73 extract($result);
74 $url = get_blogaddress_by_id( (int) $blog_id);
75 $user = new WP_User( (int) $user_id);
76 ?>
77 <h2><?php _e('Your account is now active!'); ?></h2>
6da55f7 Trailing whitespace cleanup
ryan authored
78
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
79 <div id="signup-welcome">
80 <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p>
81 <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p>
82 </div>
6da55f7 Trailing whitespace cleanup
ryan authored
83
f9a92c2 Coding style cleanups
ryan authored
84 <?php if ( $url != 'http://' . $current_site->domain . $current_site->path ) : ?>
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
85 <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>
86 <?php else: ?>
87 <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>
88 <?php endif;
6da55f7 Trailing whitespace cleanup
ryan authored
89 }
336bec5 Set svn-eolstyle on some files. See #11644.
westi authored
90 }
91 ?>
92 </div>
93
94 <?php get_footer(); ?>
Something went wrong with that request. Please try again.