[firewall_new,generate,ldap_crans] Prise en compte des déco chambre invalide et carte étudiant
Ignore-this: 16f86d33fe0e98057fd9533abc25aa88 TOujours effectué sur squid, elles était alors simplement ignoré puisque la connection au web est maintemant directe. On ajoute donc des blacklistes soft "virtuelle" pour carte et chambre invalide dans ldap_crans, ce qui a pour effet de faire que le pare-feu redirige vers sable (et squid) les machines consernées. On dit à générate de recharger les blackliste du pare-feu lorsque l'on coche une carte étudiant dans gest_crans ou quand le status chambre invalide change. btw, on reporte aussi les modifications de crans_ldap dans lc_ldap. darcs-hash:20121104020449-3a55a-78f73e677e75e8eaa087fd9bd6f8c1aec2b593ea.gz
This commit is contained in:
parent
a74d31de0e
commit
c71900a5ba
3 changed files with 18 additions and 6 deletions
|
@ -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 = []
|
||||
|
|
|
@ -234,6 +234,12 @@ class komaz(base_reconfigure):
|
|||
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)
|
||||
|
||||
|
|
|
@ -967,13 +967,19 @@ class BaseClasseCrans(CransLdap):
|
|||
"""
|
||||
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"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue