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'],
|
['prise', 'puissance', 'canal', 'hotspot', 'positionBorne'],
|
||||||
'machineWifi': non_auto_search_machines_champs + ['ipsec'] }
|
'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)
|
# Profondeur des différentes recherches (scope)
|
||||||
scope = {'adherent': 1, 'club': 1,
|
scope = {'adherent': 1, 'club': 1,
|
||||||
'machineFixe': 2, 'machineWifi': 2,
|
'machineFixe': 2, 'machineWifi': 2,
|
||||||
|
@ -636,6 +641,7 @@ class crans_ldap:
|
||||||
filtre_seul = {}
|
filtre_seul = {}
|
||||||
# filtre_seul[i] est True si la requête porte sur un champ
|
# filtre_seul[i] est True si la requête porte sur un champ
|
||||||
# qui n'est pas dans toutes les machines, mais dans i
|
# qui n'est pas dans toutes les machines, mais dans i
|
||||||
|
ignore_filtre =[] # liste des filtres à ignorer
|
||||||
for i in filtres:
|
for i in filtres:
|
||||||
filtre[i] = ''
|
filtre[i] = ''
|
||||||
filtre_seul[i] = False
|
filtre_seul[i] = False
|
||||||
|
@ -660,10 +666,16 @@ class crans_ldap:
|
||||||
if expr == '': expr = '*'
|
if expr == '': expr = '*'
|
||||||
|
|
||||||
ok = False
|
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
|
# Construction du filtre
|
||||||
for i in filtres:
|
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)
|
filtre[i] += build_filtre(champ, expr, neg)
|
||||||
ok = True
|
ok = True
|
||||||
if champ not in self.auto_search_machines_champs \
|
if champ not in self.auto_search_machines_champs \
|
||||||
|
@ -688,12 +700,14 @@ class crans_ldap:
|
||||||
filtre[i] = ''
|
filtre[i] = ''
|
||||||
|
|
||||||
for i in filtres:
|
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 valide
|
||||||
filtre[i] = '(&(objectClass=%s)%s)' % (i, filtre[i])
|
filtre[i] = '(&(objectClass=%s)%s)' % (i, filtre[i])
|
||||||
r[i] = self.conn.search_s(self.base_dn, self.scope[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
|
## On a alors une liste de résultats
|
||||||
## r = {categorie1: [(result1), (result2), ...], ...}
|
## r = {categorie1: [(result1), (result2), ...], ...}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue