patch pour difrencier les recherches sur les blacklist adhrents et les

blacklists machines

darcs-hash:20060306194502-4ec08-2e53f10b214a0ee3bce04c91b9c7754cbd6e4375.gz
This commit is contained in:
chove 2006-03-06 20:45:02 +01:00
parent 224ca1940e
commit 6dbaa724d5

View file

@ -249,8 +249,8 @@ class crans_ldap:
'club': [ 'nom', 'chbre' ] }
# Champs de recherche pour la recherche manuelle (en plus de la recherche auto)
non_auto_search_champs = { 'adherent': [ 'etudes', 'paiement', 'carteEtudiant', 'aid' , 'postalAddress', 'historique' ,'blacklist', 'droits', 'uidNumber', 'uid', 'info', 'solde', 'controle', 'contourneGreylist', 'rewriteMailHeaders' ], \
'machine': [ 'mid' , 'ipsec', 'historique', 'blacklist' , 'puissance', 'canal', 'portTCPin', 'portTCPout', 'portUDPin', 'portUDPout', 'prise' , 'info', 'exempt' ] ,
non_auto_search_champs = { 'adherent': [ 'etudes', 'paiement', 'carteEtudiant', 'aid' , 'postalAddress', 'historique' ,'blacklist', 'droits', 'uidNumber', 'uid', 'info', 'solde', 'controle', 'contourneGreylist', 'rewriteMailHeaders', 'ablacklist'], \
'machine': [ 'mid' , 'ipsec', 'historique', 'blacklist' , 'puissance', 'canal', 'portTCPin', 'portTCPout', 'portUDPin', 'portUDPout', 'prise' , 'info', 'exempt', 'mblacklist'] ,
'club': [ 'cid' , 'responsable', 'paiement', 'historique', 'blacklist', 'mailAlias', 'info', 'controle' ] }
# Profondeur des différentes recherches (scope)
@ -559,6 +559,8 @@ class crans_ldap:
# Doit-on bloquer en cas de manque de la carte d'etudiant ?
if config.bl_carte_et_definitif:
el = "(&(|(carteEtudiant=%s)(objectClass=club))%s)" % (int(ann_scol), el)
elif champ[1:] == 'blacklist':
el = '(blacklist=%s)' % (expr)
else:
# Cas général
el = '(%s=%s)' % (champ, expr)
@ -669,12 +671,10 @@ class crans_ldap:
# Croisement
bons_dn = [] # liste des dn d'adhérents qui correspondent aux critères
if r['adherent']:
for a in r['adherent']:
if a[0] in mach_adh and not a[0] in bons_dn:
bons_dn.append(a[0])
result['adherent'].append(adherent(a,mode,self.conn) )
if r['club']:
for a in r['club']:
if a[0] in mach_adh and not a[0] in bons_dn:
bons_dn.append(a[0])