Leave possibilty to not provide bind DN and Password to connect to LDAP servers
Benjamin Renard

Benjamin Renard commited on 2014-08-07 08:27:02
Showing 1 changed files, with 1 additions and 5 deletions.

... ...
@@ -145,10 +145,6 @@ if not options.provider or not options.consumer:
145 145
 	print "You must provide provider and customer URI"
146 146
 	sys.exit(1)
147 147
 
148
-if not options.dn or not options.pwd:
149
-	print "You must provide DN and password to connect to LDAP servers"
150
-	sys.exit(1)
151
-
152 148
 if not options.basedn:
153 149
 	print "You must provide base DN of connection to LDAP servers"
154 150
 	sys.exit(1)
... ...
@@ -194,7 +190,7 @@ class LdapServer(object):
194 190
 			try:
195 191
 				con = ldap.initialize(self.uri)
196 192
 				con.protocol_version = ldap.VERSION3
197
-				if self.dn != '':
193
+				if self.dn:
198 194
 					con.simple_bind_s(self.dn,self.pwd)
199 195
 				self.con = con
200 196
 				return True
201 197