コード例 #1
0
def search(body):
    db = database()
    results = list()
    leaks = db.getLeaks(body['search'],body['searchby'])
    for leak in leaks:
        results.append({'id':leak.id,'email':leak.email,'username':leak.username,'password':leak.password,'database':leak.database})
    return results
コード例 #2
0
def massInsert(body, request, response):
    leaks = str(body['leakmass']).replace("'b", "").split('\\n')
    count = len(leaks)
    db = database()
    thread = threading.Thread(target=db.saveMassLeaks, args=(leaks, ))
    thread.start()
    message = 'You have loaded %d new leaks the process to register will happen in bakground!' % count
    return "<script>alert('%s');document.location = '/'</script>" % message
コード例 #3
0
def singleInsert(body):
    checks = ['username','password','email','database']
    for c in checks:
        if c not in body:
            return False
    db = database()
    db.insertLeak(username=body['username'],email=body['email'],password=body['password'],database=body['database'])
    message = 'New leak created for e-mail %s' % body['email']
    return {'message':message}
コード例 #4
0
def index():
    template = get_template('index.html')
    db = database()
    totalLeaks = len(db.getAll())
    lastLeaks = db.lastEntries()
    return template.render({'total': totalLeaks, 'leaks': lastLeaks})
コード例 #5
0
def deleteLeak(leakid):
    db = database()
    db.deleteLeak(int(leakid))
    message = 'leak deleted'
    return "<script>alert('%s');document.location = '/'</script>" % message
コード例 #6
0
def updatePassword(body):
    db = database()
    totalupdates = db.updatePassword(body['password-old'],
                                     body['password-new'])
    message = '%d passwords were updated!' % totalupdates
    return {"message": message}