Copy Code code as follows:
Open discuz/api/uc.php
Synlogin method (180 lines), find it down.
if (($member = Getuserbyuid ($uid, 1))) {
Dsetcookie (' auth ', Authcode ("$member [Password]\t$member[uid]", ' ENCODE '), $cookietime);
}
To
if (($member = Getuserbyuid ($uid, 1))) {
Dsetcookie (' auth ', Authcode ("$member [Password]\t$member[uid]", ' ENCODE '), $cookietime);
} else {
if (!function_exists (' Uc_get_user ')) {
Loaducenter ();
}
$user = Uc_get_user ($uid, 1);
if ($user) {
$time = time ();
Db::query ("REPLACE into".) Db::table (' Common_member '). " SET ' uid ' = ' {$user [0]} ', ' username ' = ' {$user [1]} ', ' password ' = '. MD5 (random). "', ' email ' = ' {$user [2]} ', ' Adminid ' = ' 0 ', ' groupid ' = ' ten ', ' regdate ' = ' {$time} ', ' emailstatus ' = ' 0 ', ' credits ' = ' 0 ', ' timeoffset ' = ' 9999 ' ');
Db::query ("REPLACE into".) Db::table (' Common_member_status '). " SET ' uid ' = ' {$user [0]} ', ' regip ' = ' {$_g[' clientip ']} ', ' lastip ' = ' {$_g[' clientip ']} ', ' lastvisit ' = ' {$time} ', ' LastActivity ' = ', ' lastpost ' = ' 0 ', ' lastsendmail ' = ' 0 ' ");
Db::query ("REPLACE into".) Db::table (' Common_member_count '). " SET ' uid ' = ' {$user [0]} ', ' extcredits1 ' = ' 0 ', ' extcredits2 ' = ' 0 ', ' extcredits3 ' = ' 0 ', ' extcredits4 ' = ' 0 ', ' extcredits5 ' = ' 0 ' ', ' extcredits6 ' = ' 0 ', ' extcredits7 ' = ' 0 ', ' extcredits8 ' = ' 0 ');
Db::query ("REPLACE into".) Db::table (' Common_member_profile '). " SET ' uid ' = ' {$user [0]} ' ");
Db::query ("REPLACE into".) Db::table (' Common_member_field_forum '). " SET ' uid ' = ' {$user [0]} ' ");
Db::query ("REPLACE into".) Db::table (' Common_member_field_home '). " SET ' uid ' = ' {$user [0]} ' ");
Db::query ("UPDATE"). Db::table (' Common_stat '). " SET ' register ' = ' register ' +1 WHERE ' daytime ' = '. Date (' Ymd ', $time).
if (($member = Getuserbyuid ($uid, 1))) {
Dsetcookie (' auth ', Authcode ("$member [Password]\t$member[uid]", ' ENCODE '), $cookietime);
}
}
}