From: David Adam Date: Sun, 30 Jan 2011 06:06:56 +0000 (+0000) Subject: Use an anonymous LDAP bind to search for MIFARE cards - server ACLs have been updated... X-Git-Url: https://git.ucc.asn.au/?p=zanchey%2Fdispense2.git;a=commitdiff_plain;h=5653725ee6c2beb0b2be5d93589b677a70d30ce2 Use an anonymous LDAP bind to search for MIFARE cards - server ACLs have been updated to allow searches (but not reads) without credentials on this attribute. --- diff --git a/sql-edition/servers/LDAPConnector.py b/sql-edition/servers/LDAPConnector.py index 9e3a307..6a8d67a 100644 --- a/sql-edition/servers/LDAPConnector.py +++ b/sql-edition/servers/LDAPConnector.py @@ -12,12 +12,8 @@ def get_ldap_connection(): #ldap.set_option(ldap.OPT_DEBUG_LEVEL,255) conn = ldap.initialize('ldaps://mussel.ucc.gu.uwa.edu.au:636/') - binddn = 'cn=admin,dc=ucc,dc=gu,dc=uwa,dc=edu,dc=au' - passfile = open('/etc/pam_ldap.secret') - password = passfile.readline().strip() - passfile.close() - - conn.simple_bind_s(binddn, password) + # Anonymous bind - server ACLs should allow searching on uccDispenseMIFARE + conn.simple_bind_s() return conn def get_uid(card_id):