Get the App
SLTechnology News&Howtos  ›  Development  › 

How to modify the discuz activation-free synchronous login code

Shulou Source: shulou.com Published: 2022-06-03 07:43:36 10月03日 Update

This article mainly introduces "how to modify discuz activation-free synchronous login code". In daily operation, I believe many people have doubts about how to modify discuz activation-free synchronous login code. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to modify discuz activation-free synchronous login code". Next, please follow the editor to study!

The copy code is as follows:

/ / Open discuz/api/uc.php

/ / synlogin method (line 180), go down and find

If (($member = getuserbyuid ($uid, 1)) {

Dsetcookie ('auth', authcode ("$member [password]\ t $membership [uid]",' ENCODE'), $cookietime))

}

/ / changed to

If (($member = getuserbyuid ($uid, 1)) {

Dsetcookie ('auth', authcode ("$member [password]\ t $membership [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 (10)). "', `email` ='{$user [2]}', `adminid` ='0', `groupid` = '10', `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 $membership [uid]",' ENCODE'), $cookietime))

}

}

}

At this point, the study on "how to modify the discuz activation-free synchronous login code" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Code activation synchronization learning methods more help practical next articles theories knowledge articles websites materials follow questions easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology vpn OPPO Reno MariaDB