mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: properly import vBulletin's hashed password
This commit is contained in:
parent
5f2fb0fe33
commit
53aa0344bf
@ -126,8 +126,15 @@ EOM
|
|||||||
|
|
||||||
batches(BATCH_SIZE) do |offset|
|
batches(BATCH_SIZE) do |offset|
|
||||||
users = mysql_query(<<-SQL
|
users = mysql_query(<<-SQL
|
||||||
SELECT userid, username, homepage, usertitle, usergroupid, joindate, email,
|
SELECT userid
|
||||||
CONCAT(password, ':', salt) AS crypted_password
|
, username
|
||||||
|
, homepage
|
||||||
|
, usertitle
|
||||||
|
, usergroupid
|
||||||
|
, joindate
|
||||||
|
, email
|
||||||
|
, password
|
||||||
|
, salt
|
||||||
FROM #{TABLE_PREFIX}user
|
FROM #{TABLE_PREFIX}user
|
||||||
WHERE userid > #{last_user_id}
|
WHERE userid > #{last_user_id}
|
||||||
ORDER BY userid
|
ORDER BY userid
|
||||||
@ -145,13 +152,15 @@ EOM
|
|||||||
email = user["email"].presence || fake_email
|
email = user["email"].presence || fake_email
|
||||||
email = fake_email unless email[EmailValidator.email_regex]
|
email = fake_email unless email[EmailValidator.email_regex]
|
||||||
|
|
||||||
|
password = [user["password"].presence, user["salt"].presence].compact.join(":")
|
||||||
|
|
||||||
username = @htmlentities.decode(user["username"]).strip
|
username = @htmlentities.decode(user["username"]).strip
|
||||||
|
|
||||||
{
|
{
|
||||||
id: user["userid"],
|
id: user["userid"],
|
||||||
name: username,
|
name: username,
|
||||||
username: username,
|
username: username,
|
||||||
password: user["crypted_password"],
|
password: password,
|
||||||
email: email,
|
email: email,
|
||||||
website: user["homepage"].strip,
|
website: user["homepage"].strip,
|
||||||
title: @htmlentities.decode(user["usertitle"]).strip,
|
title: @htmlentities.decode(user["usertitle"]).strip,
|
||||||
|
Loading…
Reference in New Issue
Block a user