Fix another place where logout isn't done
authorJohn Hodge <tpg@ucc.asn.au>
Thu, 15 Jun 2017 04:39:31 +0000 (12:39 +0800)
committerJohn Hodge <tpg@ucc.asn.au>
Thu, 15 Jun 2017 04:39:31 +0000 (12:39 +0800)
VendServer/OpenDispense.py
VendServer/VendServer.py

index a802e78..5e41363 100644 (file)
@@ -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:
index 77cc0bf..e2192b1 100755 (executable)
@@ -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:

UCC git Repository :: git.ucc.asn.au