Solution to UCenter password forgetting

Source: Internet
Author: User
Tags constant md5 php file php and php definition

UCenter passwords often go wrong. We used to use the Discuz tools plug-in to change the password. However, we need to migrate the UCenter Today. The new UCenter will not be available until the migration is complete, however, tools cannot be used, so you have to find another method.
According to online search, the founder password of UCenter is stored in "UCenter directory/data/config. inc. php ", but the information found shows that the founder's password is stored in plaintext (UCenter1.5 ?), However, the UCenter I used is already the md5 value after the salt is added, so it is difficult to process it.
Later, I read the source code and found the method for background login. The onlogin method is located in the UCenter directory/control/admin/user. php.

The Discuz architecture cannot be explained here. Although the UCenter adopts the MVC layered design, the architecture design is too simple and the code structure is very unclear. The Discuz architecture is more complicated and chaotic.

After reading, I learned that the founder's password is a constant of UC_FOUNDERPW, which is in config. inc. php definition, this constant uses md5 (md5 ($ password ). UC_FOUNDERSALT), so the processing method is very simple.
Create a php file by yourself and enter the following code:

The code is as follows: Copy code

<? Php
Echo (md5 ('New password'). 'Salt value '));

?>

The salt value can be defined by UC_FOUNDERSALT in config. inc. php, or a new value, but the value of UC_FOUNDERSALT needs to be redefined in config. in. php. After running the file, copy the output result to config. inc. php and redefine the value of UC_FOUNDERPW.
Now, the UCenter founder's password has been updated and can be logged on with the new password.
   

In fact, I used a simpler and more crude method. In my 81st rows in control/admin/user. php:

The code is as follows: Copy code

$ Md5password = md5 (md5 ($ password). UC_FOUNDERSALT );

Click the breakpoint: die ($ md5password );

Then I tried to log on with a new password. The breakpoint showed the encrypted password value, copied the password to config. inc. php, and deleted the breakpoint and logged on with the new password.

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.