From 58978d778025f33d7bb681b6c20b28eb9ea38ac1 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Thu, 2 Jun 2016 21:24:14 +0800 Subject: [PATCH] Fix reset and change password --- core/um-actions-account.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/um-actions-account.php b/core/um-actions-account.php index cce1706c..4739aadd 100644 --- a/core/um-actions-account.php +++ b/core/um-actions-account.php @@ -113,9 +113,11 @@ } $ultimatemember->account->current_tab = 'general'; + $user = get_user_by('login', um_user('user_login') ); // change password if ( $_POST['current_user_password'] != '' || $_POST['user_password'] != '' || $_POST['confirm_user_password'] != '') { - if ( $_POST['current_user_password'] == '' || !wp_check_password( $_POST['current_user_password'], um_user('user_pass'), um_user('ID') ) ) { + if ( $_POST['current_user_password'] == '' || ! wp_check_password( $_POST['current_user_password'], $user->data->user_pass, $user->data->ID ) ) { + $ultimatemember->form->add_error('current_user_password', __('This is not your password','ultimatemember') ); $ultimatemember->account->current_tab = 'password'; } else { // correct password