Make WordPress Core

Ticket #40605: ticket#40605.patch

File ticket#40605.patch, 1.5 KB (added by pratik028, 8 years ago)

Added check-email switch case

  • src/wp-login.php

     
    391391if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
    392392        $action = 'login';
    393393
     394if ( isset($_GET['checkemail']) && $_GET['checkemail'] )
     395        $action = 'check-email';
     396
    394397nocache_headers();
    395398
    396399header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
     
    752755login_footer('user_login');
    753756break;
    754757
     758case 'check-email' :
     759   
     760        $secure_cookie = '';
     761       
     762        $redirect_to = admin_url();
     763
     764        $reauth = empty($_REQUEST['reauth']) ? false : true;
     765
     766        $user = wp_signon( array(), $secure_cookie );
     767        $errors = $user;
     768        // Clear errors if loggedout is set.
     769        if ( !empty($_GET['loggedout']) || $reauth )
     770                $errors = new WP_Error();
     771
     772        if ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
     773                $errors->add('confirm', __('Check your email for the confirmation link.'), 'message');
     774
     775        /**
     776         * Filters the login page errors.
     777         *
     778         * @since 3.6.0
     779         *
     780         * @param object $errors      WP Error object.
     781         * @param string $redirect_to Redirect destination URL.
     782         */
     783        $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
     784        login_header(__('Log In'), '', $errors);
     785
     786login_footer();
     787break;
     788   
    755789case 'login' :
    756790default:
    757791        $secure_cookie = '';