


Discuz & UCenter modification notes, discuz forum_PHP tutorial
Discuz & UCenter modification notes, discuz forum
Recently, I have been reorganizing JAVA and UCENTER. Due to the needs of the project structure, I cannot completely focus on UCENTER, so during the docking process I encountered many unpleasant things. After much research, two of the big problems were finally solved, and they are now recorded for future reference.
1. Solve the problem that email must be filled in
The project does not require users to fill in their email when registering, but the UCENTER API requires that they enter their email to pass the verification. As a last resort, the UCENTER code must be modified to bypass it. The following is the changed code:
/uc_server/control/user.php line 69:
<span>1</span> <span>//</span><span> NOTE: 解决email必须填写的问题 </span><span>2</span> <span>//if(($status = $this->_check_email($email)) < 0) { </span><span>3</span> <span>// return $status; </span><span>4</span> <span>//}</span>
2. Solve the problem that users must log in to the forum manually once
Since BBS blocks DISCUZ’s own registration, login, password retrieval and other operations, single sign-on must be implemented. I encountered a very annoying problem: after the account registered on the main site is synchronized to UCENTER, UCENTER will not notify other applications, which means that by default, other applications (including DISCUZ) cannot immediately register a new user. Update user list. After careful study, I found that DISCUZ synchronizes with UCENTER only during local registration, login and other events. As a result, newly registered users on the main site cannot successfully log in to the BBS through single sign-in - because this user does not exist in the BBS at all. There are two solutions. One is that the user manually logs into the BBS once, and the BBS's own mechanism will automatically synchronize the user information from UCENTER; the other is to modify the DISCUZ system code to automatically synchronize user data when a single sign-on request is made. After weighing all factors, it was decided to adopt the second option. The following is the changed code:
/api/uc.php line 192:
<span> 1</span> <span>//</span><span> NOTE 解决用户必须手工登录1次论坛的问题</span> <span> 2</span> <span>$member</span> = getuserbyuid(<span>$uid</span>, 1<span>); </span><span> 3</span> <span> 4</span> <span>if</span> (!<span>$member</span><span>) { </span><span> 5</span> <span>$init_arr</span> = <span>explode</span>(',', <span>$_G</span>['initcredits'<span>]); </span><span> 6</span> <span>$groupid</span> = <span>$_G</span>['regverify'] ? 8 : <span>$_G</span>['newusergroupid'<span>]; </span><span> 7</span> <span> 8</span> C::t('common_member')->insert(<span>$uid</span>, <span>$get</span>['username'], <span>md5</span>(random(10)), <span>$get</span>['email'], <span>$_G</span>['clientip'], <span>$groupid</span>, <span>$init_arr</span><span>); </span><span> 9</span> <span>10</span> <span>$member</span> = getuserbyuid(<span>$uid</span>, 1<span>); </span><span>11</span> <span>} </span><span>12</span> <span>13</span> <span>if</span>(<span>$member</span><span>) { </span><span>14</span> dsetcookie('auth', authcode("<span>$member</span>[password]\t<span>$member</span>[uid]", 'ENCODE'), <span>$cookietime</span><span>); </span><span>15</span> }

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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



1. First open DingTalk. 2. Open the group chat and click the three dots in the upper right corner. 3. Find my nickname in this group. 4. Click to enter to modify and save.

Douyin Blue V certification is the official certification of a company or brand on the Douyin platform, which helps enhance brand image and credibility. With the adjustment of corporate development strategy or the update of brand image, the company may want to change the name of Douyin Blue V certification. So, can Douyin Blue V change its name? The answer is yes. This article will introduce in detail the steps to modify the name of the enterprise Douyin Blue V account. 1. Can Douyin Blue V change its name? You can change the name of Douyin Blue V account. According to Douyin’s official regulations, corporate Blue V certified accounts can apply to change their account names after meeting certain conditions. Generally speaking, enterprises need to provide relevant supporting materials, such as business licenses, organization code certificates, etc., to prove the legality and necessity of changing the name. 2. What are the steps to modify the name of corporate Douyin Blue V account?

"Detailed Explanation of Discuz Registration Process: Allowing you to easily modify personal information, specific code examples are required" Discuz is a powerful community forum program that is widely used in various websites. It provides a wealth of user registration and personal information modification. functions and interfaces. This article will introduce you to Discuz's registration process in detail and provide specific code examples to help you easily customize and modify your personal information. 1. User registration process In Discuz, user registration is one of the important functions of the site. The smoothness of the registration process and

A must-have for Discuz users! Comprehensive analysis of renaming props! In the Discuz forum, the name change function has always received much attention and demand from users. For some users who need to change their name, name change props can easily modify the user name, and this is also an interesting way of interaction. Let’s take an in-depth look at the renaming props in Discuz, including how to obtain them, how to use them, and solutions to some common problems. 1. Obtain name-changing props in Discuz. Name-changing props are usually purchased through points or the administrator

When publishing products on the Xianyu platform, users can customize the geographical location information of the product according to the actual situation, so that potential buyers can more accurately grasp the specific location of the product. Once the product is successfully put on the shelves, there is no need to worry if the seller's location changes. The Xianyu platform provides a flexible and convenient modification function. So when we want to modify the address of a published product, how do we modify it? This tutorial guide will provide you with a detailed step-by-step guide. I hope it can help. Everyone! How to modify the release product address in Xianyu? 1. Open Xianyu, click on what I published, select the product, and click Edit. 2. Click the positioning icon and select the address you want to set.

Discuz forum permission management: Read the permission setting guide In Discuz forum management, permission setting is a crucial part. Among them, the setting of reading permissions is particularly important, as it determines the scope of content that different users can see in the forum. This article will introduce in detail the reading permission settings of the Discuz forum and how to flexibly configure it for different needs. 1. Basic concepts of reading permissions In the Discuz forum, reading permissions mainly include the following concepts that need to be understood: Default reading permissions: Default after new user registration

Detailed explanation of the steps to modify the Discuz domain name. Specific code examples are required. With the development and operation of the website, sometimes we need to modify the domain name of the Discuz forum. This may be due to brand change, website SEO optimization, or other reasons. No matter what the reason is, modifying the Discuz domain name is a process that requires careful operation. Today we will introduce the steps of modifying the Discuz domain name in detail and provide specific code examples. Step 1: Back up data. Before modifying the domain name, you must first ensure that the website

Discuz Editor: An efficient post layout tool. With the development of the Internet, online forums have become an important platform for people to communicate and share information. In the forum, users can not only express their opinions and ideas, but also discuss and interact with others. When publishing a post, a clear and beautiful format can often attract more readers and convey more accurate information. In order to facilitate users to quickly type and edit posts, the Discuz editor came into being and became an efficient post typesetting tool. Discu
