feat: User data sanitization — clear passwords in backup + mass password reset on restore #129
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two related features for secure site cloning/migration:
Part 1: Sanitize user passwords in backup
Profile option: "Sanitize User Data" (checkbox)
When enabled, the database dump replaces all user password hashes in
#__userswith a known invalid hash (e.g.,$2y$10$SANITIZED...). This means:Part 2: Mass password reset on restore
The MokoRestore wizard gets a new step: "Reset User Passwords"
When restoring a sanitized backup:
com_userspassword reset token systemProfile Form
Add to the General or Archive fieldset:
Database Dumper Changes
In
DatabaseDumper::dumpToFile()/dump(), when writing#__usersrows:passwordcolumn with a fixed sanitized valueidmatches the super admin user groupMokoRestore Changes
In the generated restore script:
#__usersUsersModelReset::processResetRequest()Files
forms/profile.xml— sanitize_passwords checkboxsql/install.mysql.sql+ migration — new columnsrc/Engine/DatabaseDumper.php— password replacement logicsrc/Engine/MokoRestore.php— password reset step in generated script