mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
import approval state of users in Ning import script
This commit is contained in:
parent
c7fa4a029d
commit
c3c202f59e
1 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue