Reedition de la bl pour le p2p
darcs-hash:20060121130942-6d78a-8102d438a8539848c9d3f90fe5631b2cd4ba2e77.gz
This commit is contained in:
parent
56c9fd4538
commit
948d78369f
1 changed files with 17 additions and 9 deletions
|
@ -438,7 +438,8 @@ for ip, id_p2p, nombre in fraudeurs :
|
||||||
machine = ldap.search('ipHostNumber=%s' % ip,'w' )['machine'][0]
|
machine = ldap.search('ipHostNumber=%s' % ip,'w' )['machine'][0]
|
||||||
hostname = machine.nom()
|
hostname = machine.nom()
|
||||||
proprio = machine.proprietaire()
|
proprio = machine.proprietaire()
|
||||||
|
blacklist = proprio.blacklist()
|
||||||
|
|
||||||
# Envoie du mail à disconnect
|
# Envoie du mail à disconnect
|
||||||
if p2p.disconnect_mail :
|
if p2p.disconnect_mail :
|
||||||
corps = p2p.avertissement % { 'From': upload.expediteur, 'To': upload.expediteur, 'protocole': protocole, 'hostname':hostname}
|
corps = p2p.avertissement % { 'From': upload.expediteur, 'To': upload.expediteur, 'protocole': protocole, 'hostname':hostname}
|
||||||
|
@ -453,12 +454,19 @@ for ip, id_p2p, nombre in fraudeurs :
|
||||||
################################
|
################################
|
||||||
corps = p2p.deconnection % {'From':upload.expediteur, 'To':proprio.email(), 'protocole': protocole, 'hostname':hostname}
|
corps = p2p.deconnection % {'From':upload.expediteur, 'To':proprio.email(), 'protocole': protocole, 'hostname':hostname}
|
||||||
corps = corps.encode('iso 8859-15')
|
corps = corps.encode('iso 8859-15')
|
||||||
#mail.sendmail(upload.expediteur,proprio.email(),corps)
|
mail.sendmail(upload.expediteur,proprio.email(),corps)
|
||||||
|
|
||||||
|
|
||||||
|
index = [blacklist.index(x) for x in blacklist if 'P2P' in x ]
|
||||||
|
if index :
|
||||||
|
# adhérent déja blacklisté
|
||||||
|
fin = localtime(time()+60*60*24)
|
||||||
|
proprio.blacklist(( index[0] , ['now',"%d/%d/%d %d:%d" % (fin[2],fin[1],fin[0],fin[3],fin[4]),'virus',hostname] ))
|
||||||
|
proprio.save()
|
||||||
|
else :
|
||||||
|
# adhérent non blacklisté
|
||||||
|
proprio.blacklist(['now',"%d/%d/%d %d:%d" % (fin[2],fin[1],fin[0],fin[3],fin[4]),'virus',hostname])
|
||||||
|
proprio.save()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Blacklistage
|
|
||||||
debut = localtime(time())
|
|
||||||
#7 jours
|
|
||||||
fin = localtime(time()+60*60*24)
|
|
||||||
# proprio.blacklist(["%d/%d/%d %d:%d" % (debut[2],debut[1],debut[0],debut[3],debut[4]),"%d/%d/%d %d:%d" % (fin[2],fin[1],fin[0],fin[3],fin[4]),'p2p',"P2P %s (auto)" % protocole])
|
|
||||||
proprio.blacklist(["%d/%d/%d %d:%d" % (debut[2],debut[1],debut[0],debut[3],debut[4]),"%d/%d/%d %d:%d" % (fin[2],fin[1],fin[0],fin[3],fin[4]),'autodisc',"P2P %s (auto)" % protocole])
|
|
||||||
proprio.save()
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue