diff options
author | jomo <github@jomo.tv> | 2014-06-23 03:16:09 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-06-23 03:16:09 +0200 |
commit | fa944b4e37f2f56d1b4783b052497884779fc1d8 (patch) | |
tree | a5b168d2926d9d575b423cbb2e3f8d57c63f1f0a /webtoken.py | |
parent | 06a0bf84285e0994c18a020f11ae4f9bae50c200 (diff) |
fix comments
Diffstat (limited to 'webtoken.py')
-rw-r--r-- | webtoken.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/webtoken.py b/webtoken.py index 438e2ba..8c65656 100644 --- a/webtoken.py +++ b/webtoken.py @@ -1,5 +1,5 @@ #pylint: disable=F0401 -import mysqlhack +import mysqlhack #pylint: disable=unused-import import thread from re import match from com.ziclix.python.sql import zxJDBC @@ -43,7 +43,6 @@ def generate_token(length): return token def get_token(uuid): - # ae795aa86327408e92ab25c8a59f3ba1 results = mysql_query("SELECT DISTINCT `token`, `email` FROM register_tokens WHERE `uuid` = ? LIMIT 1", (uuid,)) return results[0] if len(results) == 1 else None @@ -70,8 +69,9 @@ def tokengen_command(sender, args): plugHeader(sender, "Website Token") if isPlayer(sender): if checkargs(sender, args, 1, -1): - # email regex, needs something followed by an @ followed by something - mail = " ".join(args) # email may contain spaces + # email may contain spaces + mail = " ".join(args) + # email regex, needs something followed by an @ followed by domain or IP if match("^.+@(.+\\..{2,}|\\[[0-9a-fA-F:.]+\\])$", mail) != None: token = generate_token(6) uuid = sender.getUniqueId().toString().replace("-", "") |