'Verifies the given username/password combo
:type username: str
:type password: str
:rtype: bool'

def check_password(self, username, password, env=None):

    if ((not username) or (not password)):
        return False
    provider = self.get_sync_provider(fallback=True)
    if ((username == 'root') and (not provider.syncs_root)):
        provider = ajenti.usersync.AjentiSyncProvider.get()
    if (not (username in ajenti.config.tree.users)):
        return False
    try:
        provider.sync()
    except Exception as e:
        logging.error(str(e))
    result = provider.check_password(username, password)
    provider_name = type(provider).__name__
    ip_notion = ''
    ip = (env.get('REMOTE_ADDR', None) if env else None)
    if ip:
        ip_notion = ('    from    %s' % ip)
    if (not result):
        msg = ('failed    login    attempt    for    %s    ("%s")    through    %s%s' % (username, password, provider_name, ip_notion))
        syslog.syslog(syslog.LOG_WARNING, msg)
        logging.warn(msg)
    else:
        msg = ('user    %s    logged    in    through    %s%s' % (username, provider_name, ip_notion))
        syslog.syslog(syslog.LOG_INFO, msg)
        logging.info(msg)
    return result
