Ucenter integration of external sites, to achieve login and other operations

Source: Internet
Author: User
Tags vars

Recently the company's website to the mobile version, because with the forum to have interoperability, to achieve the sharing of members, because of Discuz unfamiliar, at first consider is directly read Discuz user table, and then make judgments and other operations, found too complex, and security is not good.

A period of time before the integration of the forum and the Mall, the use of the book Ucenter for integration, it is convenient, not only can realize the integration of users, but also to achieve integration interchange and other operations, but this integration is already in both the system has been pre-set, more convenient. It is very convenient to apply Ucenter to any custom Web site outside, in fact Ucenter has this powerful ability

When I was in a test environment built in this machine, I discuz! X2 Release 20111221; ucenter 1.6.0 Release 20110501;

Communication with Ecshop has been achieved.

Now we download a Ucenter full package we see there's advanced,advanced in there. This is an excuse for the documentation, example this is an example, uc_client this is the client.

We're now adding new apps to the Ucenter.


Application Type Select other

option to fill in with your own case, where the main URL of the application is the root of your home directory, which is Http://localhost/root

After submission there will be Ucenter configuration information for the application


I copied the examples into the Uctest directory and copied the uc_client to the examples directory.

Modify the contents of a config.inc.php file


Here is the contents of my configuration file


  1. <?php
  2. Define (' Uc_connect ', ' MySQL '); //Connection ucenter: Mysql/null, default is empty when Fscoketopen ()
  3. //MySQL is a directly connected database, for efficiency, it is recommended to use MySQL
  4. Database dependent (when MySQL is connected and no uc_dblink is set, the following variables need to be configured)
  5. Define (' uc_dbhost ', ' localhost '); //Ucenter Database host
  6. Define (' Uc_dbuser ', ' root '); //Ucenter database user name
  7. Define (' UC_DBPW ', ' 123456 '); //Ucenter database password
  8. Define (' uc_dbname ', ' discuz '); //Ucenter database name
  9. Define (' Uc_dbcharset ', ' GBK '); //Ucenter database Character set
  10. Define (' uc_dbtablepre ', ' discuz '. Pre_ucenter_ '); //Ucenter database table prefix
  11. Communication-related
  12. Define (' Uc_key ', ' example2 '); //Communication key with Ucenter, to be consistent with Ucenter
  13. Define (' Uc_api ', ' http://localhost/discuz/uc_server '); Ucenter URL address, which is dependent on this constant when calling the Avatar
  14. Define (' Uc_charset ', ' GBK '); //Ucenter's character set
  15. Define (' uc_ip ', '); ///Ucenter IP, set this value when Uc_connect is not in MySQL mode and the current application server resolves a domain name problem
  16. Define (' Uc_appid ', 3); //ID of the current app
  17. Application database connection parameters used by ucexample_2.php
  18. $dbhost = ' localhost '; //Database server
  19. $dbuser = ' root '; //database user name
  20. $DBPW = ' 123456 '; //Database password
  21. $dbname = ' ps_example '; //Database name
  22. $pconnect = 0; //Database Persistent connection 0 = off, 1 = open
  23. $tablepre = ' Example_ '; //table name prefix, the same database installation of multiple forums please modify here
  24. $dbcharset = ' GBK '; //MySQL character set, optional ' GBK ', ' big5 ', ' utf8 ', ' latin1 ', left blank for set according to forum character set
  25. Sync Login Cookie Settings
  26. $cookiedomain = "; //Cookie scope
  27. $cookiepath = '/'; //Cookie action path
  28. ?>


Many of these information if not filled, can be re-ucenter the application's ucenter configuration information:

Found in,

This will show ucenter the corresponding application communication is successful, the specific interface how to use see Example and document instructions



Ucenter integration of external sites, to achieve login and other operations

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.