From: John Hodge Date: Thu, 15 Jun 2017 04:39:31 +0000 (+0800) Subject: Fix another place where logout isn't done X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=f637edb6d0ea97beb255ad87685844c1eb26c89b;p=uccvend-vendserver.git Fix another place where logout isn't done --- diff --git a/VendServer/OpenDispense.py b/VendServer/OpenDispense.py index a802e78..5e41363 100644 --- a/VendServer/OpenDispense.py +++ b/VendServer/OpenDispense.py @@ -88,8 +88,10 @@ class OpenDispense(DispenseInterface): sockf.write("AUTHCARD %s\n" % (card_base64,)); sockf.flush() rsp = sockf.readline() if not "200" in rsp: + logging.info("Rejected card base64:%s" % (card_base64,)) return False username = rsp.split('=')[1].strip() + logging.info("Accepted card base64:%s for %s" % (card_base64,username,)) # Check for thier username try: diff --git a/VendServer/VendServer.py b/VendServer/VendServer.py index 77cc0bf..e2192b1 100755 --- a/VendServer/VendServer.py +++ b/VendServer/VendServer.py @@ -336,12 +336,14 @@ class VendServer(): self.vstatus.last_timeout_refresh = int(time_left) self.vstatus.cur_selection = '' + # Login timed out: Log out the current user. if self.vstatus.time_to_autologout != None and self.vstatus.time_to_autologout - time() <= 0: self.vstatus.time_to_autologout = None self.vstatus.cur_user = '' self.vstatus.cur_pin = '' self.vstatus.cur_selection = '' self._last_card_id = -1 + self.dispense.logOut() self.reset_idler() ### State fully logged out ... reset variables @@ -382,6 +384,7 @@ class VendServer(): if key == 11: self.vstatus.cur_selection = '' self.vstatus.time_to_autologout = None + self.dispense.logOut() self.scroll_options(self.vstatus.username, self.vstatus.mk) return else: