function process_form()
 {
     if (empty($_GET['action']) || 'rp' != $_GET['action'] || empty($_GET['key']) || empty($_GET['login'])) {
         return;
     }
     $user = $this->check_password_reset_key($_GET['key'], $_GET['login']);
     if (is_wp_error($user)) {
         $url = appthemes_get_password_recovery_url('redirect');
         $url = add_query_arg(array('action' => 'lostpassword', 'invalidkeyerror' => '1'), $url);
         wp_redirect($url);
         exit;
     } else {
         $this->error = $user;
     }
     if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
         $this->error = new WP_Error('password_reset_mismatch', __('The passwords do not match.', APP_TD));
     } elseif (isset($_POST['pass1']) && !empty($_POST['pass1'])) {
         $this->reset_password($user, $_POST['pass1']);
         $url = APP_Login::get_url('redirect');
         $url = add_query_arg(array('action' => 'lostpassword', 'success' => '1'), $url);
         wp_redirect($url);
         exit;
     }
 }
示例#2
0
<form action="<?php 
echo appthemes_get_password_recovery_url('login_post');
?>
" method="post" class="login-form password-recovery-form" name="lostpassform" id="login-form">

	<p><?php 
_e('Please enter your username or email address. A new password will be emailed to you.', APP_TD);
?>
</p>

	<fieldset>

		<div class="form-field">
			<label>
				<?php 
_e('Username or Email:', APP_TD);
?>
				<input type="text" class="text required" name="user_login" tabindex="2" id="login_username" />
			</label>
		</div>

		<?php 
do_action('lostpassword_form');
?>

		<div class="form-field">
			<input tabindex="3" type="submit" id="lostpass" name="lostpass" value="<?php 
_e('Reset Password', APP_TD);
?>
" />
		</div>
示例#3
0
<form action="<?php 
echo appthemes_get_password_recovery_url();
?>
" method="post" class="login-form password-recovery-form" name="lostpassform" id="login-form">

	<p><?php 
_e('Please enter your username or email address. A new password will be emailed to you.', APP_TD);
?>
</p>

	<fieldset>

		<div class="form-field">
			<label>
				<?php 
_e('Username or Email:', APP_TD);
?>
				<input type="text" class="text required" name="user_login" tabindex="1" id="login_username" />
			</label>
		</div>

		<?php 
do_action('lostpassword_form');
?>

		<div class="form-field">
			<input tabindex="2" type="submit" id="lostpass" name="lostpass" value="<?php 
_e('Reset Password', APP_TD);
?>
" />
			<?php