Les caractres ')', '(', '*', et '\' on une signification spciale dans
une requte LDAP. darcs-hash:20060308131714-68412-4c3ac80b020bd8ddab57eca396c23c583aa30764.gz
This commit is contained in:
parent
d97d7c67dc
commit
21010aa334
1 changed files with 5 additions and 2 deletions
|
@ -502,7 +502,7 @@ class crans_ldap:
|
||||||
# Existe déja => rien à faire
|
# Existe déja => rien à faire
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def search(self,expression,mode=''):
|
def search(self, expression, mode=''):
|
||||||
"""
|
"""
|
||||||
Recherche dans la base LDAP, expression est une chaîne :
|
Recherche dans la base LDAP, expression est une chaîne :
|
||||||
une expression : champ1=expr1 champ2=expr2 champ3!=expr3....
|
une expression : champ1=expr1 champ2=expr2 champ3!=expr3....
|
||||||
|
@ -521,6 +521,9 @@ class crans_ldap:
|
||||||
if not expression:
|
if not expression:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
# On échappe les caractères spéciaux
|
||||||
|
expression = expression.replace('\\', '\\\\').replace('(', '\\(').replace(')', '\\)')
|
||||||
|
|
||||||
# Il faut un filtre par type d'objet de la base
|
# Il faut un filtre par type d'objet de la base
|
||||||
filtres = self.auto_search_champs.keys()
|
filtres = self.auto_search_champs.keys()
|
||||||
result={'adherent': [], 'machine': [], 'club': []}
|
result={'adherent': [], 'machine': [], 'club': []}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue