summaryrefslogtreecommitdiff
path: root/login.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-01-15 21:03:42 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-01-15 21:03:42 +0100
commit5d6a8c8939382c4c6fb9f3205a865606a28c9b42 (patch)
tree0b63444d49757f7efb26af7386359885639fe1d2 /login.py
parentdd4f295a0c0ca578922bddb9da36f87f5d7ad1b4 (diff)
downloadauth-xmppmessage-5d6a8c8939382c4c6fb9f3205a865606a28c9b42.tar.gz
auth-xmppmessage-5d6a8c8939382c4c6fb9f3205a865606a28c9b42.zip
send clickable link in jabber message
Diffstat (limited to 'login.py')
-rwxr-xr-xlogin.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/login.py b/login.py
index 584398c..019cbf7 100755
--- a/login.py
+++ b/login.py
@@ -5,6 +5,7 @@ import sys
import time
import struct
import hashlib
+from urllib.parse import quote as urlencode
# To speed up start time load some modules only as needed
@@ -65,6 +66,8 @@ def token_message(username, secret, validsec):
time.strftime("%c %Z(%z)", time.gmtime(time_next_end)))
message += "\nRequested by: {} for: {} on: {}".format(
os.getenv("IP"), ascii(os.getenv("URI")), os.getenv("HTTP_HOST"))
+ message += "\nhttps://{}:{}@{}{}".format(urlencode(username),
+ token, os.getenv("HTTP_HOST"), urlencode(os.getenv("URI")))
return message