Home  >  Article  >  Backend Development  >  PHP Chinese website’s compilation of points to note when using Ucenter

PHP Chinese website’s compilation of points to note when using Ucenter

PHP中文网
PHP中文网Original
2017-07-15 11:29:351811browse

Ucenter is used to achieve synchronous login of multiple projects. I believe anyone who has learned PHP has heard of this open source project. You may think that it can only be used in discuz.

It can be placed in In any project, Ucenter's synchronous login is triggered by the js mechanism.

The following are the points I have summarized that you should pay attention to when using Ucenter:

1. echo uc_user_synlogin() The previous echo cannot be missing. It must be before thisrequireTwo files client.php and uc_config.php
2. Configuration constants may be repeatedly defined and locked, causing the defined constants to be invalid.
3. if(count($_CACHE['apps'] ) > 1 || 1==1) { Block this condition
4. require_once $_SERVER['DOCUMENT_ROOT']."/u_db.class.php" ; Class names may conflict, change the name
5. Customize the synlogin and synlogout methods in the uc_note class to implement synchronization operations
6. Copy configuration items directly from the Ucenter background
7. All background applications must communicate successfully, Main url+/api/+interface program file When the api file outputs 1, the background shows successful communication
8. The interface call passes the parameters to the api file through $_GET['code'], and calls the corresponding function in the uc_note class according to the parameters. Method,
code is parsed out
array (
'action' => 'synlogin',
'username' => 'admin',
'uid ' => '1',
'password' => '92164eb6de4223316d1a804f46b2af47',
'time' => '1423576805',
)
time determines whether it expires, and action determines whetherExit Or log in or something else

This article is for reference only, if you don’t like it, don’t spray it~~~~~

This article is provided by php Chinese website,

Article address: http://www.php.cn/php-weizijiaocheng-374264.html

Please do not reprint~~~~

The above is the detailed content of PHP Chinese website’s compilation of points to note when using Ucenter. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn