From 77d36df7fb95410dceea64cc864e57edce58ee6f Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 9 Apr 2007 11:26:25 +0000 Subject: Added "wpmu_active_signup" filter to return "all", "none", "blog" or "user" to enable all, none or some signup types git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@958 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-signup.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'wp-signup.php') diff --git a/wp-signup.php b/wp-signup.php index 7436261..0ce1087 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -208,7 +208,7 @@ function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $u } function signup_user($user_name = '', $user_email = '', $errors = '') { - global $current_site; + global $current_site, $active_signup; if ( ! is_wp_error($errors) ) $errors = new WP_Error(); @@ -235,11 +235,17 @@ function signup_user($user_name = '', $user_email = '', $errors = '') {  

+ + + + + />
/> +

@@ -354,16 +360,29 @@ if( in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { header( "Location: http://{$current_site->domain}{$current_site->path}" ); die(); } + +$active_signup = 'all'; +$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" + $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; if( $_POST['blog_public'] != 1 ) $_POST['blog_public'] = 0; +if( $active_signup == "none" ) { + _e( "Registration has been disabled." ); +} else { switch ($_POST['stage']) { case 'validate-user-signup' : - validate_user_signup(); + if( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) + validate_user_signup(); + else + _e( "User registration has been disabled." ); break; case 'validate-blog-signup': - validate_blog_signup(); + if( $active_signup == 'all' || $active_signup == 'blog' ) + validate_blog_signup(); + else + _e( "Blog registration has been disabled." ); break; case 'gimmeanotherblog': validate_another_blog_signup(); @@ -385,6 +404,7 @@ switch ($_POST['stage']) { } break; } +} ?> -- cgit