How to modify the discuz synchronous login code without activation (discuz synchronous login)

Source: Internet
Author: User
Log on to discuz directly without activation. Test version: discuz! X3, the theory also supports 2.5. Let's test it again.

Log on to discuz directly without activation. Test version: discuz! X3, the theory also supports 2.5. Let's test it again.

The Code is as follows:


// Open discuz/api/uc. php
// At the synlogin method (Row 1), locate it.
If ($ member = getuserbyuid ($ uid, 1 ))){
Dsetcookie ('auth', authcode ("$ member [password] \ t $ member [uid]", 'encoding'), $ cookietime );
}


// Change
If ($ member = getuserbyuid ($ uid, 1 ))){
Dsetcookie ('auth', authcode ("$ member [password] \ t $ member [uid]", 'encoding'), $ cookietime );
} Else {
If (! Function_exists ('uc _ get_user ')){
Loaducenter ();
}
$ User = uc_get_user ($ uid, 1 );
If ($ user ){
$ Time = time ();
DB: query ("replace ". 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' = '20150 '");
DB: query ("replace ". 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 ". DB: table ('common _ member_count '). "SET 'uid' = '{$ user [0]}', 'extcredits1' = '0', 'extcredits2' = '0', 'extcredits3' = '0 ', 'extcredits4 '= '0', 'extcredits5' = '0', 'extcredits6 '= '0', 'extcredits7' = '0 ', 'extcreditss' = '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 ('ymmd', $ time ). "'");
If ($ member = getuserbyuid ($ uid, 1 ))){
Dsetcookie ('auth', authcode ("$ member [password] \ t $ member [uid]", 'encoding'), $ cookietime );
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.