From 60573fc9ecc94ab42a9fb2f6a38054433543fb7d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 29 Jul 2024 15:45:45 +0200 Subject: [PATCH] ADD /report --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7159898..30a3078 100644 --- a/main.py +++ b/main.py @@ -343,6 +343,7 @@ async def reporting(get: CL.CL_REPORTING,api_key: APIKey = Depends(auth.get_api_ user_check = database(f"SELECT username from users where username = '{get.username}'","Kunden","") if not user_check: print("User not exist") + # TBD add Message to Admin by Gotify or E-Mail else: entry = database(f"SELECT s.customer_ID,s.service_ID from `server` s where s.privat_ipaddress LIKE '%{get.ipaddress}%'","Kunden","") customer_ID = entry[0][0] @@ -350,7 +351,7 @@ async def reporting(get: CL.CL_REPORTING,api_key: APIKey = Depends(auth.get_api_ reportingdate = datetime.now() reportingdate = reportingdate.strftime("%Y-%m-%d %H:%M:%S") print(reportingdate) - #database(f"INSERT INTO `Kunden.services.reporting` (username,service_ID,customer_ID,reportingdate,lastaccess) VALUES ('{get.username}','{service_ID}','{customer_ID}',{reportingdate}',{get.lastaccess}'","","") + database(f"INSERT INTO `Kunden.services.reporting` (username,service_ID,customer_ID,reportingdate,lastaccess) VALUES ('{get.username}','{service_ID}','{customer_ID}',{reportingdate}',{get.lastaccess}'","","") print(f"{service_ID} - {customer_ID}")