Fix reset and change password

This commit is contained in:
champsupertramp
2016-06-02 21:24:14 +08:00
parent 634994ecd9
commit 58978d7780
+3 -1
View File
@@ -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