| @@ -2,20 +2,25 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * This template is used to display the login form with [give_login] |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | +$get_data = give_clean( filter_input_array( INPUT_GET ) ); | |
| 6 | 7 | |
| 7 | 8 | if ( ! is_user_logged_in() ) { |
| 8 | 9 | |
| 9 | - if ( ! empty( $_GET['payment_key'] ) ) { | |
| 10 | - $give_login_redirect = add_query_arg( 'payment_key', give_clean( $_GET['payment_key'] ) , give_get_history_page_uri() ); | |
| 10 | + if ( ! empty( $get_data['donation_id'] ) ) { | |
| 11 | + $give_login_redirect = add_query_arg( | |
| 12 | + 'donation_id', | |
| 13 | + $get_data['donation_id'], | |
| 14 | + give_get_history_page_uri() | |
| 15 | + ); | |
| 11 | 16 | } |
| 12 | 17 | |
| 13 | - // Show any error messages after form submission | |
| 18 | + // Show any error messages after form submission. | |
| 14 | 19 | Give()->notices->render_frontend_notices( 0 ); ?> |
| 15 | 20 | <form id="give-login-form" class="give-form" action="" method="post"> |
| 16 | 21 | <fieldset> |
| 17 | - <legend><?php _e( 'Log into Your Account', 'give' ); ?></legend> | |
| 22 | + <legend><?php esc_html_e( 'Log into Your Account', 'give' ); ?></legend> | |
| 18 | 23 | <?php |
| 19 | 24 | /** |
| 20 | 25 | * Fires in the login shortcode, before the login fields. |
| 21 | 26 | * |
| @@ -25,14 +30,14 @@ | ||
| 25 | 30 | */ |
| 26 | 31 | do_action( 'give_login_fields_before' ); |
| 27 | 32 | ?> |
| 28 | 33 | <div class="give-login-username give-login"> |
| 29 | - <label for="give_user_login"><?php _e( 'Username', 'give' ); ?></label> | |
| 34 | + <label for="give_user_login"><?php esc_html_e( 'Username or Email Address', 'give' ); ?></label> | |
| 30 | 35 | <input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" /> |
| 31 | 36 | </div> |
| 32 | 37 | |
| 33 | 38 | <div class="give-login-password give-login"> |
| 34 | - <label for="give_user_pass"><?php _e( 'Password', 'give' ); ?></label> | |
| 39 | + <label for="give_user_pass"><?php esc_html_e( 'Password', 'give' ); ?></label> | |
| 35 | 40 | <input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" /> |
| 36 | 41 | </div> |
| 37 | 42 | |
| 38 | 43 | <div class="give-login-submit give-login"> |
| @@ -38,13 +43,15 @@ | ||
| 38 | 43 | <div class="give-login-submit give-login"> |
| 39 | 44 | <input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" /> |
| 40 | 45 | <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" /> |
| 41 | 46 | <input type="hidden" name="give_action" value="user_login" /> |
| 42 | - <input id="give_login_submit" type="submit" class="give_submit" value="<?php _e( 'Log In', 'give' ); ?>" /> | |
| 47 | + <input id="give_login_submit" type="submit" class="give_submit" value="<?php esc_html_e( 'Log In', 'give' ); ?>" /> | |
| 43 | 48 | </div> |
| 44 | 49 | |
| 45 | 50 | <div class="give-lost-password give-login"> |
| 46 | - <a href="<?php echo wp_lostpassword_url(); ?>"><?php _e( 'Reset Password', 'give' ); ?></a> | |
| 51 | + <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"> | |
| 52 | + <?php esc_html_e( 'Reset Password', 'give' ); ?> | |
| 53 | + </a> | |
| 47 | 54 | </div> |
| 48 | 55 | <?php |
| 49 | 56 | /** |
| 50 | 57 | * Fires in the login shortcode, after the login fields. |
| @@ -56,9 +63,26 @@ | ||
| 56 | 63 | do_action( 'give_login_fields_after' ); |
| 57 | 64 | ?> |
| 58 | 65 | </fieldset> |
| 59 | 66 | </form> |
| 60 | -<?php } elseif( isset( $_GET['give-login-success'] ) && true === (bool) $_GET['give-login-success'] ) { ?> | |
| 61 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', __( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?> | |
| 62 | -<?php } else { ?> | |
| 63 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_already_logged_in_message', sprintf( __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ), esc_url( $give_logout_redirect ) ) ), true, 'warning' ); ?> | |
| 64 | -<?php } ?> | |
| 67 | + <?php | |
| 68 | +} elseif ( isset( $get_data['give-login-success'] ) && true === (bool) $get_data['give-login-success'] ) { | |
| 69 | + | |
| 70 | + Give_Notices::print_frontend_notice( | |
| 71 | + apply_filters( 'give_successful_login_message', esc_html__( 'Login successful. Welcome!', 'give' ) ), | |
| 72 | + true, | |
| 73 | + 'success' | |
| 74 | + ); | |
| 75 | +} else { | |
| 76 | + Give_Notices::print_frontend_notice( | |
| 77 | + apply_filters( | |
| 78 | + 'give_already_logged_in_message', | |
| 79 | + sprintf( | |
| 80 | + /* translators: %s Redirect URL. */ | |
| 81 | + __( 'You are already logged in to the site. <a href="%s">Click here</a> to log out.', 'give' ), | |
| 82 | + esc_url( wp_logout_url() ) | |
| 83 | + ) | |
| 84 | + ), | |
| 85 | + true, | |
| 86 | + 'warning' | |
| 87 | + ); | |
| 88 | +} | |