Fix import from phpBB 3.1

This commit is contained in:
Gerhard Schlager 2016-05-07 23:35:48 +02:00
parent 9741584ae8
commit 1eaaa97849

View File

@ -4,7 +4,7 @@ require_relative '../support/constants'
module ImportScripts::PhpBB3 module ImportScripts::PhpBB3
class Database_3_1 < Database_3_0 class Database_3_1 < Database_3_0
def fetch_users(last_user_id) def fetch_users(last_user_id)
query(<<-SQL) query(<<-SQL, :user_id)
SELECT u.user_id, u.user_email, u.username, SELECT u.user_id, u.user_email, u.username,
CASE WHEN u.user_password LIKE '$2y$%' CASE WHEN u.user_password LIKE '$2y$%'
THEN CONCAT('$2a$', SUBSTRING(u.user_password, 5)) THEN CONCAT('$2a$', SUBSTRING(u.user_password, 5))
@ -21,7 +21,7 @@ module ImportScripts::PhpBB3
(b.ban_end = 0 OR b.ban_end >= UNIX_TIMESTAMP()) (b.ban_end = 0 OR b.ban_end >= UNIX_TIMESTAMP())
) )
WHERE u.user_id > #{last_user_id} AND u.user_type != #{Constants::USER_TYPE_IGNORE} WHERE u.user_id > #{last_user_id} AND u.user_type != #{Constants::USER_TYPE_IGNORE}
ORDER BY u.user_id ASC ORDER BY u.user_id
LIMIT #{@batch_size} LIMIT #{@batch_size}
SQL SQL
end end