summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-22 17:41:46 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-22 17:41:46 +0000
commitefe3cf442bc611637d525aa635f0ba1e48a0d541 (patch)
treee2717f5663f155e72f938fc92c8ae36a5b15041d /wp-includes
parent0dbf1662b00de6478ffdaf0ad0b3cdc445e4e42b (diff)
downloadwordpress-mu-efe3cf442bc611637d525aa635f0ba1e48a0d541.tar.gz
wordpress-mu-efe3cf442bc611637d525aa635f0ba1e48a0d541.tar.xz
wordpress-mu-efe3cf442bc611637d525aa635f0ba1e48a0d541.zip
Confirm addition of new users. fixes #630
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1395 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/wpmu-functions.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index a2b64f5..3deae7a 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -1950,4 +1950,20 @@ function remove_tinymce_media_button( $buttons ) {
return $buttons;
}
add_filter( 'mce_buttons_2', 'remove_tinymce_media_button' );
+
+function add_existing_user_to_blog() {
+ if( false !== strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) ) {
+ $parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] );
+ $key = array_pop( $parts );
+ if( $key == '' )
+ $key = array_pop( $parts );
+ $details = get_option( "new_user_" . $key );
+ if( is_array( $details ) ) {
+ add_user_to_blog( '', $details[ 'user_id' ], $details[ 'role' ] );
+ do_action( "added_existing_user", $details[ 'user_id' ] );
+ wp_die( 'You have been added to this blog. Please visit the <a href="' . site_url() . '">homepage</a> or <a href="' . site_url( '/wp-admin/' ) . '">login</a> using your username and password.' );
+ }
+ }
+}
+add_action( 'init', 'add_existing_user_to_blog' );
?>