(self, l, login_name, password)
return True
Login the user
Login the user
Login the user
def login_now(self, l, login_name, password):
        '''Login the user'''

        scope = ldap.SCOPE_SUBTREE
        filter = "(&(objectClass=user)(sAMAccountName=%s))" % login_name
        attrs = ['*']

        r = l.search(self.base_dn, scope, filter, attrs)
        Type, user = l.result(r,60)
        name, attrs = user[0]

        if isinstance(attrs,dict) and 'distinguishedName' in attrs:
            distinguishedName = attrs['distinguishedName'][0]
            if Common.IS_Pv3:
                distinguishedName = distinguishedName.decode()

            l.simple_bind_s(distinguishedName, password)

        return True
def login_now ( self , l , login_name , password ) : scope = ldap . SCOPE_SUBTREE filter = "(&(objectClass=user)(sAMAccountName=%s))" % login_name attrs = [ '*' ] r = l . search ( self . base_dn , scope , filter , attrs ) Type , user = l . result ( r , 60 ) name , attrs = user [ 0 ] if isinstance ( attrs , dict ) and 'distinguishedName' in attrs : distinguishedName = attrs [ 'distinguishedName' ] [ 0 ] if Common . IS_Pv3 : distinguishedName = distinguishedName . decode ( ) l . simple_bind_s ( distinguishedName , password ) return True