summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-08-31 17:11:35 +0800
committerTeddy <[email protected]>2013-08-31 17:11:35 +0800
commit10d9a349c911825eb36704c92702fbea7eae32d7 (patch)
tree3a5d8d65421a8114181f0a56ade69c1eb7aaaf14
parentd8c8ba04baeed4f11003d5483890f6cafbc55fb0 (diff)
close push tunnel when the password being changed
-rw-r--r--server/piztor/server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/piztor/server.py b/server/piztor/server.py
index d175d99..d9e8bc3 100644
--- a/server/piztor/server.py
+++ b/server/piztor/server.py
@@ -679,6 +679,13 @@ class ChangePasswordHandler(RequestHandler):
uauth.set_password(new_pass)
self.session.commit()
logger.info("Password changed successfully!")
+
+ pt = RequestHandler.push_tunnels
+ uid = uauth.uid
+ pt[uid].close()
+ del pt[uid]
+ uauth.regen_token()
+
return self.pack(struct.pack("!B", _StatusCode.sucess))