Example #1
0
 private function callback_reset_password($user)
 {
     $form = wpsc_get_password_reset_form_args();
     add_filter('wpsc_validation_rule_fields_dont_match_message', array($this, 'filter_fields_dont_match_message'));
     $validation = wpsc_validate_form($form);
     remove_filter('wpsc_validation_rule_fields_dont_match_message', array($this, 'filter_fields_dont_match_message'));
     if (is_wp_error($validation)) {
         wpsc_set_validation_errors($validation);
         return;
     }
     $this->reset_password($user, $_POST['pass1']);
     $message = apply_filters('wpsc_reset_password_success_message', __('Your password has been reset successfully. Please log in with the new password.', 'wp-e-commerce'), $user);
     $this->message_collection->add($message, 'success', 'main', 'flash');
     wp_redirect(wpsc_get_login_url());
     exit;
 }
Example #2
0
function wpsc_get_password_reset_form()
{
    $args = wpsc_get_password_reset_form_args();
    return apply_filters('wpsc_get_password_reset_form', wpsc_get_form_output($args));
}