ucenter同步过程,详细解剖(同步登陆)
今天讲的是?ucenter 同步多站点登陆功能. 同步登陆关键在?uc.php 中, 这个是连通 其他连接站点的关键逻辑层. 当我们执行登陆的时候, 用的是uc 中的?uc_user_login 判断, 接下来是这个?uc_user_synlogin 同步登入, 看文档说明 他会 输出一段 javascript的脚本
今天讲的是?ucenter 同步多站点登陆功能.
同步登陆关键在?uc.php 中, 这个是连通 其他连接站点的关键逻辑层.
当我们执行登陆的时候, 用的是uc 中的?uc_user_login 判断,
接下来是这个?uc_user_synlogin 同步登入, 看文档说明
他会 输出一段 javascript的脚本, 其实是 一段URL请求, 目的是通知其他程序, 他登陆了. 在这里其实是 进入了 程序的 uc,php 中处理了.
javascript脚本中内容:?http://192.168.1.20/Discuz/api/uc.php?time=1368767786&code=18e7Mtc5TmbLWuafNA4k%2F1uSOXjqWs3%2BnszeoEDM8Y6vWC3B9epCf1rPRe0jmL4olcCE%2FjCmpmMQ8WyfbMrQdVZhxDcM%2Bvp5V0DMr%2BPljeB3nPgDZNt417uCq2gLQ3aaY94ecqdz6otkPtgwk2NMOoqr2A2MgFeQlFcnOg1D
所以我们在 uc.php写同步登陆过程: 取 ucenter文件夹中的?examples 做解释吧,
看到?$action == ‘synlogin’ 时候进入这里, ?通过 $get 来获取他 传递过来的 uid, username, password 等数据, 然后修改成. 你的程序 登陆条件. 比如设置cookie, 能判断他已经登陆的条件 就行了.
例子:
/** * 同步登陆 */ function synlogin($get, $post) { $uid = $get['uid']; $username = $get['username']; if(!API_SYNLOGIN) { return API_RETURN_FORBIDDEN; } header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); $ENCODE = _authcode($uid."\t".$username, 'ENCODE'); _setcookie('Ucenter_auth', $ENCODE); //setCookie('Ucenter_auth', $ENCODE); //$_COOKIE['Ucenter_auth'] = $ENCODE; return API_RETURN_SUCCEED; }
我这边是这样写的. 通过 cookie: ?Ucenter_auth 来判断 程序已经登陆.
到这里已经结束了. 如果不懂的.可以留言 与 我进行讨论. 谢谢大家的支持
原文地址:ucenter同步过程,详细解剖(同步登陆), 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Some players are experiencing a strange issue on PS4 or PS5 at launch. For example, this can cause distress when their PlayStation Network login fails, but their internet connection is fine. You may encounter errors when entering your login information and may not be able to join PSParty chat. If you encounter a similar problem, this guide may help you solve it. Next to PlayStationNetworkSign-in, you will see the error message ‘AnErrorHaveAreAre’ and it will say ‘Failure’. Other parameters like getting IP address, internet connection and connection speed were successful. So, what could be the problem here? I will give you a job

The AADSTS7000112 error may prevent you from logging into the app using your Microsoft account, causing you inconvenience. This article will provide you with solutions to help you resolve this issue and restore a normal login experience. Login: Sorry, you are having trouble logging in. AADSTS7000112: Application disabled. Fortunately, you can fix the error by following some simple suggestions. What is error code AADSTS7000112? Error code AADSTS7000112 indicates a problem with the connection to Microsoft's Azure Active Directory. Typically, this may be due to the Microsoft application trying to log in being blocked.

Generally speaking, we only need to use one of the headphones or speakers at the same time. However, some friends have reported that in the win11 system, they encountered the problem of headphones and speakers sounding at the same time. In fact, we can turn it off in the realtek panel and it will be fine. , let’s take a look below. What should I do if my headphones and speakers sound together in win11? 1. First find and open the "Control Panel" on the desktop. 2. Enter the control panel, find and open "Hardware and Sound" 3. Then find the "Realtek High Definition" with a speaker icon. Audio Manager" 4. Select "Speakers" and click "Rear Panel" to enter the speaker settings. 5. After opening, we can see the device type. If you want to turn off the headphones, uncheck "Headphones".

When you find that one or more items in your sync folder do not match the error message in Outlook, it may be because you updated or canceled meeting items. In this case, you will see an error message saying that your local version of the data conflicts with the remote copy. This situation usually happens in Outlook desktop application. One or more items in the folder you synced do not match. To resolve the conflict, open the projects and try the operation again. Fix One or more items in synced folders do not match Outlook error In Outlook desktop version, you may encounter issues when local calendar items conflict with the server copy. Fortunately, though, there are some simple ways to help

MySQL is a very popular open source relational database management system that is widely used in various web applications, enterprise systems, etc. In modern business application scenarios, most MySQL databases need to be deployed on multiple servers to provide higher availability and performance, which requires MySQL data migration and synchronization. This article will introduce how to implement MySQL data migration and synchronization between multiple servers. 1. MySQL data migration MySQL data migration refers to the data migration in the MySQL server.
![GeForce Experience login freezes [Fix]](https://img.php.cn/upload/article/000/887/227/171084420790568.png?x-oss-process=image/resize,m_fill,h_207,w_330)
This article will guide you to solve the GeForceExperience login crash issue on Windows 11/10. Typically, this can be caused by unstable network connections, corrupted DNS cache, outdated or corrupted graphics card drivers, etc. Fix GeForceExperience Login Black Screen Before starting, make sure to restart your internet connection and computer. Sometimes, the problem may just be due to a temporary issue. If you are still experiencing NVIDIA GeForce Experience login black screen issue, please consider taking the following suggestions: Check your internet connection Switch to another internet connection Disable your

Wegame is a software used with Tencent games. You can use it to start games and gain acceleration. Recently, many users have experienced prompts that login operations are too frequent when using it. Faced with this prompt, many users do not know How can we solve it successfully? In this software tutorial, we will share the solution with you. Let’s learn about it together. What should I do if Wegame login operations are too frequent? Method 1: 1. First, make sure our network connection is normal. (You can try opening the browser to see if you can access the Internet) 2. If it is a network failure, then try restarting the router, reconnecting the network cable, and restarting the computer to solve the problem. Method 2: 1. If there is no problem with the network, then select &

How to log in to the email address of Enterprise WeChat? You can log in to the email address in the Enterprise WeChat APP, but most users don’t know how to log in to the email address. Next is the graphic tutorial on how to log in to the email address of Enterprise WeChat brought by the editor for interested users. Come and take a look! Enterprise WeChat usage tutorial How to log in to the Enterprise WeChat email 1. First open the Enterprise WeChat APP, go to the [Workbench] at the bottom of the main page and click to come to the special area; 2. Then in the workbench area, select the [Enterprise Mailbox] service; 3. Then jump to the corporate email function page, click [Bind] or [Change Email] at the bottom; 4. Finally, enter [QQ Account] and [Password] on the page shown below to log in to the email.
