diff --git a/mysecrets.py b/mysecrets.py index b4f292e..f2b8238 100755 --- a/mysecrets.py +++ b/mysecrets.py @@ -72,27 +72,7 @@ def get_generated_from_url(domain): class index: def GET(self, method): - if method == 'get': - if web.input(): - i = web.input() - selected = get_pair_from_url(i.base_url) - if len(selected) > 0: - pairs = '
Sorry buddy, you're outta luck
" - - body = 'need input.
') - if method == 'new': i = web.input() @@ -122,6 +102,26 @@ class index: return render.page('create',''.join(body)) + + if method == 'create': + i = web.input() + + exists = db.select('passwords', where='username="'+i.username+'" and password="' +\ + i.password+'" and base_url="'+i.base_url+'"') + + if not exists: + n = db.insert('passwords', username=i.username, password=i.password, \ + base_url=i.base_url) + + selected = get_pair_from_url(i.base_url) + + body = ['