diff --git a/gestion/gen_confs/firewall_new.py b/gestion/gen_confs/firewall_new.py index 604336a2..811220c8 100755 --- a/gestion/gen_confs/firewall_new.py +++ b/gestion/gen_confs/firewall_new.py @@ -1079,7 +1079,7 @@ class firewall_komaz(firewall_crans) : # Peut-être à mettre dans config.py ? blacklist_sanctions = ('upload', 'warez', 'p2p', 'autodisc_p2p', 'autodisc_upload', 'bloq') blacklist_sanctions_soft = ('autodisc_virus','ipv6_ra','mail_invalide','virus', - 'upload', 'warez', 'p2p', 'autodisc_p2p', 'autodisc_upload', 'bloq') + 'upload', 'warez', 'p2p', 'autodisc_p2p', 'autodisc_upload', 'bloq','carte_etudiant','chambre_invalide') blacklist = [] diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index 179ce9f9..02604e60 100644 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -233,6 +233,12 @@ class komaz(base_reconfigure): def blacklist(self): self.__fw().blacklist() self.__fw6().blacklist(6) + + def bl_carte_etudiant(self): + self.blacklist() + + def bl_chbre_invalide(self): + self.blacklist() def classify(self, ips): self.__fw().classes_p2p_maj(ips) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 29f3a3a1..826b1a79 100644 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -966,14 +966,20 @@ class BaseClasseCrans(CransLdap): ex: {'upload': [(1143336210, 1143509010), ...]} """ bl_liste = self._data.get('blacklist', []) - + + actifs = {} + inactifs = {} + if isinstance(self, Machine): # Il faut aussi regarder la blackliste du propriétaire p = self.proprietaire() bl_liste += p.blacklist() - - actifs = {} - inactifs = {} + elif isinstance(self, Adherent) and (config.ann_scol in self.paiement()): + # blacklistes virtuelle si on est un adhérent pour carte étudiant et chambre invalides + if not config.periode_transitoire and config.bl_carte_et_actif and not (config.ann_scol in self.carteEtudiant()): + actifs['carte_etudiant']=('-','-') + if self.chbre() == '????': + actifs['chambre_invalide']=('-','-') for sanction in bl_liste: champs = sanction.split('$') @@ -1755,7 +1761,7 @@ class BaseProprietaire(BaseClasseCrans): else: nouveau = 1 - if 'chbre' in self.modifs and '????' in [ self._init_data.get("chbre", [''])[0] , self._init_data.get("chbre", [''])[0] ]: + if 'chbre' in self.modifs and '????' in [ self._init_data.get("chbre", [''])[0] , self._init_data.get("chbre", [''])[1] ]: self.services_to_restart('bl_chbre_invalide') if ('chbre' in self.modifs or 'paiement' in self.modifs) and self._data['chbre'][0] not in ("????", "EXT"):