projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use ldap.initialize instead of ldap.open for compatibility with python-ldap 3.2.0.
[mirror/userdir-ldap.git]
/
userdir_ldap.py
diff --git
a/userdir_ldap.py
b/userdir_ldap.py
index
d47909d
..
22722e4
100644
(file)
--- a/
userdir_ldap.py
+++ b/
userdir_ldap.py
@@
-135,7
+135,7
@@
def connectLDAP(server=None):
if server is None:
global LDAPServer
server = LDAPServer
if server is None:
global LDAPServer
server = LDAPServer
- lc = ldap.
open(
server)
+ lc = ldap.
initialize('ldap://%s' %
server)
global UseSSL
if UseSSL:
lc.start_tls_s()
global UseSSL
if UseSSL:
lc.start_tls_s()
@@
-244,7
+244,7
@@
def HashPass(Password):
Salt = Salt + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)]
Pass = crypt.crypt(Password, Salt)
if len(Pass) < 14:
Salt = Salt + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)]
Pass = crypt.crypt(Password, Salt)
if len(Pass) < 14:
- raise
"Password Error", "MD5 password hashing failed, not changing the password!"
+ raise
Exception("MD5 password hashing failed, not changing the password!")
return Pass
return Pass