projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update copyright
[matthijs/upstream/django-ldapdb.git]
/
ldapdb
/
__init__.py
diff --git
a/ldapdb/__init__.py
b/ldapdb/__init__.py
index 60b6c865710b64130469fe4f51f4a8194b1ade6f..4f9392e90c2a8c6802e721afaf9564bd2533f609 100644
(file)
--- a/
ldapdb/__init__.py
+++ b/
ldapdb/__init__.py
@@
-1,7
+1,7
@@
# -*- coding: utf-8 -*-
#
# django-ldapdb
# -*- coding: utf-8 -*-
#
# django-ldapdb
-# Copyright (C) 2009 Bolloré telecom
+# Copyright (C) 2009
-2010
Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
@@
-31,7
+31,15
@@
def convert(field, value, func):
return [ func(x) for x in value ]
else:
return func(value)
return [ func(x) for x in value ]
else:
return func(value)
-
+
+def escape_ldap_filter(value):
+ value = str(value)
+ return value.replace('\\', '\\5c') \
+ .replace('*', '\\2a') \
+ .replace('(', '\\28') \
+ .replace(')', '\\29') \
+ .replace('\0', '\\00')
+
class LdapConnection(object):
def __init__(self, server, bind_dn, bind_password):
self.connection = ldap.initialize(server)
class LdapConnection(object):
def __init__(self, server, bind_dn, bind_password):
self.connection = ldap.initialize(server)