Changeset 69 for trunk/include/pluggable-override.php
- Timestamp:
- Jan 27, 2009, 8:52:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/pluggable-override.php
r65 r69 19 19 global $current_user; 20 20 21 if (is_root_index_page_call()){22 if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST )23 return false;24 21 25 if ( ! empty($current_user))26 return;22 if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) 23 return false; 27 24 28 if (check_xpress_auth_cookie()){ 25 if ( ! empty($current_user) ) 26 return; 27 28 if (is_xpress_index_page_call()){ 29 if (check_xpress_auth_cookie()){ //The cookie is login user's or it checks it 29 30 if ( $user = wp_validate_auth_cookie() ) { 30 31 wp_set_current_user($user); … … 33 34 } 34 35 xpress_login(); 35 }else { 36 37 } else { 36 38 // WP2.7 original 37 39 if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) … … 60 62 $u_pass_md5 = $GLOBALS["xoopsUser"]->getVar("pass"); 61 63 if ( ! empty($u_name) && ! empty($u_pass_md5) ) { 62 // include_once dirname( __FILE__ ).'/xpress_user.php'; 63 // $mess = xpress_user_sync($GLOBALS["xoopsUser"]->getVar("uid")); 64 // if ($mess != 'NOT XPRESS USER'){ 64 include_once dirname( __FILE__ ).'/user_sync.php'; 65 $messege = ''; 66 $ret = xpress_user_sync($GLOBALS["xoopsUser"]->getVar("uid"),$messege); 67 if ($ret){ 65 68 $user = new WP_User(0, $u_name); 66 if ( wp_login($u_name, $u_pass_md5 , true) ) {69 if ( wp_login($u_name, $u_pass_md5) ) { 67 70 wp_setcookie($u_name, $u_pass_md5, true, '', '', false); 68 71 do_action('wp_login', $u_name); … … 70 73 return true; 71 74 } 72 // } 75 }else { 76 echo $messege; 77 } 73 78 } 74 79 } … … 88 93 } 89 94 90 if(is_object($GLOBALS["xoopsModule"]) && WP_BLOG_DIRNAME == $GLOBALS["xoopsModule"]->getVar("dirname")){ 95 if(is_object($GLOBALS["xoopsModule"])){ 96 // && WP_BLOG_DIRNAME == $GLOBALS["xoopsModule"]->getVar("dirname")){ 91 97 if(is_object($GLOBALS["xoopsUser"])){ 92 98 $u_name = $GLOBALS["xoopsUser"]->getVar("uname"); … … 107 113 } 108 114 109 110 /*111 112 function wp_login($username, $password, $already_md5 = false) {113 global $wpdb, $error;114 115 $username = sanitize_user($username);116 117 if ( '' == $username )118 return false;119 120 if ( '' == $password ) {121 $error = __('<strong>ERROR</strong>: The password field is empty.');122 return false;123 }124 125 $login = get_userdatabylogin($username);126 //$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");127 128 if (!$login) {129 $error = __('<strong>ERROR</strong>: Invalid username.');130 return false;131 } else {132 if ($login->user_login == $username) {133 if ($login->user_pass == $password) return true;134 if ($login->user_pass == md5($password)) return true;135 }136 137 $error = __('<strong>ERROR</strong>: Incorrect password.');138 $pwd = '';139 return false;140 }141 }142 */143 115 144 116 // for wordpress2.5 … … 177 149 } 178 150 179 180 /*181 182 function wp_mail($to, $subject, $message, $from_email="", $from_name="") {183 $xoopsMailer =& getMailer();184 $xoopsMailer->useMail();185 $xoopsMailer->setToEmails($to);186 $xoopsMailer->setFromEmail( empty($from_email) ? $GLOBALS["xoopsConfig"]['adminmail'] : $from_email);187 $xoopsMailer->setFromName( empty($from_name) ? $GLOBALS["xoopsConfig"]['sitename'] : $from_name );188 $xoopsMailer->setSubject($subject);189 $xoopsMailer->setBody($message);190 return $xoopsMailer->send();191 }192 193 */194 /*195 function auth_redirect($force = false, $message = "") {196 if(!is_object($GLOBALS["xoopsUser"])){197 header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');198 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');199 header('Cache-Control: no-cache, must-revalidate, max-age=0');200 header('Pragma: no-cache');201 202 header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));203 exit();204 }elseif(!empty($force)){205 $redirect = xoops_getenv("HTTP_REFERER");206 $redirect = (strpos($redirect, XOOPS_URL) === 0)? $redirect: XOOPS_URL."/".$redirect;207 redirect_header($redirect, 2, $message);208 }209 }210 */211 151 // *********************************** End Of Pluggable Function Edit (wp-include/pluggable.php) ************************************ 212 152
Note: See TracChangeset
for help on using the changeset viewer.