From a5f770020f072e2718deb747ce19d858e85f27d9 Mon Sep 17 00:00:00 2001 From: Kyep Date: Tue, 31 Oct 2017 20:10:41 -0700 Subject: [PATCH 1/4] Helps prevent blatently illegal executions --- code/game/machinery/computer/security.dm | 21 ++++++++++++++++----- code/modules/admin/topic.dm | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 2643908bab5..c9000505250 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -167,9 +167,16 @@ if(active2) var/their_name = active2.fields["name"] var/their_rank = active2.fields["rank"] - var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN) - if(!t1) - t1 = "(none)" + var/t1 + if(temp_href[2] == "execute") + t1 = copytext(trim(sanitize(input("Explain why they are being executed. Include a list of their crimes, and victims.", "EXECUTION ORDER", null, null) as text)), 1, MAX_MESSAGE_LEN) + if(!t1) + setTemp("

Error: setting someone to execute REQUIRES a valid reason.

") + return 1 + else + t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN) + if(!t1) + t1 = "(none)" switch(temp_href[2]) if("none") active2.fields["criminal"] = "None" @@ -178,10 +185,14 @@ if("execute") if((access_magistrate in authcard_access) || (access_armory in authcard_access)) active2.fields["criminal"] = "*Execute*" - message_admins("[key_name_admin(usr)] authorized execution for [their_rank] [their_name], with comment: [t1]") + message_admins("[key_name_admin(usr)] authorized EXECUTION for [their_rank] [their_name], with comment: [t1] \ + | (PP) \ + | (RADIO) \ + | (SM) \ + | ([admin_jump_link(usr)]) \ + ") else setTemp("

Error: permission denied.

") - //to_chat(usr, "Error: permission denied.") return 1 if("incarcerated") active2.fields["criminal"] = "Incarcerated" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index e3cb19fb6e9..92e44c12825 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1688,9 +1688,9 @@ if(!input) return to_chat(src.owner, "You sent [input] to [H] via a secure channel.") - log_admin("[key_name(src.owner)] replied to [key_name(H)]'s Centcomm message with the message [input].") + log_admin("[key_name(src.owner)] replied to [key_name(H)]'s Centcomm message with the message: [input]") message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)]'s Centcom message with: \"[input]\"") - to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"") + to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows: [input]\" ") else if(href_list["EvilFax"]) if(!check_rights(R_ADMIN)) From 6e7e5aa3550e7c971a070177248a3f3ddfc4a6b6 Mon Sep 17 00:00:00 2001 From: Kyep Date: Wed, 8 Nov 2017 02:18:51 -0800 Subject: [PATCH 2/4] Removes centcom colorizing --- code/modules/admin/topic.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 92e44c12825..e3cb19fb6e9 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1688,9 +1688,9 @@ if(!input) return to_chat(src.owner, "You sent [input] to [H] via a secure channel.") - log_admin("[key_name(src.owner)] replied to [key_name(H)]'s Centcomm message with the message: [input]") + log_admin("[key_name(src.owner)] replied to [key_name(H)]'s Centcomm message with the message [input].") message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)]'s Centcom message with: \"[input]\"") - to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows: [input]\" ") + to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"") else if(href_list["EvilFax"]) if(!check_rights(R_ADMIN)) From c0f0eb792149866eacc7f069763187fc0358b26f Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 11 Nov 2017 16:00:14 -0800 Subject: [PATCH 3/4] Tully requests --- code/game/machinery/computer/security.dm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index c9000505250..4669c683abb 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -170,13 +170,14 @@ var/t1 if(temp_href[2] == "execute") t1 = copytext(trim(sanitize(input("Explain why they are being executed. Include a list of their crimes, and victims.", "EXECUTION ORDER", null, null) as text)), 1, MAX_MESSAGE_LEN) - if(!t1) - setTemp("

Error: setting someone to execute REQUIRES a valid reason.

") - return 1 else t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN) - if(!t1) - t1 = "(none)" + var visible_reason + if(t1) + visible_reason = t1 + else + t1 = "(none)" + visible_reason = "NO REASON PROVIDED" switch(temp_href[2]) if("none") active2.fields["criminal"] = "None" @@ -185,7 +186,7 @@ if("execute") if((access_magistrate in authcard_access) || (access_armory in authcard_access)) active2.fields["criminal"] = "*Execute*" - message_admins("[key_name_admin(usr)] authorized EXECUTION for [their_rank] [their_name], with comment: [t1] \ + message_admins("[key_name_admin(usr)] authorized EXECUTION for [their_rank] [their_name], with comment: [visible_reason] \ | (PP) \ | (RADIO) \ | (SM) \ From 269f2426ff358b6d8fc90d9d04c05a5030efd9b6 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 11 Nov 2017 16:07:10 -0800 Subject: [PATCH 4/4] Tiger requests --- code/game/machinery/computer/security.dm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 4669c683abb..469b3a01d19 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -172,7 +172,7 @@ t1 = copytext(trim(sanitize(input("Explain why they are being executed. Include a list of their crimes, and victims.", "EXECUTION ORDER", null, null) as text)), 1, MAX_MESSAGE_LEN) else t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN) - var visible_reason + var/visible_reason if(t1) visible_reason = t1 else @@ -186,12 +186,7 @@ if("execute") if((access_magistrate in authcard_access) || (access_armory in authcard_access)) active2.fields["criminal"] = "*Execute*" - message_admins("[key_name_admin(usr)] authorized EXECUTION for [their_rank] [their_name], with comment: [visible_reason] \ - | (PP) \ - | (RADIO) \ - | (SM) \ - | ([admin_jump_link(usr)]) \ - ") + message_admins("[ADMIN_FULLMONTY(usr)] authorized EXECUTION for [their_rank] [their_name], with comment: [visible_reason]") else setTemp("

Error: permission denied.

") return 1