From 380bef6a1d9103318d3bc22ba4c40b0c868e22b5 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Fri, 28 Feb 2014 08:57:28 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20supe?= =?UTF-8?q?rTornado.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superTornado.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/superTornado.py b/superTornado.py index fd20cec..e70f8a9 100644 --- a/superTornado.py +++ b/superTornado.py @@ -115,7 +115,24 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): def on_close(self): print "->Websocket closed" - self.redirect("/disconnection") + if not self.current_user : + iden="IllegalUser" + ficLog.enregDansLog(iden,"Unauthorized user deconnection","IP TO DO") + else : + iden = self.current_user + ficLog.enregDansLog(iden,"Authorized user deconnection","IP TO DO") + + + if confAveug == True: + print '->Send audio alarm deconnection user' + print 'maison.request("GET", "micom/say.php?source=toto&text=Connection%20a%20la%20camera%20rompue")' + else: + print '->Send visual alarm deconnection user' + print 'maison.request("GET", "micom/lamp.php?room=salon1&order=0")' + print"->"+iden+" Deconnection" + + self.clear_cookie("user") + self.redirect("/")