Use the discuz built-in pass to integrate the dedecms method and file download

Source: Internet
Author: User
Use the discuz built-in pass to integrate the dedecms method and file download 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: // bbs.dedecms.com/attachment/4_850_b46ed20bdd54b8a.gif'); "src =" http://bbs.dedecms.com/attachment/4_850_b46ed20bdd54b8a.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 #@__ 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.