Changeset 23805 for trunk/wp-login.php
- Timestamp:
- 03/27/2013 08:43:11 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-login.php
r23691 r23805 49 49 50 50 // Shake it! 51 $shake_error_codes = array( ' empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );51 $shake_error_codes = array( 'interim_login_error', 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); 52 52 $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); 53 53 54 if ( ! $interim_login &&$shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )54 if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) 55 55 add_action( 'login_head', 'wp_shake_js', 12 ); 56 56 … … 101 101 $login_header_url = '#'; 102 102 $classes[] = 'interim-login'; 103 ?> 104 <style type="text/css">html{background-color: transparent;}</style> 105 <?php 106 107 if ( 'success' === $interim_login ) 108 $classes[] = 'interim-login-success'; 103 109 } 104 110 … … 625 631 if ( $interim_login ) { 626 632 $message = '<p class="message">' . __('You have logged in successfully.') . '</p>'; 633 $interim_login = 'success'; 627 634 login_header( '', $message ); ?> 628 635 </div> … … 649 656 650 657 $errors = $user; 651 // Clear errors if loggedout or interim_loginis set.652 if ( !empty($_GET['loggedout']) || $reauth || $interim_login)658 // Clear errors if loggedout is set. 659 if ( !empty($_GET['loggedout']) || $reauth ) 653 660 $errors = new WP_Error(); 654 661 … … 657 664 $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.")); 658 665 659 // Some parts of this script use the main login form to display a message 660 if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) 661 $errors->add('loggedout', __('You are now logged out.'), 'message'); 662 elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) 663 $errors->add('registerdisabled', __('User registration is currently not allowed.')); 664 elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) 665 $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); 666 elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) 667 $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); 668 elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) 669 $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); 670 elseif ( $interim_login ) 671 $errors->add('expired', __('Please log in again. You will not move away from this page.'), 'message'); 672 elseif ( strpos( $redirect_to, 'about.php?updated' ) ) 673 $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' ); 666 // Clear most errors if interim login 667 if ( $interim_login ) { 668 $error_code = $errors->get_error_code(); 669 $errors = new WP_Error(); 670 671 if ( $error_code ) { 672 if ( in_array( $error_code, array( 'empty_password', 'empty_username', 'invalid_username', 'incorrect_password' ) ) ) 673 $errors->add('interim_login_error', __('<strong>ERROR</strong>: Invalid username or password.')); 674 else 675 $errors->add('interim_login_error_other', sprintf( __( '<strong>ERROR</strong>: Please contact the site administrator or try to <a href="%s" target="_blank">log in from a new window</a>.' ), wp_login_url() ) ); 676 } else { 677 $errors->add('expired', __('Session expired. Please log in again. You will not move away from this page.'), 'message'); 678 } 679 } else { 680 // Some parts of this script use the main login form to display a message 681 if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) 682 $errors->add('loggedout', __('You are now logged out.'), 'message'); 683 elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) 684 $errors->add('registerdisabled', __('User registration is currently not allowed.')); 685 elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) 686 $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); 687 elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) 688 $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); 689 elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) 690 $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); 691 elseif ( strpos( $redirect_to, 'about.php?updated' ) ) 692 $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' ); 693 } 674 694 675 695 // Clear any stale cookies.
Note: See TracChangeset
for help on using the changeset viewer.