mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +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:
@ -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)
|
||||
|
Reference in New Issue
Block a user