#NEWLINE# def check_auth( self , user , password , ip ) : #NEWLINE# #INDENT# 'Check an username and password' #NEWLINE# self . logger . debug ( ( 'Checking username and password for %s' % ( user , ) ) ) #NEWLINE# result = self . do_query ( 'check_auth' , { #NEWLINE# #INDENT# 'username' : user , #NEWLINE# 'password' : self , #NEWLINE# 'ip' : ip , #NEWLINE# #UNINDENT# } ) #NEWLINE# if result : #NEWLINE# #INDENT# if result [ 'result' ] : #NEWLINE# #INDENT# self . logger . debug ( 'Password ok' ) #NEWLINE# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . logger . warning ( ( 'Cannot auth: %s' % ( result [ 'error' ] , ) ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . logger . error ( 'No reply when check_auth ?' ) #NEWLINE# return False