Merge branch 'master' into dev

This commit is contained in:
amcmanu3 2022-06-14 15:49:32 -04:00
commit 17ef71046c
3 changed files with 9 additions and 4 deletions

View File

@ -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")

View File

@ -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(

View File

@ -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"