Nessuna descrizione

password-reset.php 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php if ( ! defined( 'ABSPATH' ) ) {
  2. exit;
  3. } ?>
  4. <div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?>">
  5. <div class="um-form">
  6. <form method="post" action="">
  7. <?php if ( isset( $_GET['updated'] ) && 'checkemail' === sanitize_key( $_GET['updated'] ) ) { ?>
  8. <div class="um-field um-field-block um-field-type_block">
  9. <div class="um-field-block">
  10. <div style="text-align:center;">
  11. <?php esc_html_e( 'We have sent you a password reset link to your e-mail. Please check your inbox.', 'ultimate-member' ); ?>
  12. </div>
  13. </div>
  14. </div>
  15. <?php } else { ?>
  16. <input type="hidden" name="_um_password_reset" id="_um_password_reset" value="1" />
  17. <?php
  18. /**
  19. * UM hook
  20. *
  21. * @type action
  22. * @title um_reset_password_page_hidden_fields
  23. * @description Password reset hidden fields
  24. * @input_vars
  25. * [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
  26. * @change_log
  27. * ["Since: 2.0"]
  28. * @usage add_action( 'um_reset_password_page_hidden_fields', 'function_name', 10, 1 );
  29. * @example
  30. * <?php
  31. * add_action( 'um_reset_password_page_hidden_fields', 'my_reset_password_page_hidden_fields', 10, 1 );
  32. * function my_reset_password_page_hidden_fields( $args ) {
  33. * // your code here
  34. * }
  35. * ?>
  36. */
  37. do_action( 'um_reset_password_page_hidden_fields', $args );
  38. if ( ! empty( $_GET['updated'] ) ) { ?>
  39. <div class="um-field um-field-block um-field-type_block">
  40. <div class="um-field-block">
  41. <div style="text-align:center;">
  42. <?php if ( 'expiredkey' === sanitize_key( $_GET['updated'] ) ) {
  43. _e( 'Your password reset link has expired. Please request a new link below.', 'ultimate-member' );
  44. } elseif ( 'invalidkey' === sanitize_key( $_GET['updated'] ) ) {
  45. _e( 'Your password reset link appears to be invalid. Please request a new link below.', 'ultimate-member' );
  46. } ?>
  47. </div>
  48. </div>
  49. </div>
  50. <?php } else { ?>
  51. <div class="um-field um-field-block um-field-type_block">
  52. <div class="um-field-block">
  53. <div style="text-align:center;">
  54. <?php _e( 'To reset your password, please enter your email address or username below', 'ultimate-member' ); ?>
  55. </div>
  56. </div>
  57. </div>
  58. <?php }
  59. $fields = UM()->builtin()->get_specific_fields( 'username_b' );
  60. $output = null;
  61. foreach ( $fields as $key => $data ) {
  62. $output .= UM()->fields()->edit_field( $key, $data );
  63. }
  64. echo $output;
  65. /**
  66. * UM hook
  67. *
  68. * @type action
  69. * @title um_after_password_reset_fields
  70. * @description Hook that runs after user reset their password
  71. * @input_vars
  72. * [{"var":"$args","type":"array","desc":"Form data"}]
  73. * @change_log
  74. * ["Since: 2.0"]
  75. * @usage add_action( 'um_after_password_reset_fields', 'function_name', 10, 1 );
  76. * @example
  77. * <?php
  78. * add_action( 'um_after_password_reset_fields', 'my_after_password_reset_fields', 10, 1 );
  79. * function my_after_password_reset_fields( $args ) {
  80. * // your code here
  81. * }
  82. * ?>
  83. */
  84. do_action( 'um_after_password_reset_fields', $args ); ?>
  85. <div class="um-col-alt um-col-alt-b">
  86. <div class="um-center">
  87. <input type="submit" value="<?php esc_attr_e( 'Reset my password', 'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" />
  88. </div>
  89. <div class="um-clear"></div>
  90. </div>
  91. <?php
  92. /**
  93. * UM hook
  94. *
  95. * @type action
  96. * @title um_reset_password_form
  97. * @description Password reset display form
  98. * @input_vars
  99. * [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
  100. * @change_log
  101. * ["Since: 2.0"]
  102. * @usage add_action( 'um_reset_password_form', 'function_name', 10, 1 );
  103. * @example
  104. * <?php
  105. * add_action( 'um_reset_password_form', 'my_reset_password_form', 10, 1 );
  106. * function my_reset_password_form( $args ) {
  107. * // your code here
  108. * }
  109. * ?>
  110. */
  111. do_action( 'um_reset_password_form', $args );
  112. /**
  113. * UM hook
  114. *
  115. * @type action
  116. * @title um_after_form_fields
  117. * @description Password reset after display form
  118. * @input_vars
  119. * [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
  120. * @change_log
  121. * ["Since: 2.0"]
  122. * @usage add_action( 'um_after_form_fields', 'function_name', 10, 1 );
  123. * @example
  124. * <?php
  125. * add_action( 'um_after_form_fields', 'my_after_form_fields', 10, 1 );
  126. * function my_after_form_fields( $args ) {
  127. * // your code here
  128. * }
  129. * ?>
  130. */
  131. do_action( 'um_after_form_fields', $args );
  132. } ?>
  133. </form>
  134. </div>
  135. </div>