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.