[MIRROR] Failed logins should log the ckey, not the key [MDB IGNORE] (#20498)

* Failed logins should log the ckey, not the key

* Update IsBanned.dm

---------

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: lessthnthree <three@lessthanthree.dk>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-04-12 16:42:59 +00:00
committed by GitHub
co-authored by Kyle Spier-Swenson lessthnthree Zonespace
parent bc1963c985
commit 196e3afb8c
+15 -15
View File
@@ -43,8 +43,8 @@
var/client_is_in_db = query_client_in_db.NextRow()
if(!client_is_in_db)
var/reject_message = "Failed Login: [key] [address]-[computer_id] - New Account attempting to connect during panic bunker, but was rejected due to no prior connections to game servers (no database entry)"
var/reject_message = "Failed Login: [ckey] [address]-[computer_id] - New Account attempting to connect during panic bunker, but was rejected due to no prior connections to game servers (no database entry)"
log_access(reject_message)
if (message)
message_admins(span_adminnotice("[reject_message]"))
@@ -54,21 +54,21 @@
if(!real_bans_only && !C && CONFIG_GET(flag/usewhitelist))
if(!check_whitelist(ckey))
if (admin)
log_admin("The admin [key] has been allowed to bypass the whitelist")
log_admin("The admin [ckey] has been allowed to bypass the whitelist")
if (message)
message_admins(span_adminnotice("The admin [key] has been allowed to bypass the whitelist"))
message_admins(span_adminnotice("The admin [ckey] has been allowed to bypass the whitelist"))
addclientmessage(ckey,span_adminnotice("You have been allowed to bypass the whitelist"))
else
log_access("Failed Login: [key] - Not on whitelist")
log_access("Failed Login: [ckey] - Not on whitelist")
return list("reason"="whitelist", "desc" = "\nReason: You are not on the white list for this server")
//Guest Checking
if(!real_bans_only && !C && is_guest_key(key))
if (CONFIG_GET(flag/guest_ban))
log_access("Failed Login: [key] - Guests not allowed")
log_access("Failed Login: [ckey] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
if (CONFIG_GET(flag/panic_bunker) && SSdbcore.Connect())
log_access("Failed Login: [key] - Guests not allowed during panic bunker")
log_access("Failed Login: [ckey] - Guests not allowed during panic bunker")
return list("reason"="guest", "desc"="\nReason: Sorry but the server is currently not accepting connections from never before seen players or guests. If you have played on this server with a byond account before, please log in to the byond account you have played from.")
//Population Cap Checking
@@ -77,7 +77,7 @@
var/popcap_value = GLOB.clients.len
if(popcap_value >= extreme_popcap && !GLOB.joined_player_list.Find(ckey))
if(!CONFIG_GET(flag/byond_member_bypass_popcap) || !world.IsSubscribed(ckey, "BYOND"))
log_access("Failed Login: [key] - Population cap reached")
log_access("Failed Login: [ckey] - Population cap reached")
return list("reason"="popcap", "desc"= "\nReason: [CONFIG_GET(string/extreme_popcap_message)]")
if(CONFIG_GET(flag/sql_enabled))
@@ -91,16 +91,16 @@
for(var/i in ban_details)
if(admin)
if(text2num(i["applies_to_admins"]))
var/msg = "Admin [key] is admin banned, and has been disallowed access."
var/msg = "Admin [ckey] is admin banned, and has been disallowed access."
log_admin(msg)
if (message)
message_admins(msg)
else
var/msg = "Admin [key] has been allowed to bypass a matching non-admin ban on [i["key"]] [i["ip"]]-[i["computerid"]]."
var/msg = "Admin [ckey] has been allowed to bypass a matching non-admin ban on [ckey(i["key"])] [i["ip"]]-[i["computerid"]]."
log_admin(msg)
if (message)
message_admins(msg)
addclientmessage(ckey,span_adminnotice("Admin [key] has been allowed to bypass a matching non-admin ban on [i["key"]] [i["ip"]]-[i["computerid"]]."))
addclientmessage(ckey,span_adminnotice("Admin [ckey] has been allowed to bypass a matching non-admin ban on [i["key"]] [i["ip"]]-[i["computerid"]]."))
continue
var/expires = "This is a permanent ban."
var/global_ban = "This is a global ban from all of our servers." //SKYRAT EDIT ADDITION - MULTISERVER
@@ -113,7 +113,7 @@
This ban (BanID #[i["id"]]) was applied by [i["admin_key"]] on [i["bantime"]] during round ID [i["round_id"]].
[global_ban]
[expires]"}
log_suspicious_login("Failed Login: [key] [computer_id] [address] - Banned (#[i["id"]]) [text2num(i["global_ban"]) ? "globally" : "locally"]") //SKYRAT EDIT CHANGE - MULTISERVER
log_suspicious_login("Failed Login: [ckey] [computer_id] [address] - Banned (#[i["id"]]) [text2num(i["global_ban"]) ? "globally" : "locally"]") //SKYRAT EDIT CHANGE - MULTISERVER
return list("reason"="Banned","desc"="[desc]")
if (admin)
if (GLOB.directory[ckey])
@@ -236,9 +236,9 @@
//ie, ones where the "apply to this game only" checkbox is not checked (defaults to not checked)
//So it's safe to let admins walk thru host/sticky bans here
if (admin)
log_admin("The admin [key] has been allowed to bypass a matching host/sticky ban on [bannedckey]")
log_admin("The admin [ckey] has been allowed to bypass a matching host/sticky ban on [bannedckey]")
if (message)
message_admins(span_adminnotice("The admin [key] has been allowed to bypass a matching host/sticky ban on [bannedckey]"))
message_admins(span_adminnotice("The admin [ckey] has been allowed to bypass a matching host/sticky ban on [bannedckey]"))
addclientmessage(ckey,span_adminnotice("You have been allowed to bypass a matching host/sticky ban on [bannedckey]"))
return null
@@ -247,7 +247,7 @@
var/desc = "\nReason:(StickyBan) You, or another user of this computer or connection ([bannedckey]) is banned from playing here. The ban reason is:\n[ban["message"]]\nThis ban was applied by [ban["admin"]]\nThis is a BanEvasion Detection System ban, if you think this ban is a mistake, please wait EXACTLY 6 seconds, then try again before filing an appeal.\n"
. = list("reason" = "Stickyban", "desc" = desc)
log_suspicious_login("Failed Login: [key] [computer_id] [address] - StickyBanned [ban["message"]] Target Username: [bannedckey] Placed by [ban["admin"]]")
log_suspicious_login("Failed Login: [ckey] [computer_id] [address] - StickyBanned [ban["message"]] Target Username: [bannedckey] Placed by [ban["admin"]]")
return .