diff --git a/gestion/gen_confs/firewall.py b/gestion/gen_confs/firewall.py index 8581c637..2c301868 100755 --- a/gestion/gen_confs/firewall.py +++ b/gestion/gen_confs/firewall.py @@ -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])