On vrifie avant la mise jour des rgles que l'ip est bien celle d'un
adhrent. Ce sont les seuls avoir leur propre une rgle de filtrage. Les clubs tant dans la classe par dfaut et les machines du crans exempts de tout filtrage. darcs-hash:20060613154216-72cb0-6412affe2ff80b29d11c36f0e8ad9c8629394aa1.gz
This commit is contained in:
parent
74da5d28c2
commit
5aa28c48cf
1 changed files with 9 additions and 4 deletions
|
@ -638,8 +638,13 @@ class firewall_komaz(firewall_crans) :
|
|||
warn = ''
|
||||
try :
|
||||
for ip in ip_list :
|
||||
recherche = db.search('ip=%s'% ip)['machine']
|
||||
if not recherche :
|
||||
recherche = db.search('ip=%s&paiement=ok'% ip)
|
||||
# Si l'ip n'appartient pas à un adhérent,
|
||||
# on cherche pas plus loin
|
||||
if not recherche['adherent'] :
|
||||
continue
|
||||
machines = recherche['machine']
|
||||
if not machines :
|
||||
# Il faut supprimer cette entrée
|
||||
iptables_option = '-D'
|
||||
tc_option = ''
|
||||
|
@ -649,11 +654,11 @@ class firewall_komaz(firewall_crans) :
|
|||
regle = regles[0].split()
|
||||
mark = regle[7]
|
||||
class_id = int(mark.split(':')[1])
|
||||
elif len(recherche) == 1 :
|
||||
elif len(machines) == 1 :
|
||||
# Il faut ajouter cette entrée
|
||||
iptables_option = '-A'
|
||||
tc_option = ''
|
||||
machine = recherche[0]
|
||||
machine = machines[0]
|
||||
adherent = machine.proprietaire()
|
||||
ip = machine.ip()
|
||||
subnet = IpSubnet(ip, conf_fw.mask[len(conf_fw.mask)-1])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue