don't import data only available in a plugin in phpBB 3 importer

This commit is contained in:
Régis Hanol 2018-03-17 00:36:12 +01:00
parent 89f5c90ce0
commit dad1e4b17d
2 changed files with 2 additions and 4 deletions

View File

@ -15,15 +15,13 @@ module ImportScripts::PhpBB3
query(<<-SQL, :user_id)
SELECT u.user_id, u.user_email, u.username, u.user_password, u.user_regdate, u.user_lastvisit, u.user_ip,
u.user_type, u.user_inactive_reason, g.group_name, b.ban_start, b.ban_end, b.ban_reason,
u.user_posts, u.user_website, u.user_from, u.user_birthday, u.user_avatar_type, u.user_avatar,
CONCAT_WS(' ', pfd.pf_firstname, pfd.pf_lastname) name
u.user_posts, u.user_website, u.user_from, u.user_birthday, u.user_avatar_type, u.user_avatar
FROM #{@table_prefix}users u
LEFT OUTER JOIN #{@table_prefix}groups g ON (g.group_id = u.group_id)
LEFT OUTER JOIN #{@table_prefix}banlist b ON (
u.user_id = b.ban_userid AND b.ban_exclude = 0 AND
(b.ban_end = 0 OR b.ban_end >= UNIX_TIMESTAMP())
)
LEFT OUTER JOIN #{@table_prefix}profile_fields_data pfd ON (pfd.user_id = u.user_id)
WHERE u.user_id > #{last_user_id} AND u.user_type != #{Constants::USER_TYPE_IGNORE}
ORDER BY u.user_id
LIMIT #{@batch_size}

View File

@ -21,7 +21,7 @@ module ImportScripts::PhpBB3
email: row[:user_email],
username: row[:username],
password: @settings.import_passwords ? row[:user_password] : nil,
name: @settings.username_as_name ? row[:username] : row[:name],
name: @settings.username_as_name ? row[:username] : row[:name].presence,
created_at: Time.zone.at(row[:user_regdate]),
last_seen_at: row[:user_lastvisit] == 0 ? Time.zone.at(row[:user_regdate]) : Time.zone.at(row[:user_lastvisit]),
registration_ip_address: (IPAddr.new(row[:user_ip]) rescue nil),