parameters: (self, l, login_name, password)
return_statement: return True
docstring: Login the user
docstring_summary: Login the user
docstring_tokens: Login the user
function: 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
function_tokens: 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