Skip to content

Commit

Permalink
fixed security issue in email verification and fixed product quantity…
Browse files Browse the repository at this point in the history
… issue
  • Loading branch information
ishwar-singh-solanki committed May 6, 2024
1 parent 89d744b commit 9c44b0f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edwiser-bridge/includes/class-eb-user-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ public function eb_user_email_verify() {

if ( 'eb_user_email_verification' === $action ) {
$eb_user_email_verification_key = get_user_meta( $verification_id, 'eb_user_email_verification_key', true );
if ( $verification_key === $eb_user_email_verification_key ) {
if ( ! empty( $verification_key ) && $verification_key === $eb_user_email_verification_key ) {
update_user_meta( $verification_id, 'eb_user_email_verified', 1 );
$message = __( 'Your email is verified successfully.', 'edwiser-bridge' );
// create moodle user.
Expand Down
27 changes: 27 additions & 0 deletions edwiser-bridge/public/assets/js/eb-public.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,33 @@
],
});
}

// disable woocomerce quantity input field
$('.eb-pro-product-page-sidebar .quantity-wrap').find('input').prop('disabled', true);
$('.eb-pro-product-page-sidebar .quantity-wrap .quantity-minus').prop('disabled', true);
$('.eb-pro-product-page-sidebar .quantity-wrap .quantity-plus').prop('disabled', true);

if ($( "#wdm_edwiser_self_enroll" ).length) {
var is_checked = $( "#wdm_edwiser_self_enroll" ).is(':checked');
if (is_checked) {
$( ".eb-pro-product-page-sidebar .quantity-wrap" ).find('input').prop('disabled', false);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-minus" ).prop('disabled', false);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-plus" ).prop('disabled', false);
}
};

$( "#wdm_edwiser_self_enroll" ).change(function() {
if (this.checked) {
$( ".eb-pro-product-page-sidebar .quantity-wrap" ).find('input').prop('disabled', false);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-minus" ).prop('disabled', false);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-plus" ).prop('disabled', false);
} else {
$( ".eb-pro-product-page-sidebar .quantity-wrap" ).find('input').prop('disabled', true);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-minus" ).prop('disabled', true);
$( ".eb-pro-product-page-sidebar .quantity-wrap .quantity-plus" ).prop('disabled', true);
$( ".eb-pro-product-page-sidebar .quantity-wrap" ).find('input').val(1);
}
});
});
})(jQuery);

Expand Down

0 comments on commit 9c44b0f

Please sign in to comment.