on vite le bug de whos paiment=ok&droit=Nounou ou whos
paiement=ok&carteEt!=2006 ... qui renvoie tous les clubs darcs-hash:20060316203844-4ec08-72daa554704635d25826ddab6dcbc77c5fe8d0bc.gz
This commit is contained in:
parent
18635b6af6
commit
c58ca016c8
1 changed files with 19 additions and 5 deletions
|
@ -281,6 +281,11 @@ class crans_ldap:
|
|||
['prise', 'puissance', 'canal', 'hotspot', 'positionBorne'],
|
||||
'machineWifi': non_auto_search_machines_champs + ['ipsec'] }
|
||||
|
||||
# tous les champs de recherche
|
||||
search_champs = {}
|
||||
for i in auto_search_champs.keys():
|
||||
search_champs[i] = auto_search_champs[i] + non_auto_search_champs[i]
|
||||
|
||||
# Profondeur des différentes recherches (scope)
|
||||
scope = {'adherent': 1, 'club': 1,
|
||||
'machineFixe': 2, 'machineWifi': 2,
|
||||
|
@ -636,6 +641,7 @@ class crans_ldap:
|
|||
filtre_seul = {}
|
||||
# filtre_seul[i] est True si la requête porte sur un champ
|
||||
# qui n'est pas dans toutes les machines, mais dans i
|
||||
ignore_filtre =[] # liste des filtres à ignorer
|
||||
for i in filtres:
|
||||
filtre[i] = ''
|
||||
filtre_seul[i] = False
|
||||
|
@ -660,10 +666,16 @@ class crans_ldap:
|
|||
if expr == '': expr = '*'
|
||||
|
||||
ok = False
|
||||
|
||||
|
||||
# si c'est un champ uniquement adherent (genre droit), on ignore les clubs et vice versa
|
||||
if champ in self.search_champs['club'] and champ not in self.search_champs['adherent']:
|
||||
if 'adherent' not in ignore_filtre : ignore_filtre.append('adherent')
|
||||
if champ in self.search_champs['adherent'] and champ not in self.search_champs['club']:
|
||||
if 'club' not in ignore_filtre : ignore_filtre.append('club')
|
||||
|
||||
# Construction du filtre
|
||||
for i in filtres:
|
||||
if champ in self.auto_search_champs[i] + self.non_auto_search_champs[i]:
|
||||
if champ in self.search_champs[i]:
|
||||
filtre[i] += build_filtre(champ, expr, neg)
|
||||
ok = True
|
||||
if champ not in self.auto_search_machines_champs \
|
||||
|
@ -688,12 +700,14 @@ class crans_ldap:
|
|||
filtre[i] = ''
|
||||
|
||||
for i in filtres:
|
||||
if filtre[i] != '':
|
||||
if i in ignore_filtre or filtre[i] == '':
|
||||
# Filtre vide ou à ignorer
|
||||
filtre[i] = ''
|
||||
r[i] = None
|
||||
else:
|
||||
# Filtre valide
|
||||
filtre[i] = '(&(objectClass=%s)%s)' % (i, filtre[i])
|
||||
r[i] = self.conn.search_s(self.base_dn, self.scope[i], filtre[i])
|
||||
else:
|
||||
r[i] = None
|
||||
|
||||
## On a alors une liste de résultats
|
||||
## r = {categorie1: [(result1), (result2), ...], ...}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue