Updated snack config to use `dispense iteminfo` for prices (goodbye config file)
[uccvend-vendserver.git] / sql-edition / servers / LDAPConnector.py
index 9e3a307..60408d0 100644 (file)
@@ -10,13 +10,13 @@ def get_ldap_connection():
         ldap.set_option(ldap.OPT_X_TLS,1)
         ldap.set_option(ldap.OPT_X_TLS_ALLOW,1)
         #ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
         ldap.set_option(ldap.OPT_X_TLS,1)
         ldap.set_option(ldap.OPT_X_TLS_ALLOW,1)
         #ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
-        conn = ldap.initialize('ldaps://mussel.ucc.gu.uwa.edu.au:636/')
+        conn = ldap.initialize('ldaps://mussel.ucc.gu.uwa.edu.au/')
         
         
-        binddn = 'cn=admin,dc=ucc,dc=gu,dc=uwa,dc=edu,dc=au'
-        passfile = open('/etc/pam_ldap.secret')
+        binddn = 'cn=mifareagent,ou=profile,dc=ucc,dc=gu,dc=uwa,dc=edu,dc=au'
+        passfile = open('/etc/dispense2/ldap.passwd')
         password = passfile.readline().strip()
         passfile.close()
         password = passfile.readline().strip()
         passfile.close()
-
+        
         conn.simple_bind_s(binddn, password)
         return conn
 
         conn.simple_bind_s(binddn, password)
         return conn
 
@@ -72,5 +72,5 @@ def set_card_id(uidNumber, card_id):
             ldapconn.unbind()
 
 if __name__ == '__main__':
             ldapconn.unbind()
 
 if __name__ == '__main__':
-        #print get_uid('\x01\x02\x03\x04\x05\x06')
-        set_card_id('11251', '\x01\x02\x03\x04\x05\x06')
+        set_card_id('11126', '\x01\x02\x03\x04\x05\x06')
+        print get_uid('\x01\x02\x03\x04\x05\x06')

UCC git Repository :: git.ucc.asn.au