A look.
3 Ways to solve
- Ucenter.
- Interact directly with the database.
- Impersonate a login.
1.
View the official PHP SDK only.
and only the SDK. You want to know how he works. can only see PHP source code, but do not understand PHP.
and give up.
2.
Completely unaware of his way of encrypting.
And there are more server restrictions. PASS
3.
See half found that the new requirement is that the forum registration must be canceled.
So I went back to the first plan.
Because of finding a solution, someone has already encountered this problem and solved it. If you want to see the original, click here
First of all, his principles are simple.
is the interface you access Discuz uc.php you call it.
When discuz occurs, it calls your own interface.
Of course, this interface has been set up well.
The next step is simple.
Communication between the two parties.
My needs are relatively simple.
Only need to log on to my this site, only to Discuz synchronization, discuz do not sync with me. Unilateral.
1. You need to download his project, referencing the DLL can be DS. Web.ucenter
2. In Webconfig configuration
<appSettings> <!--client version--<add key="uc_client_version"Value="1.5.2"/> <!--release time-<add key="Uc_client_release"Value="20101001"/> <!--API switch (value type: True False default: TRUE)-<!--allow Delete user--<add key="Api_deleteuser"Value="True"/> <!--allow renaming user--<add key="Api_renameuser"Value="True"/> <!--is allowed to be labeled--<add key="Api_gettag"Value="True"/> <!--allow simultaneous logins-<add key="Api_synlogin"Value="True"/> <!--allow simultaneous logout--<add key="Api_synlogout"Value="True"/> <!--allow password change--<add key="API_UPDATEPW"Value="True"/> <!--allow updates to keywords-<add key="Api_updatebadwords"Value="True"/> <!--allow update of domain name resolution Cache--<add key="api_updatehosts"Value="True"/> <!--allow update of APP list--<add key="Api_updateapps"Value="True"/> <!--allow client-side caching to be updated-<add key="api_updateclient"Value="True"/> <!--allow user credits to be updated-<add key="Api_updatecredit"Value="True"/> <!--whether to allow points set to Ucenter and <add key="api_getcreditsettings"Value="True"/> <!--whether to allow access to a user's points-<add key="Api_getcredit"Value="True"/> <!--allow app credit settings to be updated--<add key="api_updatecreditsettings"Value="True"/> <!--API switch ends--<!--return value set--<!--return success (default:1)-<add key="Api_return_succeed"Value="1"/> <!--return failure (default:-1)-<add key="api_return_failed"Value="-1"/> <!--return Disabled (default:-2)-<add key="Api_return_forbidden"Value="-2"/> <!--return value set End--<!--[Required] communication key--<add key="Uc_key"Value=""/> <!--[Required]ucenter address--<add key="Uc_api"Value=""/> <!--[Required] Default code--<add key="Uc_charset"Value="Utf-8"/> <!--[not required]ucenter ip--> <add key="uc_ip"Value=""/> <!--[Required] apply id--> <add key="Uc_appid"Value="2"/> </appSettings>
Note the required fields.
One is your forum Ucenter address.
One is the private key you interact with the forum.
Then continue to register your app in Ucenter, fill in the private key, URL, and the corresponding uc.ashx.
I am registering to complete where to add an event and then call the corresponding and Ucenter synchronization method after completion
var New ucclient (); var " @163.com ");
It's OK.
If you need two-way communication.
We need to uc.ashx the original text in detail, I will not repeat it.
He has solved my present problem.
Here's one more question.
is what to do once communication fails.
Currently recorded in the log. then manually synchronize.
Theoretically there should be a task plan. Automatically to do this thing.
But this is far away.
The task plan also involves saving the user name password in clear text. If you think about it, it hurts.
Let's do this for the time being
END
Discuz user synchronization, registration, etc.