-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.py
More file actions
35 lines (31 loc) · 794 Bytes
/
users.py
File metadata and controls
35 lines (31 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from utils import convert_to_binsid
from dbo import execute_query, execute_remove
def get_user(usersid):
return execute_query(f"""
SELECT
_UserID,
hex(UserSid) as UserSid
FROM User
WHERE u.UserSid = {convert_to_binsid(usersid)}
""")
def remove_user(usersid):
return execute_remove(
f"""
DELETE
FROM User
WHERE UserSid = X'{convert_to_binsid(usersid)}'
""",
None,
"User"
)
# def get_user_id(usersid):
# rs = execute_query(f"""
# SELECT _UserID
# FROM User
# WHERE UserSid = X'{convert_to_binsid(usersid)}'
# """)
# try:
# user_id = rs[0][0]
# except IndexError:
# user_id = None
# return user_id