'@param runQuery: This will be called to get the info from the db.
Generally you\'d want to create a
L{twisted.enterprice.adbapi.ConnectionPool} and pass it\'s runQuery
method here. Otherwise pass a function with the same prototype.
@type runQuery: C{callable}
@type query: query used to authenticate user.
@param query: C{str}
@param customCheckFunc: Use this if the passwords in the db are stored
as hashes. We\'ll just call this, so you can do the checking
yourself. It takes the following params:
(username, suppliedPass, dbPass) and must return a boolean.
@type customCheckFunc: C{callable}
@param caseSensitivePasswords: If true requires that every letter in
C{credentials.password} is exactly the same case as the it\'s
counterpart letter in the database.
This is only relevant if C{customCheckFunc} is not used.
@type caseSensitivePasswords: C{bool}'

def __init__(self, runQuery, query='SELECT    username,    password    FROM    user    WHERE    username    =    %s', customCheckFunc=None, caseSensitivePasswords=True):

    self.runQuery = runQuery
    self.caseSensitivePasswords = caseSensitivePasswords
    self.customCheckFunc = customCheckFunc
    if customCheckFunc:
        self.credentialInterfaces = (IUsernamePassword,)
    else:
        self.credentialInterfaces = (IUsernamePassword, IUsernameHashedPassword)
    self.sql = query
