-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathget_password.php
More file actions
65 lines (59 loc) · 2.62 KB
/
get_password.php
File metadata and controls
65 lines (59 loc) · 2.62 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
<?php
$warning = apply_filters('piereg_reset_password_warning',__("Enter your new password below.",'piereg')); # newlyAddedHookFilter
$success = "";
$errors = new WP_Error();
if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) {
$errors->add( 'password_reset_mismatch',
apply_filters("piereg_reset_password_error",__('The passwords do not match.', 'piereg')) # newlyAddedHookFilter
);
}
do_action( 'validate_password_reset', $errors, $user );
if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) {
reset_password($user, $_POST['pass1']);
$success = apply_filters('piereg_reset_password_success',__( 'Your password has been reset.','piereg' )); # newlyAddedHookFilter
}
?>
<div id="piereg_login">
<?php if ($success != "") {
?>
<p class="piereg_message"> <?php echo $success?> </p>
<?php
} else if (isset($errors->errors['password_reset_mismatch'][0]) && !empty($errors->errors['password_reset_mismatch'][0]) ) {
?>
<p class="piereg_login_error">
<?php print_r($errors->errors['password_reset_mismatch'][0]); ?>
</p>
<?php
} else {
?>
<p class="piereg_warning"> <?php echo $warning?> </p>
<?php
}
?>
<form name="resetpassform" id="piereg_resetpassform" action="<?php echo esc_url( site_url( 'wp-login.php?action=resetpass&key=' . urlencode( $_GET['key'] ) . '&login=' . urlencode( $_GET['login'] ), 'login_post' ) ); ?>" method="post" autocomplete="off">
<input type="hidden" id="user_login" value="<?php echo esc_attr( $_GET['login'] ); ?>" autocomplete="off">
<p>
<label for="pass1">
<?php _e('New password', 'piereg'); ?>
</label>
<br />
<input type="password" name="pass1" id="pass1" class="input input_fields validate[required]" size="20" value="" autocomplete="off">
</p>
<p>
<label for="pass2">
<?php _e('Confirm new password', 'piereg'); ?>
</label>
<br />
<input type="password" name="pass2" id="pass2" class="input input_fields validate[required,equals[pass1]]" size="20" value="" autocomplete="off">
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Reset Password">
</p>
<?php
$form_links = '<p id="nav"> <a href="'.wp_login_url().'">Log in</a> | <a href="'.site_url("/wp-login.php?action=register").'">Register</a> </p>';
$form_links .= '<p id="backtoblog"><a title="Are you lost?" href="'.bloginfo("url").'?>">← Back to Pie Register</a></p>';
apply_filters( 'pie_getpassword_form_links', $form_links );
echo $form_links;
?>
</form>
</div>