diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm
index 8244fa353b3..e154b5b8f09 100644
--- a/code/modules/admin/DB ban/functions.dm
+++ b/code/modules/admin/DB ban/functions.dm
@@ -14,6 +14,9 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
var/maxadminbancheck //Used to limit the number of active bans of a certein type that each admin can give. Used to protect against abuse or mutiny.
var/announceinirc //When set, it announces the ban in irc. Intended to be a way to raise an alarm, so to speak.
var/blockselfban //Used to prevent the banning of yourself.
+ var/kickbannedckey //Defines whether this proc should kick the banned person, if they are connected (if banned_mob is defined).
+ //some ban types kick players after this proc passes (tempban, permaban), but some are specific to db_ban, so
+ //they should kick within this proc.
switch(bantype)
if(BANTYPE_PERMA)
bantype_str = "PERMABAN"
@@ -42,12 +45,14 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
maxadminbancheck = 1
announceinirc = 1
blockselfban = 1
+ kickbannedckey = 1
if(BANTYPE_ADMIN_TEMP)
bantype_str = "ADMIN_TEMPBAN"
bantype_pass = 1
maxadminbancheck = 1
announceinirc = 1
blockselfban = 1
+ kickbannedckey = 1
if( !bantype_pass ) return
if( !istext(reason) ) return
if( !isnum(duration) ) return
@@ -125,6 +130,10 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(announceinirc)
send2irc("BAN ALERT","[a_ckey] applied a [bantype_str] on [ckey]")
+ if(kickbannedckey)
+ if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey)
+ del(banned_mob.client)
+
datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
@@ -339,7 +348,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += ""
output += ""
output += ""
- output += ""
+ output += ""
output += ""
output += ""
output += ""
@@ -463,6 +472,4 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += ""
- usr << browse(output,"window=lookupbans;size=900x500")
-
-#undef MAX_ADMIN_BANS_PER_ADMIN
\ No newline at end of file
+ usr << browse(output,"window=lookupbans;size=900x500")
\ No newline at end of file
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index 49ded54e4c5..2b5d1259083 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -275,6 +275,10 @@ var/list/forbidden_varedit_object_types = list(
usr << "\red It is forbidden to edit this object's variables."
return
+ if(istype(O, /client) && (param_var_name == "ckey" || param_var_name == "key"))
+ usr << "\red You cannot edit ckeys on client objects."
+ return
+
var/class
var/variable
var/var_value