actually save the campaign

git-svn-id: file:///home/svn/framework3/trunk@10609 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-10-08 20:32:32 +00:00
parent dbcd8619e1
commit 014ed847b2
1 changed files with 13 additions and 0 deletions

View File

@ -395,10 +395,12 @@ class DBManager
#
# opts must contain
# :ua_string -- the value of the User-Agent header
# :host -- the host where this client connected from, can be an ip address or a Host object
#
# opts can contain
# :ua_name -- one of the Msf::HttpClients constants
# :ua_ver -- detected version of the given client
# :campaign -- an id or Campaign object
#
# Returns a Client.
#
@ -413,6 +415,17 @@ class DBManager
task = queue(Proc.new {
host = get_host(:workspace => wspace, :host => addr)
client = host.clients.find_or_initialize_by_ua_string(opts[:ua_string])
campaign = opts.delete(:campaign)
if campaign
case campaign
when Campaign
opts[:campaign_id] = campaign.id
else
opts[:campaign_id] = campaign
end
end
opts.each { |k,v|
if (client.attribute_names.include?(k.to_s))
client[k] = v