mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Cleanup ajax handler
send audit log entry on stdin call
This commit is contained in:
parent
81e4e7e450
commit
a373943ae6
@ -281,13 +281,7 @@ class AjaxHandler(BaseHandler):
|
||||
exec_user["user_id"], server_id
|
||||
)
|
||||
|
||||
if page == "send_order":
|
||||
self.controller.users.update_server_order(
|
||||
exec_user["user_id"], bleach.clean(self.get_argument("order"))
|
||||
)
|
||||
return
|
||||
|
||||
elif page == "select_photo":
|
||||
if page == "select_photo":
|
||||
if exec_user["superuser"]:
|
||||
photo = urllib.parse.unquote(self.get_argument("photo", ""))
|
||||
opacity = self.get_argument("opacity", 100)
|
||||
|
@ -35,7 +35,13 @@ class ApiServersServerStdinHandler(BaseApiHandler):
|
||||
"Please report this to the devs"
|
||||
)
|
||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||
|
||||
decoded = self.request.body.decode("utf-8")
|
||||
self.controller.management.add_to_audit_log(
|
||||
auth_data[4]["user_id"],
|
||||
f"Sent command ({decoded}) to terminal",
|
||||
server_id=0,
|
||||
source_ip=self.get_remote_ip(),
|
||||
)
|
||||
if svr.send_command(self.request.body.decode("utf-8")):
|
||||
return self.finish_json(
|
||||
200,
|
||||
|
Loading…
Reference in New Issue
Block a user