- Timestamp:
- Jun 18, 2009, 12:47:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php
r252 r294 22 22 23 23 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. 25 57 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 } 52 63 } else { 53 64 // WP original … … 103 114 } 104 115 } 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; 108 122 } 109 123 endif; … … 270 284 @setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 271 285 @setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 286 272 287 } 273 288 endif;
Note: See TracChangeset
for help on using the changeset viewer.