Files
Bubberstation/code/modules/admin/admin_investigate.dm
Timberpoes 4d31e6f2a7 ID Card access change logging, Part 2 (#56155)
I've condensed the logging into a single define, to allow ID card logging to be easily tweaked and to clean up some messy copy-pasted code.

There is no longer admin messaging for Head of Staff accesses, but it's all still logged as it was before.

There is a new option for the Investigate verb.

Which has the complete logging history for ID card changes that are currently tracked, all in one place.

Which admins can ALSO access from Get Current Logs and Get Server Logs for past rounds via id_card_changes.html
2021-01-14 20:33:33 -05:00

43 lines
1.6 KiB
Plaintext

/atom/proc/investigate_log(message, subject)
if(!message || !subject)
return
var/F = file("[GLOB.log_directory]/[subject].html")
WRITE_FILE(F, "[time_stamp()] [REF(src)] ([x],[y],[z]) || [src] [message]<br>")
/client/proc/investigate_show()
set name = "Investigate"
set category = "Admin.Game"
if(!holder)
return
var/list/investigates = list(INVESTIGATE_RESEARCH, INVESTIGATE_EXONET, INVESTIGATE_PORTAL, INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY, INVESTIGATE_HALLUCINATIONS, INVESTIGATE_RADIATION, INVESTIGATE_NANITES, INVESTIGATE_PRESENTS, INVESTIGATE_HYPERTORUS, INVESTIGATE_ACCESSCHANGES)
var/list/logs_present = list("notes, memos, watchlist")
var/list/logs_missing = list("---")
for(var/subject in investigates)
var/temp_file = file("[GLOB.log_directory]/[subject].html")
if(fexists(temp_file))
logs_present += subject
else
logs_missing += "[subject] (empty)"
var/list/combined = sortList(logs_present) + sortList(logs_missing)
var/selected = input("Investigate what?", "Investigate") as null|anything in combined
if(!(selected in combined) || selected == "---")
return
selected = replacetext(selected, " (empty)", "")
if(selected == "notes, memos, watchlist" && check_rights(R_ADMIN))
browse_messages()
return
var/F = file("[GLOB.log_directory]/[selected].html")
if(!fexists(F))
to_chat(src, "<span class='danger'>No [selected] logfile was found.</span>", confidential = TRUE)
return
src << browse(F,"window=investigate[selected];size=800x300")