[buddypress-trac] [BuddyPress] #2277: Add same signup email checks (is, dup, domain) when editing profile settings

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Apr 2 19:38:03 UTC 2010


#2277: Add same signup email checks (is, dup, domain) when editing profile
settings
--------------------+-------------------------------------------------------
 Reporter:  nuprn1  |       Owner:       
     Type:  defect  |      Status:  new  
 Priority:  normal  |   Milestone:  1.2.4
Component:  Core    |    Keywords:       
--------------------+-------------------------------------------------------
 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;
                                 }
                         }
 }}}

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2277>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list