Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#2277 closed defect (bug) (fixed)

Add same signup email checks (is, dup, domain) when editing profile settings

Reported by: nuprn1's profile nuprn1 Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords:
Cc:

Description

something like this needs to be added to the profile > settings > general page

			//need to make sure changing an email address does not already exists
			if ( $_POST['email'] != '' ) {

				//what is missing from the profile page vs signup - lets double check the goodies
				$user_email = sanitize_email( wp_specialchars( trim( $_POST['email'] ) ) );

				if ( !is_email( $user_email ) )
					$email_error = true;

				$limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );

				if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
					$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );

					if ( in_array( $emaildomain, (array)$limited_email_domains ) == false )
						$email_error = true;
				}

				if ( !$email_error && $current_user->user_email != $user_email  ) {
				
					//we don't want email dups in the system
					if ( email_exists( $user_email ) )
						$email_error = true;
						
					if (!$email_error)
						$current_user->user_email = $user_email;
				}
			}

Change History (2)

#1 @DJPaul
15 years ago

  • Milestone changed from 1.2.4 to 1.3

Bumping this to 1.3 (WP 3.0 release) so we can also add support for banned_email_domains in a multisites configuration.

#2 @r-a-y
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In [3524]. Also refer to #2517.

Last edited 14 years ago by r-a-y (previous) (diff)
Note: See TracTickets for help on using tickets.