WordPress.org

Make WordPress Core

Ticket #16318: 16318-alt.diff

File 16318-alt.diff, 2.7 KB (added by stephdau, 11 years ago)
  • wp-login.php

     
    411411        </p>
    412412<?php do_action('lostpassword_form'); ?>
    413413        <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    414         <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p>
     414        <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Email Password Reset Link'); ?>" tabindex="100" /></p>
    415415</form>
    416416
    417417<p id="nav">
     
    440440                $errors = new WP_Error('password_reset_mismatch', __('The passwords do not match.'));
    441441        } elseif ( isset($_POST['pass1']) && !empty($_POST['pass1']) ) {
    442442                reset_password($user, $_POST['pass1']);
    443                 login_header(__('Password Reset'), '<p class="message reset-pass">' . __('Your password has been reset.') . ' <a href="' . site_url('wp-login.php', 'login') . '">' . __('Log in') . '</a></p>');
    444                 login_footer();
     443                wp_safe_redirect( 'wp-login.php?passwordresetcomplete=true' );
    445444                exit;
    446445        }
    447446
     
    616615                $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
    617616        elseif  ( $interim_login )
    618617                $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');
     618        elseif  ( isset($_GET['passwordresetcomplete']) && 'true' == $_GET['passwordresetcomplete'] )
     619                $errors->add('newpass', __('Your password has been reset.'), 'message');
    619620
    620621        // Clear any stale cookies.
    621622        if ( $reauth )
     
    626627        if ( isset($_POST['log']) )
    627628                $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : '';
    628629        $rememberme = ! empty( $_POST['rememberme'] );
     630       
     631if ( ! isset($_GET['checkemail']) || ! in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) :
    629632?>
    630633
    631634<form name="loginform" id="loginform" action="<?php echo site_url('wp-login.php', 'login_post') ?>" method="post">
     
    650653        </p>
    651654</form>
    652655
    653 <?php if ( !$interim_login ) { ?>
     656<?php
     657endif;
     658if ( !$interim_login ) {
     659?>
    654660<p id="nav">
    655661<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
     662<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Login') ?></a>
    656663<?php elseif ( get_option('users_can_register') ) : ?>
    657664<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
    658665<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>