Discuz activation-free synchronous login code modification method (discuz synchronous login) _ PHP Tutorial

Source: Internet
Author: User
Discuz does not activate synchronous login code modification method (discuz synchronous login ). Copy the code as follows: open discuzapiuc. at the phpsynlogin method (row 180), find if ($ membergetuserbyuid ($ uid, 1) {dsetcookie (auth, authcode ($ member [pas The code is as follows:


// Open discuz/api/uc. php
// Locate the synlogin method (row 1) and 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 );
}
}
}

The http://www.bkjia.com/PHPjc/621671.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/621671.htmlTechArticle code is as follows: // open discuz/api/uc. php // synlogin method (row 180), locate if ($ member = getuserbyuid ($ uid, 1) {dsetcookie ('auth ', authcode ("$ member [pas...

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.