return
else:
self.vstatus.cur_selection += chr(key + ord('0'))
- if self.vstatus.cur_user:
+ if self.dispense.isLoggedIn():
self.make_selection()
self.vstatus.cur_selection = ''
self.vstatus.time_to_autologout = time() + 8
self.vstatus.cur_pin += chr(key + ord('0'))
self.vstatus.mk.set_message('PIN: '+'X'*len(self.vstatus.cur_pin))
if len(self.vstatus.cur_pin) == PIN_LENGTH:
- self.dispense.authUserIdPin(self.vstatus.cur_user, self.vstatus.cur_pin)
- if self.dispense.getUsername():
+ if self.dispense.authUserIdPin(self.vstatus.cur_user, self.vstatus.cur_pin):
self.vstatus.username = self.dispense.getUsername()
self.v.beep(0, False)
self.vstatus.cur_selection = ''
key = params
if key == 11:
self.vstatus.cur_user = ''
+ self.dispense.logOut()
self.reset_idler()
return
logging.warning("Entering open door mode")
self.v.display("-FEED ME-")
#door_open_mode(v);
+ self.dispense.logOut()
self.vstatus.cur_user = ''
self.vstatus.cur_pin = ''
elif params == 1: #door closed
self._last_card_id = card_id
- self.dispense.authMifareCard(card_id)
- logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
- if not self.dispense.isLoggedIn():
+ if not self.dispense.authMifareCard(card_id):
self.v.beep(40, False)
self.vstatus.mk.set_messages(
[(self.center('BAD CARD'), False, 1.0),
self.reset_idler(2)
return
elif self.dispense.isDisabled():
+ logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
self.v.beep(40, False)
self.vstatus.mk.set_messages(
[(self.center('ACCT DISABLED'), False, 1.0),
self.reset_idler(2)
return
else:
+ logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
self.vstatus.cur_user = '----'
self.vstatus.username = self.dispense.getUsername()
self.vstatus.cur_selection = ''