XPressME Integration Kit

Trac

Changeset 843


Ignore:
Timestamp:
Oct 26, 2013, 7:49:46 PM (10 years ago)
Author:
toemon
Message:

get_currentuserinfo()の修正 fixed #427
thx miho

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php

    r830 r843  
    5454                        return xpress_login();   
    5555                } else {                                                        // For the xoops guest 
    56                         wp_set_current_user(0); 
    57                         if ( !preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']) &&  
    58                                 !preg_match("/msie/", $_SERVER['HTTP_USER_AGENT']))  
    59                         { 
    60                                 wp_logout();    // When IE is used, it becomes page error by the guest if the wp_logout() is executed here.  
     56                 
     57                        if (function_exists('wp_validate_auth_cookie')){ 
     58                                if ( ! $user = wp_validate_auth_cookie() ) { 
     59                                         if ( empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) { 
     60                                                wp_set_current_user(0); 
     61                                                return false; 
     62                                         } 
     63                                } 
     64                                wp_set_current_user($user); 
     65                        } else { // for WP2.0 
     66                                if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||  
     67                                        !wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true) ) { 
     68                                        wp_set_current_user(0); 
     69                                        return false; 
     70                                } 
     71                                $user_login = $_COOKIE[USER_COOKIE]; 
     72                                wp_set_current_user(0, $user_login); 
    6173                        } 
    6274                        return false; 
Note: See TracChangeset for help on using the changeset viewer.