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

@ -240,8 +240,8 @@ class crans_ldap:
'login': 'mail' , 'login': 'mail' ,
'hostname': 'host', 'hostname': 'host',
'mac': 'macAddress', 'mac': 'macAddress',
'ip': 'ipHostNumber' , 'ip': 'ipHostNumber',
'telephone': 'tel' } 'telephone': 'tel'}
# Champs de recherche pour la recherche automatique # Champs de recherche pour la recherche automatique
auto_search_champs = { 'adherent': [ 'nom', 'prenom', 'tel', 'mail', 'chbre', 'mailAlias', 'cannonicalAlias' ], \ auto_search_champs = { 'adherent': [ 'nom', 'prenom', 'tel', 'mail', 'chbre', 'mailAlias', 'cannonicalAlias' ], \
@ -249,8 +249,8 @@ class crans_ldap:
'club': [ 'nom', 'chbre' ] } 'club': [ 'nom', 'chbre' ] }
# Champs de recherche pour la recherche manuelle (en plus de la recherche auto) # 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' ], \ 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' ] , 'machine': [ 'mid' , 'ipsec', 'historique', 'blacklist' , 'puissance', 'canal', 'portTCPin', 'portTCPout', 'portUDPin', 'portUDPout', 'prise' , 'info', 'exempt', 'mblacklist'] ,
'club': [ 'cid' , 'responsable', 'paiement', 'historique', 'blacklist', 'mailAlias', 'info', 'controle' ] } 'club': [ 'cid' , 'responsable', 'paiement', 'historique', 'blacklist', 'mailAlias', 'info', 'controle' ] }
# Profondeur des différentes recherches (scope) # 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 ? # Doit-on bloquer en cas de manque de la carte d'etudiant ?
if config.bl_carte_et_definitif: if config.bl_carte_et_definitif:
el = "(&(|(carteEtudiant=%s)(objectClass=club))%s)" % (int(ann_scol), el) el = "(&(|(carteEtudiant=%s)(objectClass=club))%s)" % (int(ann_scol), el)
elif champ[1:] == 'blacklist':
el = '(blacklist=%s)' % (expr)
else: else:
# Cas général # Cas général
el = '(%s=%s)' % (champ, expr) el = '(%s=%s)' % (champ, expr)
@ -669,16 +671,14 @@ class crans_ldap:
# Croisement # Croisement
bons_dn = [] # liste des dn d'adhérents qui correspondent aux critères bons_dn = [] # liste des dn d'adhérents qui correspondent aux critères
if r['adherent']: for a in r['adherent']:
for a in r['adherent']: if a[0] in mach_adh and not a[0] in bons_dn:
if a[0] in mach_adh and not a[0] in bons_dn: bons_dn.append(a[0])
bons_dn.append(a[0]) result['adherent'].append(adherent(a,mode,self.conn) )
result['adherent'].append(adherent(a,mode,self.conn) ) for a in r['club']:
if r['club']: if a[0] in mach_adh and not a[0] in bons_dn:
for a in r['club']: bons_dn.append(a[0])
if a[0] in mach_adh and not a[0] in bons_dn: result['club'].append(club(a,mode,self.conn) )
bons_dn.append(a[0])
result['club'].append(club(a,mode,self.conn) )
# Maintenant c'est au tour des bonnes machines # Maintenant c'est au tour des bonnes machines
bons_dn2 = [] bons_dn2 = []