Compare commits

..

No commits in common. "e65f6024d3ed10a52c7a667dc419db6c5ed3ed06" and "2d963de60f6c0326e47291e443e3534f218c0858" have entirely different histories.

2 changed files with 22 additions and 30 deletions

View file

@ -66,41 +66,34 @@ class Auth():
pc_uuid = str(kwargs["pc_uuid"]) pc_uuid = str(kwargs["pc_uuid"])
pc_token = str(kwargs["pc_token"]) pc_token = str(kwargs["pc_token"])
if "device_list" in kwargs: if "device_list" in kwargs:
if kwargs["device_list"] == []: device_list = kwargs["device_list"]
device_list = None
else:
device_list = kwargs["device_list"]
else: else:
device_list = None pass
keyboard_number = "own"
keyboard_number = 0 mouse_number = "own"
mouse_number = 0
if "password_hash" in kwargs: if "password_hash" in kwargs:
password_hash = str(kwargs["password_hash"]) password_hash = str(kwargs["password_hash"])
cursor.execute("SELECT * FROM pc_list WHERE pc_number = %s AND password_hash = %s AND pc_uuid = %s AND pc_token = %s", (pc_number, password_hash, pc_uuid, pc_token)) cursor.execute("SELECT * FROM pc_list WHERE pc_number = %s AND password_hash = %s AND pc_uuid = %s AND pc_token = %s", (pc_number, password_hash, pc_uuid, pc_token))
pc_info = cursor.fetchall() pc_info = cursor.fetchall()
if pc_info: if pc_info:
if device_list == None: for device in device_list:
pass cursor.execute("SELECT * FROM keyboard_list WHERE device_instance_path = %s", (device["device_instance_path"],))
else: keyboard_record = cursor.fetchall()
for device in device_list: if keyboard_record:
cursor.execute("SELECT * FROM keyboard_list WHERE device_instance_path = %s", (device["device_instance_path"],)) keyboard_number = int(keyboard_record[0][0])
keyboard_record = cursor.fetchall() break
if keyboard_record: else:
keyboard_number = int(keyboard_record[0][0]) pass
break
else: for device in device_list:
pass cursor.execute("SELECT * FROM mouse_list WHERE device_instance_path = %s", (device["device_instance_path"],))
mouse_record = cursor.fetchall()
for device in device_list: if mouse_record:
cursor.execute("SELECT * FROM mouse_list WHERE device_instance_path = %s", (device["device_instance_path"],)) mouse_number = int(mouse_record[0][0])
mouse_record = cursor.fetchall() break
if mouse_record: else:
mouse_number = int(mouse_record[0][0]) pass
break
else:
pass
return {"result": 0, "about": "ok", "output_dict": {"keyboard_number": keyboard_number, "mouse_number": mouse_number}} return {"result": 0, "about": "ok", "output_dict": {"keyboard_number": keyboard_number, "mouse_number": mouse_number}}
else: else:

View file

@ -388,8 +388,7 @@ class Lock(customtkinter.CTkToplevel):
def auth(self): def auth(self):
self.button_disable() self.button_disable()
password = str(self.password_entry.get()) password = str(self.password_entry.get())
#devices = self.get_input_devices() devices = self.get_input_devices()
devices = []
if len(password) == 10: if len(password) == 10:
print("マスターパスワードで認証を試行します。") print("マスターパスワードで認証を試行します。")