diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-05 16:08:00 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-05 16:08:00 +0000 |
| commit | 41d4795eef2579e540b0ae0919185d68da126e6a (patch) | |
| tree | 4bde3b7e59602e68fdc59f43a521242d2b368446 | |
| parent | 8b665b1672bcd41f285918ff7c6ce58d5d7b6e61 (diff) | |
| download | wordpress-mu-41d4795eef2579e540b0ae0919185d68da126e6a.tar.gz wordpress-mu-41d4795eef2579e540b0ae0919185d68da126e6a.tar.xz wordpress-mu-41d4795eef2579e540b0ae0919185d68da126e6a.zip | |
Limit email addresses used to register.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@131 7be80a69-a1ef-0310-a953-fb0f7c49ff36
| -rw-r--r-- | wp-inst/wp-includes/wpmu-functions.php | 7 | ||||
| -rw-r--r-- | wp-inst/wp-newblog.php | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/wp-inst/wp-includes/wpmu-functions.php b/wp-inst/wp-includes/wpmu-functions.php index 36f83ce..d90567f 100644 --- a/wp-inst/wp-includes/wpmu-functions.php +++ b/wp-inst/wp-includes/wpmu-functions.php @@ -436,6 +436,13 @@ function createBlog( $domain, $path, $username, $weblog_title, $admin_email, $si if( empty($path) ) $path = '/'; + $limited_email_domains = get_site_settings( 'limited_email_domains' ); + if( is_array( $limited_email_domains ) ) { + $emaildomain = substr( $admin_email, 1 + strpos( $admin_email, '@' ) ); + if( in_array( $emaildomain, $limited_email_domains ) == false ) { + return "error: email domain not allowed"; + } + } // Check if the domain has been used already. We should return an error message. if( $wpdb->get_var("SELECT blog_id FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'" ) ) return 'error: Blog URL already taken.'; diff --git a/wp-inst/wp-newblog.php b/wp-inst/wp-newblog.php index 8930f41..fe682e9 100644 --- a/wp-inst/wp-newblog.php +++ b/wp-inst/wp-newblog.php @@ -176,6 +176,8 @@ switch( $_POST[ 'stage' ] ) } else { if( $err == 'error: username used' ) { $errormsg[ 'weblog_id' ] = "Sorry, that blog already exists!"; + } elseif( $err == 'error: email domain not allowed' ) { + $errormsg[ 'admin_email' ] = "Sorry, that email address is not allowed!"; } else { $errormsg[ 'weblog_id' ] = "Sorry, that blog already exists!"; } |
