Skip to content

Commit

Permalink
Unapproved chars for admins on web.
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnfaraday committed Aug 23, 2020
1 parent 44eb2a1 commit 438db47
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/profile/web/character_groups_request_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module AresMUSH
module Profile
class CharacterGroupsRequestHandler
def handle(request)
enactor = request.enactor
error = Website.check_login(request, true)
return error if error

group_key = (Global.read_config("website", "character_gallery_group") || "faction").downcase
npc_groups = Character.all.select { |c| c.is_npc? && !c.idled_out? }
Expand Down Expand Up @@ -72,6 +75,16 @@ def handle(request)
icon: Website.icon_for_char(c)
}
}

if (enactor && enactor.is_admin?)
new_chars = Character.all.select { |c| !c.is_approved? }.sort_by { |c| c.name }.map { |c| {
name: c.name,
icon: Website.icon_for_char(c)
}
}
else
new_chars = nil
end


{
Expand All @@ -82,7 +95,8 @@ def handle(request)
}},
groups: groups,
idle: idle_chars,
dead: dead_chars
dead: dead_chars,
unapproved: new_chars
}
end
end
Expand Down

0 comments on commit 438db47

Please sign in to comment.