diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index f1535306328..410f66b3056 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -238,7 +238,7 @@ if(70 to INFINITY) return "elderly" else return "unknown" -/proc/set_criminal_status(mob/living/user, datum/data/record/target_records , criminal_status, comment, user_rank, list/authcard_access = list()) +/proc/set_criminal_status(mob/living/user, datum/data/record/target_records , criminal_status, comment, user_rank, list/authcard_access = list(), user_name) var/status = criminal_status var/their_name = target_records.fields["name"] var/their_rank = target_records.fields["rank"] @@ -268,7 +268,7 @@ status = SEC_RECORD_STATUS_RELEASED target_records.fields["criminal"] = status log_admin("[key_name_admin(user)] set secstatus of [their_rank] [their_name] to [status], comment: [comment]") - target_records.fields["comments"] += "Set to [status] by [user.name] ([user_rank]) on [GLOB.current_date_string] [station_time_timestamp()], comment: [comment]" + target_records.fields["comments"] += "Set to [status] by [user_name || user.name] ([user_rank]) on [GLOB.current_date_string] [station_time_timestamp()], comment: [comment]" update_all_mob_security_hud() return 1 diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index e2b5d89173e..87316384c32 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -10,8 +10,6 @@ icon_keyboard = "security_key" icon_screen = "security" circuit = /obj/item/circuitboard/secure_data - /// The inserted ID card's access list. - var/list/inserted_id_access = null /// The current page being viewed. var/current_page = SEC_DATA_R_LIST /// The current general record being viewed. @@ -366,7 +364,8 @@ if((status in list(SEC_RECORD_STATUS_EXECUTE, SEC_RECORD_STATUS_DEMOTE)) && !length(answer)) set_temp("A valid reason must be provided for this status.", "danger") return - if(!set_criminal_status(usr, record_security, status, answer, tgui_login_get().rank, inserted_id_access)) + var/datum/tgui_login/state = tgui_login_get() + if(!set_criminal_status(usr, record_security, status, answer, state.rank, state.access, state.name)) set_temp("Required permissions to set this criminal status not found!", "danger") if("comment_add") var/datum/tgui_login/state = tgui_login_get() @@ -437,12 +436,6 @@ is_printing = FALSE SStgui.update_uis(src) -/obj/machinery/computer/secure_data/tgui_login_on_login(datum/tgui_login/state) - inserted_id_access = state?.id?.access - -/obj/machinery/computer/secure_data/tgui_login_on_logout(datum/tgui_login/state) - inserted_id_access = null - /obj/machinery/computer/secure_data/emp_act(severity) if(stat & (BROKEN|NOPOWER)) ..(severity) diff --git a/code/modules/tgui/plugins/login.dm b/code/modules/tgui/plugins/login.dm index 16cda18c640..ae0ac9c028e 100644 --- a/code/modules/tgui/plugins/login.dm +++ b/code/modules/tgui/plugins/login.dm @@ -129,6 +129,7 @@ GLOBAL_LIST(tgui_logins) if(check_access(state.id)) state.name = state.id.registered_name state.rank = state.id.assignment + state.access = state.id.access else if(login_type == LOGIN_TYPE_AI && isAI(usr)) state.name = usr.name state.rank = "AI" @@ -137,9 +138,9 @@ GLOBAL_LIST(tgui_logins) state.name = usr.name state.rank = "[R.modtype] [R.braintype]" else if(login_type == LOGIN_TYPE_ADMIN && usr.can_admin_interact()) - state.name = "CentComm Secure Connection" - state.rank = "*CONFIDENTIAL*" - message_admins("[ADMIN_FULLMONTY(usr)] has logged in to [ADMIN_VV(src, name)] as Aghost") + state.name = "*CONFIDENTIAL*" + state.rank = "CentComm Secure Connection" + state.access = get_all_accesses() + get_all_centcom_access() state.logged_in = TRUE tgui_login_on_login(state = state) @@ -158,6 +159,7 @@ GLOBAL_LIST(tgui_logins) state.name = "" state.rank = "" + state.access = null state.logged_in = FALSE tgui_login_on_logout(state = state) @@ -201,9 +203,11 @@ GLOBAL_LIST(tgui_logins) var/obj/item/card/id/id = null var/name = "" var/rank = "" + var/list/access = null var/logged_in = FALSE -/datum/tgui_login/New(id, name, rank) +/datum/tgui_login/New(id, name, rank, access) src.id = id src.name = name src.rank = rank + src.access = access