Skip to content

Commit

Permalink
Added button and code to deactive and clean campaign stats with one c…
Browse files Browse the repository at this point in the history
…lick.
  • Loading branch information
antisnatchor committed Oct 19, 2015
1 parent 9d9c1fb commit b348141
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,11 @@ def delete_victim
format.js
end
end

def deactivate_and_clean
campaign = Campaign.find(params[:id])
campaign.update_attribute(:active, false)
campaign.victims.destroy_all
redirect_to(:controller => 'campaigns', :action => 'list')
end
end
6 changes: 6 additions & 0 deletions app/views/campaigns/list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
campaign_path(campaign.id), data: {placement: 'bottom'},
class: 'btn btn-default btn-xs', rel: 'tooltip',
title: 'Campaign Options') %>

<%= link_to("<span class='glyphicon glyphicon-off'></span>".html_safe,
"/campaigns/deactivate_and_clean/#{campaign.id}", method: :deactivate_and_clean,
class: 'btn btn-default btn-xs', rel: 'tooltip',
title: 'Deactivate and Clean Campaign') %>

<%= link_to "<span class='glyphicon glyphicon-remove'></span>".html_safe,
campaign_path(campaign), method: :delete,
data: { confirm: 'Are you sure you want to permanently delete this campaign?', placement: 'bottom'}, rel: 'tooltip',
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module PhishingFramework
# Default website for reports stuff, must change to callback.
SITE_URL = "http://phishingfrenzy.anti.local"
SITE_URL = "http://pfadmin.local"


class Application < Rails::Application
Expand Down

0 comments on commit b348141

Please sign in to comment.