XPressME Integration Kit

Trac

Changeset 293


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

Google Chrome でメタ情報・投稿者ブロック表示エラーバグ修正 fixes #159

File:
1 edited

Legend:

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

    r291 r293  
    2020        global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
    2121 
    22  
    2322        if ($xoopsModule){ 
    24                 if (!is_object($xoopsUser)){ 
    25                         wp_set_current_user(0); 
    26                         if ( !preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']) && 
    27                                          !preg_match("/msie/", $_SERVER['HTTP_USER_AGENT'])             ) { 
    28                                         wp_logout();             // When IE is used, it becomes page error by the guest if the wp_logout() is executed here.  
    29                         }                                        
    30                         return false; 
    31                 } 
    3223                if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) 
    3324                        return false; 
    3425 
    35                 if ( ! empty($current_user) ){ 
    36                         $xoops_user = $xoopsUser->getVar("uname"); 
    37                         if ($current_user->user_login == $xoops_user) 
    38                                 return; 
    39                 } 
    40  
    41                 if (check_xpress_auth_cookie()){        //The cookie is login user's or it checks it 
    42                         if ( $user = wp_validate_auth_cookie() ) { 
    43                                 if (!check_user_meta_prefix($user)){ 
    44                                         repair_user_meta_prefix(); 
     26                if (is_object($xoopsUser)){                     // When the user is logging in xoops 
     27                        if ( ! empty($current_user) ){ 
     28                                $xoops_user = $xoopsUser->getVar("uname"); 
     29                                if ($current_user->user_login == $xoops_user){  // If xoops login user and wordpress current user are the same 
     30                                        return; 
    4531                                } 
    46  
    47                                 wp_set_current_user($user); 
    48                                 return ; 
    4932                        } 
    50                 }                                
    51                 xpress_login();  
    52  
     33                        if (check_xpress_auth_cookie()){        //The cookie is login user's or it checks it 
     34                                if ( $user = wp_validate_auth_cookie() ) { 
     35                                        // When the user meta prefix is different according to the change in the xoops data base prefix, it restores it.  
     36                                        if (!check_user_meta_prefix($user)){     
     37                                                repair_user_meta_prefix(); 
     38                                        } 
     39                                        wp_set_current_user($user); 
     40                                        return ; 
     41                                } 
     42                        }                                
     43                        return xpress_login();   
     44                } else {                                                        // For the xoops guest 
     45                        if ( ! empty($current_user) ){  // When a current user of wordpress is set, a current user is cleared.  
     46                                wp_set_current_user(0); 
     47                                wp_logout(); 
     48                                wp_clear_auth_cookie(); 
     49                        } 
     50                        return false; 
     51                } 
    5352        } else { 
    5453                // WP2.7 original 
Note: See TracChangeset for help on using the changeset viewer.