password-reset.php
5.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
/**
* Template for the password reset
*
* This template can be overridden by copying it to yourtheme/ultimate-member/templates/password-reset.php
*
* Call: function ultimatemember_password()
*
* @version 2.6.1
*
* @var string $mode
* @var int $form_id
* @var array $args
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?>">
<div class="um-form">
<form method="post" action="">
<?php if ( isset( $_GET['updated'] ) && 'checkemail' === sanitize_key( $_GET['updated'] ) ) { ?>
<div class="um-field um-field-block um-field-type_block">
<div class="um-field-block">
<div style="text-align:center;">
<?php esc_html_e( 'If an account matching the provided details exists, we will send a password reset link. Please check your inbox.', 'ultimate-member' ); ?>
</div>
</div>
</div>
<?php } elseif ( isset( $_GET['updated'] ) && 'password_changed' === sanitize_key( $_GET['updated'] ) ) { ?>
<div class="um-field um-field-block um-field-type_block">
<div class="um-field-block">
<div style="text-align:center;">
<?php esc_html_e( 'You have successfully changed password.', 'ultimate-member' ); ?>
</div>
</div>
</div>
<?php } else { ?>
<input type="hidden" name="_um_password_reset" id="_um_password_reset" value="1" />
<?php
/**
* UM hook
*
* @type action
* @title um_reset_password_page_hidden_fields
* @description Password reset hidden fields
* @input_vars
* [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_reset_password_page_hidden_fields', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_reset_password_page_hidden_fields', 'my_reset_password_page_hidden_fields', 10, 1 );
* function my_reset_password_page_hidden_fields( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_reset_password_page_hidden_fields', $args );
if ( ! empty( $_GET['updated'] ) ) { ?>
<div class="um-field um-field-block um-field-type_block">
<div class="um-field-block">
<div style="text-align:center;">
<?php if ( 'expiredkey' === sanitize_key( $_GET['updated'] ) ) {
esc_html_e( 'Your password reset link has expired. Please request a new link below.', 'ultimate-member' );
} elseif ( 'invalidkey' === sanitize_key( $_GET['updated'] ) ) {
esc_html_e( 'Your password reset link appears to be invalid. Please request a new link below.', 'ultimate-member' );
} ?>
</div>
</div>
</div>
<?php } else { ?>
<div class="um-field um-field-block um-field-type_block">
<div class="um-field-block">
<div style="text-align:center;">
<?php esc_html_e( 'To reset your password, please enter your email address or username below.', 'ultimate-member' ); ?>
</div>
</div>
</div>
<?php }
$fields = UM()->builtin()->get_specific_fields( 'username_b' );
$output = null;
foreach ( $fields as $key => $data ) {
$output .= UM()->fields()->edit_field( $key, $data );
}
echo $output;
/**
* UM hook
*
* @type action
* @title um_after_password_reset_fields
* @description Hook that runs after user reset their password
* @input_vars
* [{"var":"$args","type":"array","desc":"Form data"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_after_password_reset_fields', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_after_password_reset_fields', 'my_after_password_reset_fields', 10, 1 );
* function my_after_password_reset_fields( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_after_password_reset_fields', $args ); ?>
<div class="um-col-alt um-col-alt-b">
<div class="um-center">
<input type="submit" value="<?php esc_attr_e( 'Reset password', 'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" />
</div>
<div class="um-clear"></div>
</div>
<?php
/**
* UM hook
*
* @type action
* @title um_reset_password_form
* @description Password reset display form
* @input_vars
* [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_reset_password_form', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_reset_password_form', 'my_reset_password_form', 10, 1 );
* function my_reset_password_form( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_reset_password_form', $args );
/**
* UM hook
*
* @type action
* @title um_after_form_fields
* @description Password reset after display form
* @input_vars
* [{"var":"$args","type":"array","desc":"Password reset shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_after_form_fields', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_after_form_fields', 'my_after_form_fields', 10, 1 );
* function my_after_form_fields( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_after_form_fields', $args );
} ?>
</form>
</div>
</div>