Gestion des blacklistes qui peuvent n'tre que pour :
- un adhrent, cas de upload, p2p - une machine, cas de virus - n'importe, cas de ... on laisse le cas gnral pour viter de tout casser darcs-hash:20060306195158-72cb0-4a7c0fff29965ca409f28203affb73ce018bfe38.gz
This commit is contained in:
parent
6dbaa724d5
commit
0e56dd4c3c
2 changed files with 21 additions and 13 deletions
|
@ -38,8 +38,8 @@ class base_reconfigure :
|
||||||
__service_develop = {
|
__service_develop = {
|
||||||
'macip' : [ 'rouge-macip', 'zamok-macip', 'sila-macip' , 'komaz-macip' ] ,
|
'macip' : [ 'rouge-macip', 'zamok-macip', 'sila-macip' , 'komaz-macip' ] ,
|
||||||
'droits': [ 'rouge-droits', 'ragnarok-droits' ] ,
|
'droits': [ 'rouge-droits', 'ragnarok-droits' ] ,
|
||||||
'blacklist_upload' : [ 'bl_squid_upload' , 'komaz-blacklist'] ,
|
'blacklist_upload' : [ 'blacklis_upload' , 'komaz-blacklist'] ,
|
||||||
'blacklist_p2p' : [ 'bl_squid_p2p' , 'komaz-blacklist'] ,
|
'blacklist_p2p' : [ 'blacklist_p2p' , 'komaz-blacklist'] ,
|
||||||
'blacklist_autodisc' : [ 'komaz-blacklist'] }
|
'blacklist_autodisc' : [ 'komaz-blacklist'] }
|
||||||
|
|
||||||
def __init__(self,to_do=[]) :
|
def __init__(self,to_do=[]) :
|
||||||
|
@ -184,6 +184,10 @@ class sila(base_reconfigure) :
|
||||||
from gen_confs.squid import squid_carte
|
from gen_confs.squid import squid_carte
|
||||||
self._do(squid_carte())
|
self._do(squid_carte())
|
||||||
|
|
||||||
|
def bl_chbre_invalide(self) :
|
||||||
|
from gen_confs.squid import squid_chbre
|
||||||
|
self._do(squid_chbre())
|
||||||
|
|
||||||
def blacklist_virus(self) :
|
def blacklist_virus(self) :
|
||||||
from gen_confs.squid import squid_virus
|
from gen_confs.squid import squid_virus
|
||||||
self._do(squid_virus())
|
self._do(squid_virus())
|
||||||
|
@ -192,18 +196,14 @@ class sila(base_reconfigure) :
|
||||||
from gen_confs.squid import squid_warez
|
from gen_confs.squid import squid_warez
|
||||||
self._do(squid_warez())
|
self._do(squid_warez())
|
||||||
|
|
||||||
def bl_squid_p2p(self) :
|
def blacklist_p2p(self) :
|
||||||
from gen_confs.squid import squid_p2p
|
from gen_confs.squid import squid_p2p
|
||||||
self._do(squid_p2p())
|
self._do(squid_p2p())
|
||||||
|
|
||||||
def bl_squid_upload(self) :
|
def blacklist_upload(self) :
|
||||||
from gen_confs.squid import squid_upload
|
from gen_confs.squid import squid_upload
|
||||||
self._do(squid_upload())
|
self._do(squid_upload())
|
||||||
|
|
||||||
def bl_chbre_invalide(self) :
|
|
||||||
from gen_confs.squid import squid_chbre
|
|
||||||
self._do(squid_chbre())
|
|
||||||
|
|
||||||
class ragnarok(base_reconfigure) :
|
class ragnarok(base_reconfigure) :
|
||||||
__restart_wifi_update = False
|
__restart_wifi_update = False
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,18 @@ class squid(gen_config) :
|
||||||
fic = self._open_conf(self.FICHIER)
|
fic = self._open_conf(self.FICHIER)
|
||||||
# recherche_bl :
|
# recherche_bl :
|
||||||
# 1 : search sur champ blacklist et clubs compris
|
# 1 : search sur champ blacklist et clubs compris
|
||||||
|
# 2 : search sur champ ablacklist et clubs compris
|
||||||
|
# 3 : search sur champ mblacklist et clubs compris
|
||||||
# 0 : search plus général et clubs exclus
|
# 0 : search plus général et clubs exclus
|
||||||
if self.recherche_bl==1:
|
if self.recherche_bl==1:
|
||||||
liste = self.db.search("paiement=ok&blacklist=*%s*"%self.chaine)
|
liste = self.db.search("paiement=ok&blacklist=*%s*"%self.chaine)
|
||||||
l_proprio = liste["adherent"]+liste["club"]
|
l_proprio = liste["adherent"]+liste["club"]
|
||||||
|
elif self.recherche_bl==2:
|
||||||
|
liste = self.db.search("paiement=ok&ablacklist=*%s*"%self.chaine)
|
||||||
|
l_proprio = liste["adherent"]+liste["club"]
|
||||||
|
elif self.recherche_bl==3:
|
||||||
|
liste = self.db.search("paiement=ok&mblacklist=*%s*"%self.chaine)
|
||||||
|
l_proprio = liste["adherent"]+liste["club"]
|
||||||
else:
|
else:
|
||||||
l_proprio = self.db.search('paiement=ok&' + self.chaine)["adherent"]
|
l_proprio = self.db.search('paiement=ok&' + self.chaine)["adherent"]
|
||||||
self.anim.iter=len(l_proprio)
|
self.anim.iter=len(l_proprio)
|
||||||
|
@ -49,21 +57,21 @@ class squid_upload(squid) :
|
||||||
|
|
||||||
class squid_virus(squid) :
|
class squid_virus(squid) :
|
||||||
""" Genère le fichier blacklist-virus pour squid """
|
""" Genère le fichier blacklist-virus pour squid """
|
||||||
FICHIER = "/etc/squid/blacklist_infectes"
|
FICHIER = "/etc/squid/blacklist_virus"
|
||||||
chaine = "virus"
|
chaine = "virus"
|
||||||
recherche_bl = 1
|
recherche_bl = 3
|
||||||
|
|
||||||
class squid_warez(squid) :
|
class squid_warez(squid) :
|
||||||
""" Genère le fichier blacklist-warez pour squid """
|
""" Genère le fichier blacklist-warez pour squid """
|
||||||
FICHIER = "/etc/squid/blacklist_warez"
|
FICHIER = "/etc/squid/blacklist_warez"
|
||||||
chaine = "warez"
|
chaine = "warez"
|
||||||
recherche_bl = 1
|
recherche_bl = 2
|
||||||
|
|
||||||
class squid_p2p(squid) :
|
class squid_p2p(squid) :
|
||||||
""" Genère le fichier blacklist-p2p pour squid """
|
""" Genère le fichier blacklist-p2p pour squid """
|
||||||
FICHIER = "/etc/squid/blacklist_p2p"
|
FICHIER = "/etc/squid/blacklist_p2p"
|
||||||
chaine = "P2P"
|
chaine = "p2p"
|
||||||
recherche_bl = 1
|
recherche_bl = 2
|
||||||
|
|
||||||
class squid_carte(squid) :
|
class squid_carte(squid) :
|
||||||
""" Genère le fichier blacklist-carte pour squid """
|
""" Genère le fichier blacklist-carte pour squid """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue