Skip to:
Content

BuddyPress.org

Ticket #6111: 6111.02.diff

File 6111.02.diff, 1.2 KB (added by henry.wright, 8 years ago)
  • src/bp-settings/bp-settings-actions.php

    diff --git src/bp-settings/bp-settings-actions.php src/bp-settings/bp-settings-actions.php
    index d56f2c3..73803d0 100644
    Regards, 
    160160
    161161                if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
    162162
    163                         // Password change attempt is successful
    164163                        if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) {
    165                                 $update_user->user_pass = $_POST['pass1'];
    166                                 $pass_changed = true;
     164                               
     165                                // Password change attempt is successful
     166                                if ( $_POST['pwd'] != $_POST['pass1'] ) {
     167                                        $update_user->user_pass = $_POST['pass1'];
     168                                        $pass_changed = true;
     169                                       
     170                                // The new password is the same as the current password
     171                                } else {
     172                                        $pass_error = 'same';
     173                                }
    167174
    168175                        // Password change attempt was unsuccessful
    169176                        } else {
    Regards, 
    235242                case 'empty' :
    236243                        $feedback['pass_empty']    = __( 'One of the password fields was empty.', 'buddypress' );
    237244                        break;
     245                case 'same' :
     246                        $feedback['pass_same']     = __( 'The new password must be different from the current password.', 'buddypress' );
    238247                case false :
    239248                        // No change
    240249                        break;