[deconnexion] ᛋᛋ il faut tous les brûler ᛋᛋ
La déconnexion bittorrent dure 2h darcs-hash:20100211230331-ffbb2-f791efd125f1e4bea1bee1e0f5c891abbd82f51e.gz
This commit is contained in:
parent
9fb2a8191f
commit
668908a835
2 changed files with 8 additions and 5 deletions
|
@ -482,9 +482,11 @@ class firewall_komaz(firewall_crans) :
|
|||
('dc', 'DirectConnect'),
|
||||
('kazaa', 'KaZaa'),
|
||||
('ares', 'Ares'),
|
||||
('bit', 'Bittorrent'),
|
||||
('gnu', 'GNUtella') ]
|
||||
|
||||
filtres_p2p_bloq = [ ('bit', 'Bittorrent'), ]
|
||||
filtres_p2p_bloq = [
|
||||
]
|
||||
|
||||
|
||||
ports_p2p = [ '412', '1214', '4662:4665' , '6346:6347', '6699', '6881:6889' ]
|
||||
|
|
|
@ -427,8 +427,6 @@ for ip, id_p2p, nombre in fraudeurs:
|
|||
#s'il est averti
|
||||
if nombre <= p2p.limite[protocole] or [ip, protocole] in avertisp2p:
|
||||
continue
|
||||
if id_p2p == 1:
|
||||
continue
|
||||
|
||||
# Récupération des ref de la machine
|
||||
machines = ldap.search('ipHostNumber=%s' % ip, 'w' )['machine']
|
||||
|
@ -470,7 +468,7 @@ for ip, id_p2p, nombre in fraudeurs:
|
|||
# Vérification du nombre de déconnexions
|
||||
#########################################
|
||||
nb_decos = len([ x for x in proprio.blacklist() if int(x.split('$')[0]) > time()-365*24*3600 and x.split('$')[2] == 'autodisc_p2p' ])
|
||||
if nb_decos >= 3:
|
||||
if nb_decos >= 3 and protocole != "Bittorrent":
|
||||
|
||||
fichier_ps = generate_ps('p2p', proprio, ldap)
|
||||
# Envoi du mail à disconnect
|
||||
|
@ -483,6 +481,9 @@ for ip, id_p2p, nombre in fraudeurs:
|
|||
mail.sendmail(p2p.expediteur, p2p.expediteur, corps)
|
||||
|
||||
# L'adhérent n'est pas encore blacklisté
|
||||
fin = int(time()) + 24*3600
|
||||
if protocole == "Bittorrent":
|
||||
fin = int(time()) + 2*3600
|
||||
else:
|
||||
fin = int(time()) + 24*3600
|
||||
proprio.blacklist(['now', fin, 'autodisc_p2p', hostname])
|
||||
proprio.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue