From a8c5d4668aadbe4b8691063fb6cb3d576ca8d761 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 26 Sep 2006 22:22:23 +0000 Subject: [PATCH] Switch ti index git-svn-id: file:///home/svn/framework3/trunk@3969 4d416f70-5f16-0410-b530-b9f4589650da --- data/msfweb/app/views/exploits/list.rhtml | 6 ++++-- data/msfweb/app/views/exploits/view.rhtml | 8 ++------ data/msfweb/app/views/payloads/list.rhtml | 6 ++++-- data/msfweb/app/views/payloads/view.rhtml | 8 ++------ 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/data/msfweb/app/views/exploits/list.rhtml b/data/msfweb/app/views/exploits/list.rhtml index 70455f07f7..24c237d047 100644 --- a/data/msfweb/app/views/exploits/list.rhtml +++ b/data/msfweb/app/views/exploits/list.rhtml @@ -6,9 +6,11 @@ - <% @all_exploits.each do |m| %> + <% @all_exploits.each_index do |i| + m = @all_exploits[i] + %> - <%= m.name %> + <%= m.name %> <%= m.description %> <% end %> diff --git a/data/msfweb/app/views/exploits/view.rhtml b/data/msfweb/app/views/exploits/view.rhtml index 418be57953..b52d08ab9e 100644 --- a/data/msfweb/app/views/exploits/view.rhtml +++ b/data/msfweb/app/views/exploits/view.rhtml @@ -1,11 +1,7 @@ <% - modinst = nil - modname = params[:id].gsub(':', '/') - - @all_exploits.each do |m| - modinst = m if m.refname == modname - end + modidx = (params[:id] || 0).to_i + modinst = @all_exploits[modidx] %> diff --git a/data/msfweb/app/views/payloads/list.rhtml b/data/msfweb/app/views/payloads/list.rhtml index 2e058c648a..6b82af3e4a 100644 --- a/data/msfweb/app/views/payloads/list.rhtml +++ b/data/msfweb/app/views/payloads/list.rhtml @@ -6,9 +6,11 @@ - <% @all_payloads.each do |m| %> + <% @all_payloads.each_index do |i| + m = @all_payloads[i] + %> - + <% end %> diff --git a/data/msfweb/app/views/payloads/view.rhtml b/data/msfweb/app/views/payloads/view.rhtml index 9f063062bc..7205e3136f 100644 --- a/data/msfweb/app/views/payloads/view.rhtml +++ b/data/msfweb/app/views/payloads/view.rhtml @@ -1,11 +1,7 @@ <% - modinst = nil - modname = params[:id].gsub(':', '/') - - @all_payloads.each do |m| - modinst = m if m.refname == modname - end + modidx = (params[:id] || 0).to_i + modinst = @all_payloads[modidx] %>
<%= m.name %><%= m.name %> <%= m.description %>