Changeset 3565

Show
Ignore:
Timestamp:
02/22/06 07:30:28 (3 years ago)
Author:
ryan
Message:

Hide cookie layout behind wp_get_cookie_login() so that plugins can customize the cookies.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/pluggable-functions.php

    r3563 r3565  
    247247        header("Location: $location"); 
    248248} 
     249endif; 
     250 
     251if ( !function_exists('wp_get_cookie_login') ): 
     252function wp_get_cookie_login() { 
     253    if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ) 
     254        return false; 
     255 
     256    return array('login' => $_COOKIE[USER_COOKIE],  'password' => $_COOKIE[PASS_COOKIE]); 
     257} 
     258 
    249259endif; 
    250260 
  • trunk/wp-login.php

    r3541 r3565  
    178178        $user_pass  = $_POST['pwd']; 
    179179        $rememberme = $_POST['rememberme']; 
    180     } elseif ( !empty($_COOKIE) ) { 
    181         if ( !empty($_COOKIE[USER_COOKIE]) ) 
    182             $user_login = $_COOKIE[USER_COOKIE]; 
    183         if ( !empty($_COOKIE[PASS_COOKIE]) ) { 
    184             $user_pass = $_COOKIE[PASS_COOKIE]; 
     180    } else { 
     181        $cookie_login = wp_get_cookie_login(); 
     182        if ( ! empty($cookie_login) ) { 
    185183            $using_cookie = true; 
     184            $user_login = $cookie_login['login']; 
     185            $user_pass = $cookie_login['password']; 
    186186        } 
    187187    }