Merge branch 'master' of gitorious@git.hq.c3d2.de:moleflap/software

This commit is contained in:
Moleflap hackers 2010-10-26 23:15:59 +02:00
commit 6682b1fcf9
1 changed files with 3 additions and 2 deletions

View File

@ -66,15 +66,16 @@ if name == "" then
print "ERROR - token already exists .. please try again."
exit(env,con)
end
cur = con:execute("insert into users (name, ntc) values ('"..name.."', 1);")
if cur == 1 then
print("* add user " .. name)
else
assert(con:execute("update users set ntc=ntc+1 where name='"..name.."';"))
end
ttl = os.time() + config.ttl
ttl = os.time() + config.ttl
assert(con:execute("insert into tokens (prefix, token, ttl) values ('"..prefix.."', '"..token.."', "..ttl..");"))
assert(con:execute("delete from graveyard where prefix='"..prefix.."';"))
print "* add token:"
print(token)
print("* prefix to remember: "..prefix)