Adds token functionality

This commit is contained in:
ItsSelis
2022-12-11 13:50:52 +01:00
parent edc51a4684
commit cd3356ead9
10 changed files with 188 additions and 101 deletions
+19
View File
@@ -1,3 +1,19 @@
/datum/admins/proc/CheckAdminHref(href, href_list)
var/auth = href_list["admin_token"]
. = auth && (auth == href_token || auth == GLOB.href_token)
if(.)
return
var/msg = !auth ? "no" : "a bad"
message_admins("[key_name_admin(usr)] clicked an href with [msg] authorization key!")
var/debug_admin_hrefs = TRUE // Remove once everything is converted over
if(debug_admin_hrefs)
message_admins("Debug mode enabled, call not blocked. Please ask your coders to review this round's logs.")
log_world("UAH: [href]")
return TRUE
log_admin("[key_name(usr)] clicked an href with [msg] authorization key! [href]")
/datum/admins/Topic(href, href_list)
..()
@@ -6,6 +22,9 @@
message_admins("[usr.key] has attempted to override the admin panel!")
return
if(!CheckAdminHref(href, href_list))
return
if(ticker.mode && ticker.mode.check_antagonists_topic(href, href_list))
check_antagonists()
return