[tryton-debian-vcs] tryton-modules-ldap-authentication branch upstream updated. upstream/3.6.0-1-gf5e4e10
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Mon Sep 21 12:29:33 UTC 2015
The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-ldap-authentication.git;a=commitdiff;h=upstream/3.6.0-1-gf5e4e10
commit f5e4e1014c9ff663d7b155193eb57f946c992225
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Sep 20 20:51:02 2015 +0200
Adding upstream version 3.6.1.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 22db2a0..a138bea 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.6.1 - 2015-09-19
+* Bug fixes (see mercurial logs for details)
+
Version 3.6.0 - 2015-04-20
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index d0d0e42..503912d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond_ldap_authentication
-Version: 3.6.0
+Version: 3.6.1
Summary: Tryton module to authenticate users through LDAP
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/res.py b/res.py
index 7081a3f..21dff2c 100644
--- a/res.py
+++ b/res.py
@@ -58,6 +58,13 @@ def ldap_connection():
return conn
+# python-ldap works only with str
+def unicode2str(param):
+ if isinstance(param, unicode):
+ param = param.encode('utf-8')
+ return param
+
+
class User:
__name__ = 'res.user'
@@ -85,9 +92,9 @@ class User:
}.get(scope)
uid = config.get(section, 'uid', default='uid')
if filter_:
- filter_ = '(&(%s=%s)%s)' % (uid, login, filter_)
+ filter_ = '(&(%s=%s)%s)' % (uid, unicode2str(login), filter_)
else:
- filter_ = '(%s=%s)' % (uid, login)
+ filter_ = '(%s=%s)' % (uid, unicode2str(login))
result = con.search_s(dn, scope, filter_, attrs)
if config.get(section, 'active_directory'):
@@ -143,8 +150,10 @@ class User:
users = cls.ldap_search_user(user.login, con, attrs=[uid])
if users and len(users) == 1:
[(dn, attrs)] = users
- if con.simple_bind_s(dn, old_password):
- con.passwd_s(dn, old_password, values['password'])
+ if con.simple_bind_s(dn, unicode2str(old_password)):
+ con.passwd_s(
+ dn, unicode2str(old_password),
+ unicode2str(values['password']))
values = values.copy()
del values['password']
else:
@@ -165,7 +174,8 @@ class User:
users = cls.ldap_search_user(login, con, attrs=[uid])
if users and len(users) == 1:
[(dn, attrs)] = users
- if password and con.simple_bind_s(dn, password):
+ if (password
+ and con.simple_bind_s(dn, unicode2str(password))):
# Use ldap uid so we always get the right case
login = attrs.get(uid, [login])[0]
user_id, _ = cls._get_login(login)
diff --git a/tryton.cfg b/tryton.cfg
index 299814d..02b9c07 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.6.0
+version=3.6.1
depends:
ir
res
diff --git a/trytond_ldap_authentication.egg-info/PKG-INFO b/trytond_ldap_authentication.egg-info/PKG-INFO
index 3009439..6b9879d 100644
--- a/trytond_ldap_authentication.egg-info/PKG-INFO
+++ b/trytond_ldap_authentication.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond-ldap-authentication
-Version: 3.6.0
+Version: 3.6.1
Summary: Tryton module to authenticate users through LDAP
Home-page: http://www.tryton.org/
Author: Tryton
--
tryton-modules-ldap-authentication
More information about the tryton-debian-vcs
mailing list