Fixed name access
This commit is contained in:
parent
e6a5b24883
commit
534656df64
|
@ -74,7 +74,7 @@ def read_loop():
|
||||||
user = "unknown barcode"
|
user = "unknown barcode"
|
||||||
else:
|
else:
|
||||||
authorized = "authorized" in access[code] and access[code]["authorized"]
|
authorized = "authorized" in access[code] and access[code]["authorized"]
|
||||||
user = access[code]["user"] if "user" in access[code] else code
|
user = access[code]["name"] if "name" in access[code] else code
|
||||||
# If the user is not authorized, deny access
|
# If the user is not authorized, deny access
|
||||||
if not authorized:
|
if not authorized:
|
||||||
s = timestamped("Denied {} ({})\n".format(code, user))
|
s = timestamped("Denied {} ({})\n".format(code, user))
|
||||||
|
@ -82,7 +82,7 @@ def read_loop():
|
||||||
print s,
|
print s,
|
||||||
# If the user is authorized, perform the unlock procedure
|
# If the user is authorized, perform the unlock procedure
|
||||||
else:
|
else:
|
||||||
s = timestamped("Validated {} {}\n".format(code, user))
|
s = timestamped("Validated {} ({})\n".format(code, user))
|
||||||
log_file.write(s)
|
log_file.write(s)
|
||||||
print s,
|
print s,
|
||||||
# TODO: Play open tone
|
# TODO: Play open tone
|
||||||
|
|
Loading…
Reference in New Issue