XPressME Integration Kit

Trac


Ignore:
Timestamp:
Jun 18, 2009, 12:47:28 PM (15 years ago)
Author:
toemon
Message:

Ver.2.0のブランチバグ修正結果 #158 (r291) と #159 (r293) の修正内容をマージ

File:
1 edited

Legend:

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

    r252 r294  
    2222 
    2323        if ($xoopsModule){ 
    24                 if (!is_object($xoopsUser)){ 
     24                if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) 
     25                        return false; 
     26 
     27                if (is_object($xoopsUser)){                     // When the user is logging in xoops 
     28                        if ( ! empty($current_user) ){ 
     29                                $xoops_user = $xoopsUser->getVar("uname"); 
     30                                if ($current_user->user_login == $xoops_user){  // If xoops login user and wordpress current user are the same 
     31                                        return; 
     32                                } 
     33                        } 
     34                        if (check_xpress_auth_cookie()){        //The cookie is login user's or it checks it 
     35                                if (function_exists('wp_validate_auth_cookie')){ 
     36                                        if ( $user = wp_validate_auth_cookie() ) { 
     37                                                // When the user meta prefix is different according to the change in the xoops data base prefix, it restores it.  
     38                                                if (!check_user_meta_prefix($user)){ 
     39                                                        repair_user_meta_prefix(); 
     40                                                } 
     41                                                wp_set_current_user($user); 
     42                                                return ; 
     43                                        } 
     44                                } else { // for WP2.0                                    
     45                                        if ( !empty($_COOKIE[USER_COOKIE]) && !empty($_COOKIE[PASS_COOKIE])){ 
     46                                                if(wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true) ) { 
     47                                                        $user_login = $_COOKIE[USER_COOKIE]; 
     48                                                        wp_set_current_user(0, $user_login); 
     49                                                        return; 
     50                                                } 
     51                                        } 
     52                                } 
     53                        }                                
     54                        return xpress_login();   
     55                } else {                                                        // For the xoops guest 
     56                        if ( ! empty($current_user) ){  // When a current user of wordpress is set, a current user is cleared.  
    2557                                wp_set_current_user(0); 
    26                                 wp_clearcookie(); 
    27  
    28 //                              wp_logout();             // When IE is used, it becomes page error by the guest if the wp_logout() is executed here.  
    29                                 return false; 
    30                 } 
    31                 if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) 
    32                         return false; 
    33  
    34                 if ( ! empty($current_user) ){ 
    35                         $xoops_user = $xoopsUser->getVar("uname"); 
    36                         if ($current_user->user_login == $xoops_user) 
    37                                 return; 
    38                 } 
    39  
    40                 if (check_xpress_auth_cookie()){        //The cookie is login user's or it checks it 
    41                         if ( $user = wp_validate_auth_cookie() ) { 
    42                                 if (!check_user_meta_prefix($user)){ 
    43                                         repair_user_meta_prefix(); 
    44                                 } 
    45  
    46                                 wp_set_current_user($user); 
    47                                 return ; 
    48                         } 
    49                 }                                
    50                 xpress_login();  
    51  
     58                                wp_logout(); 
     59                                wp_clear_auth_cookie(); 
     60                        } 
     61                        return false; 
     62                } 
    5263        } else { 
    5364                // WP original 
     
    103114                } 
    104115        } 
    105         wp_set_current_user(0); 
    106         wp_clearcookie(); 
    107         return 0; 
     116        if ( ! empty($current_user) ){ 
     117                wp_set_current_user(0); 
     118                wp_logout(); 
     119                wp_clear_auth_cookie(); 
     120        } 
     121        return false; 
    108122} 
    109123endif; 
     
    270284        @setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 
    271285        @setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 
     286 
    272287} 
    273288endif; 
Note: See TracChangeset for help on using the changeset viewer.