mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
17ef71046c
@ -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")
|
||||
|
@ -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(
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user