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
|
||||
pass
|
||||
|
||||
def search(self,expression,mode=''):
|
||||
def search(self, expression, mode=''):
|
||||
"""
|
||||
Recherche dans la base LDAP, expression est une chaîne :
|
||||
une expression : champ1=expr1 champ2=expr2 champ3!=expr3....
|
||||
|
@ -520,7 +520,10 @@ class crans_ldap:
|
|||
|
||||
if not expression:
|
||||
return []
|
||||
|
||||
|
||||
# On échappe les caractères spéciaux
|
||||
expression = expression.replace('\\', '\\\\').replace('(', '\\(').replace(')', '\\)')
|
||||
|
||||
# Il faut un filtre par type d'objet de la base
|
||||
filtres = self.auto_search_champs.keys()
|
||||
result={'adherent': [], 'machine': [], 'club': []}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue