Ticket #5775: email-validation.patch
File email-validation.patch, 7.4 KB (added by , 11 years ago) |
---|
-
src/bp-xprofile/bp-xprofile-template.php
776 776 777 777 <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?> 778 778 779 <?php printf( $r['before_radio'], esc_attr( $level['id'] )); ?>779 <?php printf( $r['before_radio'], $level['id'] ); ?> 780 780 781 781 <label for="<?php echo esc_attr( 'see-field_' . $r['field_id'] . '_' . $level['id'] ); ?>"> 782 782 <input type="radio" id="<?php echo esc_attr( 'see-field_' . $r['field_id'] . '_' . $level['id'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] . '_visibility' ); ?>" value="<?php echo esc_attr( $level['id'] ); ?>" <?php checked( $level['id'], bp_get_the_profile_field_visibility_level() ); ?> /> -
src/bp-templates/bp-legacy/js/email-validation.js
1 /* Password Verify */ 2 ( function( $ ){ 3 function validate_email_address() { 4 var $email = $( '.email-entry' ), 5 $form = $( '.standard-form' ), 6 emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 7 8 var error_handler = function() { 9 $email.focus(); 10 return false; 11 }; 12 13 if( !emailReg.test( $email.val() ) ) { 14 $form.bind( 'submit', error_handler ); 15 $email.addClass( 'error' ); 16 if ( ! $email.prev( 'div.error' ).length ) { 17 $email.before( '<div class="error">' + BP_Validation.invalid_email + '</div>' ); 18 } 19 else { 20 // This also could happen 21 $email.prev( 'div.error' ).html( BP_Validation.invalid_email ).css( 'display', 'block' ); 22 } 23 } 24 else { 25 $form.unbind( 'submit' ); 26 if ( $email.prev( 'div.error' ).length ) { 27 $email.removeClass( 'error' ); 28 $email.prev( 'div.error' ).html('').css( 'display', 'none' ); 29 } 30 } 31 return; 32 } 33 34 // Bind validate_email_address to blur event in the email fields 35 $( document ).ready( function() { 36 $( '.email-entry' ).val( '' ).blur( validate_email_address ); 37 }); 38 39 } )( jQuery ); 40 No newline at end of file -
src/bp-templates/bp-legacy/buddypress-functions.php
268 268 ) ); 269 269 wp_enqueue_script( $asset['handle'] . '-password-verify', $asset['location'], $dependencies, $this->version); 270 270 } 271 272 // Maybe enqueue email validation JS (register page or user settings page) 273 if ( bp_is_register_page() || ( function_exists( 'bp_is_user_settings_general' ) && bp_is_user_settings_general() ) ) { 274 275 // Add more words that we need to use in JS so they 276 // can be translated. 277 // Note: here we could also add a filter to pass blacklisted domains. 278 $params = array( 279 'invalid_email' => __( 'The email address is invalid.', 'buddypress' ), 280 ); 281 wp_localize_script( $asset['handle'], 'BP_Validation', $params ); 282 283 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 284 $filename = "email-validation{$min}.js"; 285 286 // Locate the Register Page JS file 287 $asset = $this->locate_asset_in_stack( $filename, 'js' ); 288 289 // Enqueue script 290 wp_enqueue_script( $asset['handle'] . '-email-validation', $asset['location'], $dependencies, $this->version); 291 } 271 292 } 272 293 273 294 /** -
src/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
10 10 <?php endif; ?> 11 11 12 12 <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label> 13 <input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input " />13 <input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input email-entry" /> 14 14 15 15 <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label> 16 16 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" /> <?php _e( 'New Password', 'buddypress' ); ?><br /> -
src/bp-templates/bp-legacy/buddypress/members/register.php
31 31 32 32 <label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 33 33 <?php do_action( 'bp_signup_username_errors' ); ?> 34 <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />34 <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" required /> 35 35 36 36 <label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 37 37 <?php do_action( 'bp_signup_email_errors' ); ?> 38 <input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />38 <input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" class="email-entry" required /> 39 39 40 40 <label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 41 41 <?php do_action( 'bp_signup_password_errors' ); ?> 42 <input type="password" name="signup_password" id="signup_password" value="" class="password-entry" />42 <input type="password" name="signup_password" id="signup_password" value="" class="password-entry" required /> 43 43 <div id="pass-strength-result"></div> 44 44 45 45 <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 46 46 <?php do_action( 'bp_signup_password_confirm_errors' ); ?> 47 <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" />47 <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" required /> 48 48 49 49 <?php do_action( 'bp_account_details_fields' ); ?> 50 50 -
src/bp-templates/bp-legacy/buddypress/activity/post-form.php
35 35 <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" /> 36 36 </div> 37 37 38 <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>38 <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() && bp_get_total_group_count_for_user() > 0 ) : ?> 39 39 40 40 <div id="whats-new-post-in-box"> 41 41