mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Adds support for importing password hashes used by "migratepassword" plugin
Adds setting to phpBB3 importer for importing passwords (default: off) Plugin: https://github.com/discoursehosting/discourse-migratepassword
This commit is contained in:
parent
676416f478
commit
8c03dd16af
6 changed files with 15 additions and 2 deletions
|
@ -273,6 +273,7 @@ class ImportScripts::Base
|
|||
u.custom_fields["import_id"] = import_id
|
||||
u.custom_fields["import_username"] = opts[:username] if opts[:username].present?
|
||||
u.custom_fields["import_avatar_url"] = avatar_url if avatar_url.present?
|
||||
u.custom_fields["import_pass"] = opts[:password] if opts[:password].present?
|
||||
|
||||
begin
|
||||
User.transaction do
|
||||
|
@ -284,6 +285,10 @@ class ImportScripts::Base
|
|||
u.user_profile.save!
|
||||
end
|
||||
end
|
||||
|
||||
if opts[:active] && opts[:password].present?
|
||||
u.activate
|
||||
end
|
||||
rescue
|
||||
# try based on email
|
||||
existing = User.find_by(email: opts[:email].downcase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue