Use the discuz built-in pass to integrate the dedecms method and File Download

Source: Internet
Author: User

Integrate discuz pass: Use discuz's built-in pass to integrate the dede method and File Download

First of all, thanks to Plato for providing such a good free program
On the forum, we can see that many people want to integrate discuz. I think plato will surely get a perfect dede pass.
We should use the PASS provided by discuz before it comes out. I have read it very well.
I. Prerequisites and versions:
Dede version: 3.1 ultimate version, 3.1 Official version passed the test
Discuz version. The latest 5.0 version is used.
Ii. Mainly involves several files
1: dede:
(1) include/config_passport.php
The private key of the pass. This is security-related and must be set in the same way as the two systems.
Here is mainly $ pai_pp_encode. Suppose it is set to $ pai_pp_encode = 'ufjdq4089s'
(2) member/index_do.php mainly processes synchronous login, synchronous registration, and synchronous logout with discuz
As for the member's synchronous modification (mainly password and email), the pass mechanism has been used for Synchronous login. So what should we do without password synchronization?
(3) Add the file zxwpassport. php
It mainly sets the synchronous discuz switch and related processing functions for synchronization.
Note: The jump address here can be modified based on your test or actual address.
For example, Location: http: // localhost/discuz/api/passport. php
Change to your Location: http: // localhost/bbs/api/passport. php
$ Forward = 'HTTP: // localhost/member/index. php ';
Changed to yours
$ Forward = 'HTTP: // www.aaa.com/member/index.php ';

2: discuz
(1) set discuz pass in the system background management
Set in extended settings-pass settings

= 700) window. open ('HTTP: // www.bkjia.com/uploads/allianc131016/053j54095-0.gif'); "src =" http://www.bkjia.com/uploads/allimg/131016/053J54095-0.gif "width = 700 onload =" if (this. width> '200') this. width = '000000'; "border = 0>
Note that the dede logon, Member registration, and member exit addresses are set here.
The key is to set the private key of the Pass. Remember to keep it consistent with dede. Refer to dede's include/config_passport.php configuration. Assume UfJDq4089S.

After reading this. Download zxwpassport. php and the modified index_do.php. Put in
The member/directory is OK. Here, index_do.php only adds the discuz synchronization processing, which is actually very simple.
For example. Synchronous login is generally done by adding the following statement. Only one email is added during login.
CODE:
$ Row = $ dsql-> GetOne ("select email from dede_member where ID = '". $ pai_ml-> M_ID ."'");
$ Dedeemail = $ row ['email '];
$ Dsql-> Close ();
// Start synchronous login with the discuz Forum
If ($ pai_discuz = 1)
{
Discuzlogin ($ userid, $ pwd, $ dedeemail );
} // $ Pai_discuz = 1
// Synchronous login with the disuz Forum ends
[Copy to clipboard]
Finally, remember to go to the zxwpassport. php function processing. Set your own revolving address:
Location: http: // localhost/bbs/api/passport. php
$ Forward = 'HTTP: // localhost/member/index. php ';

Of course, it can also be written to the configuration file. But I am too lazy to write. Let's do it by yourself. Very simple

The zxwpassport.php and index_do.php files are packaged into the passport.rar file.
Download this file

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.