def culdap_auth(un, pwd): l=LdapObject(**settings.LDAPCONFS['culdap']) br=l.authenticate(un,pwd) if br: return True else: return False
def rcldap_auth(un, pwd): l=LdapObject(**settings.LDAPCONFS['rcldap']) br=l.authenticate(un,pwd) if br: rc_user=RcLdapUser.objects.filter(username=un)[0] return rc_user else: return None
def cu_ldap_lookup(username): cu_user_dict = None l=LdapObject(**settings.LDAPCONFS['culdap']) l.bind_priv() l.people_dn = settings.LDAPCONFS['culdap']['people_dn'] try: cu_user_dict = l.find_person(username) except: logger.error('%s: %s'(sys.exc_info[0],sys.exc_info[1])) l.conn.unbind_s() return cu_user_dict[1]
def culdap_auth(self,un, pwd): l=LdapObject(**settings.LDAPCONFS['culdap']) br=l.authenticate(un,pwd)