WordPress.org

Make WordPress Core

Ticket #14949: 14949-current-user-can-not-login-before-logout.patch

File 14949-current-user-can-not-login-before-logout.patch, 679 bytes (added by hakre, 4 years ago)

Prevents a signon for a user that is already logged in.

  • wp-login.php

     
    531531        if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) 
    532532                $secure_cookie = false; 
    533533 
    534         $user = wp_signon('', $secure_cookie); 
     534        if ( is_user_logged_in() ) { 
     535                $user = wp_get_current_user(); 
     536        } else { 
     537                $user = wp_signon('', $secure_cookie); 
     538        } 
    535539 
    536540        $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user); 
    537541