Leave possibilty to not provide bind DN and Password to connect to LDAP servers
This commit is contained in:
parent
259e3268c6
commit
07048d3e26
1 changed files with 1 additions and 5 deletions
|
@ -145,10 +145,6 @@ if not options.provider or not options.consumer:
|
||||||
print "You must provide provider and customer URI"
|
print "You must provide provider and customer URI"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not options.dn or not options.pwd:
|
|
||||||
print "You must provide DN and password to connect to LDAP servers"
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if not options.basedn:
|
if not options.basedn:
|
||||||
print "You must provide base DN of connection to LDAP servers"
|
print "You must provide base DN of connection to LDAP servers"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -194,7 +190,7 @@ class LdapServer(object):
|
||||||
try:
|
try:
|
||||||
con = ldap.initialize(self.uri)
|
con = ldap.initialize(self.uri)
|
||||||
con.protocol_version = ldap.VERSION3
|
con.protocol_version = ldap.VERSION3
|
||||||
if self.dn != '':
|
if self.dn:
|
||||||
con.simple_bind_s(self.dn,self.pwd)
|
con.simple_bind_s(self.dn,self.pwd)
|
||||||
self.con = con
|
self.con = con
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue