From 7447015901783c646196bda043b861353a17b133 Mon Sep 17 00:00:00 2001 From: "buherator@gmail.com" Date: Sat, 15 Oct 2011 14:25:50 +0000 Subject: [PATCH] sorting commands by status and name git-svn-id: https://beef.googlecode.com/svn/trunk@1364 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- extensions/admin_ui/controllers/modules/modules.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extensions/admin_ui/controllers/modules/modules.rb b/extensions/admin_ui/controllers/modules/modules.rb index 0847a4584..a1fffd5b4 100644 --- a/extensions/admin_ui/controllers/modules/modules.rb +++ b/extensions/admin_ui/controllers/modules/modules.rb @@ -478,13 +478,11 @@ class Modules < BeEF::Extension::AdminUI::HttpController # sort the parent array nodes tree.sort! {|a,b| a['text'] <=> b['text']} - # sort the children nodes by status + # sort the children nodes by status and name tree.each {|x| x['children'] = - x['children'].sort_by {|a| a['status']} + x['children'].sort_by {|a| [a['status'],a['text']]} } - - - + # append the number of command modules so the branch name results in: " (num)" tree.each {|command_module_branch| num_of_command_modules = command_module_branch['children'].length