Discuz forum user login background program code _ php instance

Source: Internet
Author: User
The discuz Forum program is not readable and dizzy. in order to integrate forum and website data, you have to read it again. fortunately, you can use a small method to synchronize with the forum after logging on here. you do not need the passport interface.
This is my data for reference only.
Log on and pass two values (username and password );

The code is as follows:

 Result ($ db-> query ("SELECT count (*) FROM {$ tablepre} failedlogins WHERE ip = '$ onlineip' AND count> =' $ seccodedata [loginfailedcount] 'AND $ timestamp-lastupdate <= 900 "), 0 );} $ discuz_uid = 0; $ discuz_user = $ discuz_pw = $ discuz_secques = $ md5_password = ''; $ member = array (); $ loginperm = logincheck (); if (! $ Loginperm) {showmessage ('login _ strike');} $ secques = quescrypt ($ questionid, $ answer); if (isset ($ loginauth )) {$ field = 'username'; $ password = 'verified '; list ($ username, $ md5_password) = daddslashes (explode ("\ t", authcode ($ loginauth, 'decodecode'), 1);} else {$ md5_password = md5 ($ password); $ password = preg_replace ("/^ (. {". round (strlen ($ password)/4 ). "})(. + ?) (. {". Round (strlen ($ password)/6 ). "}) $/s", "\ 1 *** \ 3", $ password);} $ query = $ db-> query ("SELECT m. uid AS discuz_uid, m. username AS discuz_user, m. password AS discuz_pw, m. secques AS discuz_secques, m. adminid, m. groupid, m. styleid AS styleidmem, m. lastvisit, m. lastpost, u. allowinvisible FROM {$ tablepre} members m left join {$ tablepre} usergroups u USING (groupid) WHERE m. $ field = '$ username' "); $ membe R = $ db-> fetch_array ($ query); // Determine whether the logon is correct if ($ member ['password']! = $ Md5_password) {echo "the user name or password you entered is incorrect! "; Exit () ;}// execute the following program extract ($ member); $ discuz_userss = $ discuz_user; $ discuz_user = addslashes ($ discuz_user ); if ($ allowinvisible & $ loginmode = 'invisable') | $ loginmode = 'normal ') {$ db-> query ("UPDATE {$ tablepre} members SET invisible = '". ($ loginmode = 'invisable '? 1: 0 ). "'Where uid = '$ member [discuz_uid]'", 'unbuffered');} $ styleid = intval (empty ($ _ POST ['styleid'])? ($ Styleidmem? $ Styleidmem: $ _ DCACHE ['Settings'] ['styleid']): $ _ POST ['styleid']); $ cookietime = intval (isset ($ _ POST ['cookietime'])? $ _ POST ['cookietime']: ($ _ DCOOKIE ['cookietime']? $ _ DCOOKIE ['cookietime']: 0); dsetcookie ('cookietime', $ cookietime, 31536000); dsetcookie ('auth ', authcode ("$ discuz_pw \ t $ discuz_secques \ t $ discuz_uid", 'encoding'), $ cookietime); $ sessionexists = 0; updatesession (); // update the Forum USERPASS data echo "{'action': 'ture '}"; // the data to be output is print_r ($ _ DSESSION ); echo $ discuz_userss;}?>

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.