From 744f80e0c6fd0679a9f57e7b9e1c5390d5c8bb4a Mon Sep 17 00:00:00 2001 From: claudiosmweb Date: Wed, 19 Nov 2014 16:57:26 -0200 Subject: [PATCH] Fixed password reset handler --- includes/class-wc-form-handler.php | 8 -------- templates/myaccount/form-lost-password.php | 12 ++++++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index c5d8e695e5e..10439962eca 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -828,7 +828,6 @@ class WC_Form_Handler { // process lost password form if ( isset( $_POST['user_login'] ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'lost_password' ) ) { - WC_Shortcode_My_Account::retrieve_password(); } @@ -839,19 +838,12 @@ class WC_Form_Handler { $user = WC_Shortcode_My_Account::check_password_reset_key( $_POST['reset_key'], $_POST['reset_login'] ); if ( is_object( $user ) ) { - - // save these values into the form again in case of errors - $args['key'] = wc_clean( $_POST['reset_key'] ); - $args['login'] = wc_clean( $_POST['reset_login'] ); - if ( empty( $_POST['password_1'] ) || empty( $_POST['password_2'] ) ) { wc_add_notice( __( 'Please enter your password.', 'woocommerce' ), 'error' ); - $args['form'] = 'reset_password'; } if ( $_POST[ 'password_1' ] !== $_POST[ 'password_2' ] ) { wc_add_notice( __( 'Passwords do not match.', 'woocommerce' ), 'error' ); - $args['form'] = 'reset_password'; } $errors = new WP_Error(); diff --git a/templates/myaccount/form-lost-password.php b/templates/myaccount/form-lost-password.php index c2e4edcc5cc..1a248ad6e14 100644 --- a/templates/myaccount/form-lost-password.php +++ b/templates/myaccount/form-lost-password.php @@ -2,9 +2,9 @@ /** * Lost password form * - * @author WooThemes - * @package WooCommerce/Templates - * @version 2.0.0 + * @author WooThemes + * @package WooCommerce/Templates + * @version 2.3.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -43,7 +43,11 @@ if ( ! defined( 'ABSPATH' ) ) {
-

+

+ + +

+