diff --git a/app/classes/shared/import3.py b/app/classes/shared/import3.py index c04e0ae8..5cb2bfa6 100644 --- a/app/classes/shared/import3.py +++ b/app/classes/shared/import3.py @@ -39,7 +39,9 @@ class Import3: if isinstance(json_data, list): for user in json_data: if str(user["username"]).lower() != "admin": - HelperUsers.add_rawpass_user(user["username"], user["password"]) + HelperUsers.add_rawpass_user( + str(user["username"]).lower(), user["password"] + ) Console.info(f"Imported user {user['username']} from Crafty 3") logger.info(f"Imported user {user['username']} from Crafty 3") else: @@ -47,7 +49,7 @@ class Import3: else: if str(json_data["username"]).lower() != "admin": HelperUsers.add_rawpass_user( - json_data["username"], json_data["password"] + str(json_data["username"]).lower(), json_data["password"] ) Console.info(f"Imported user {json_data['username']} from Crafty 3") logger.info(f"Imported user {json_data['username']} from Crafty 3") diff --git a/app/classes/shared/main_controller.py b/app/classes/shared/main_controller.py index dbcb4dbc..95599384 100644 --- a/app/classes/shared/main_controller.py +++ b/app/classes/shared/main_controller.py @@ -82,6 +82,8 @@ class Controller: if exec_user["preparing"]: return self.users.set_prepare(exec_user["user_id"]) + # Delete previous instace of logs + self.del_support_file(exec_user["support_logs"]) # pausing so on screen notifications can run for user time.sleep(7) self.helper.websocket_helper.broadcast_user( @@ -177,6 +179,8 @@ class Controller: FileHelpers.del_file(temp_zip_storage) except FileNotFoundError: logger.info("No temp file found. Assuming it's already been cleaned up") + except PermissionError: + logger.error("Unable to remove old logs. Permission denied error.") def add_system_user(self): self.users_helper.add_user( diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 610c74eb..ed8f3a73 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -1250,7 +1250,6 @@ class PanelHandler(BaseHandler): # same time, the chunks in memory will keep # increasing and will eat up the RAM del chunk - self.controller.del_support_file(temp_zip_storage) self.redirect("/panel/dashboard") else: self.redirect("/panel/error?error=No path found for support logs") @@ -1769,7 +1768,7 @@ class PanelHandler(BaseHandler): self.redirect(f"/panel/server_detail?id={server_id}&subpage=schedules") elif page == "edit_user": - if bleach.clean(self.get_argument("username", None)) == "system": + if bleach.clean(self.get_argument("username", None)).lower() == "system": self.redirect( "/panel/error?error=Unauthorized access: " "system user is not editable"