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. 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
First of all, I would like to thank Plato for providing such a good free program...