import approval state of users in Ning import script

This commit is contained in:
Neil Lalonde 2015-01-27 15:22:38 -05:00
parent c7fa4a029d
commit c3c202f59e
1 changed files with 9 additions and 2 deletions

View File

@ -69,13 +69,20 @@ class ImportScripts::Ning < ImportScripts::Base
if staff_levels.include?(u["level"].downcase)
if u["level"].downcase == "admin" || u["level"].downcase == "owner"
newuser.admin = true
newuser.save
else
newuser.moderator = true
newuser.save
end
end
# states: ["active", "suspended", "left", "pending"]
if u["state"] == "active"
newuser.approved = true
newuser.approved_by_id = @system_user.id
newuser.approved_at = newuser.created_at
end
newuser.save
if u["profilePhoto"]
photo_path = file_full_path(u["profilePhoto"])
if File.exists?(photo_path)