From 6dbaa724d57d8244607fb1c0f27a36226301b654 Mon Sep 17 00:00:00 2001 From: chove Date: Mon, 6 Mar 2006 20:45:02 +0100 Subject: [PATCH] patch pour difrencier les recherches sur les blacklist adhrents et les blacklists machines darcs-hash:20060306194502-4ec08-2e53f10b214a0ee3bce04c91b9c7754cbd6e4375.gz --- gestion/ldap_crans.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 938a7b13..367d0f19 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -240,8 +240,8 @@ class crans_ldap: 'login': 'mail' , 'hostname': 'host', 'mac': 'macAddress', - 'ip': 'ipHostNumber' , - 'telephone': 'tel' } + 'ip': 'ipHostNumber', + 'telephone': 'tel'} # Champs de recherche pour la recherche automatique auto_search_champs = { 'adherent': [ 'nom', 'prenom', 'tel', 'mail', 'chbre', 'mailAlias', 'cannonicalAlias' ], \ @@ -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,16 +671,14 @@ 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]) - result['club'].append(club(a,mode,self.conn) ) + 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) ) + for a in r['club']: + if a[0] in mach_adh and not a[0] in bons_dn: + bons_dn.append(a[0]) + result['club'].append(club(a,mode,self.conn) ) # Maintenant c'est au tour des bonnes machines bons_dn2 = []