mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
Pretty sure this works, can't test because i can't connect to my sql db for some reason
This commit is contained in:
@@ -25,6 +25,9 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
|
||||
if(BANTYPE_JOB_TEMP)
|
||||
bantype_str = "JOB_TEMPBAN"
|
||||
bantype_pass = 1
|
||||
if(BANTYPE_APPEARANCE)
|
||||
bantype_str = "APPEARANCE_PERMABAN"
|
||||
bantype_pass = 1
|
||||
if( !bantype_pass ) return
|
||||
if( !istext(reason) ) return
|
||||
if( !isnum(duration) ) return
|
||||
@@ -104,6 +107,9 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
|
||||
if(BANTYPE_JOB_TEMP)
|
||||
bantype_str = "JOB_TEMPBAN"
|
||||
bantype_pass = 1
|
||||
if(BANTYPE_APPEARANCE)
|
||||
bantype_str = "APPEARANCE_PERMABAN"
|
||||
bantype_pass = 1
|
||||
if(BANTYPE_ANY_FULLBAN)
|
||||
bantype_str = "ANY"
|
||||
bantype_pass = 1
|
||||
@@ -288,6 +294,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
output += "<option value='[BANTYPE_TEMP]'>TEMPBAN</option>"
|
||||
output += "<option value='[BANTYPE_JOB_PERMA]'>JOB PERMABAN</option>"
|
||||
output += "<option value='[BANTYPE_JOB_TEMP]'>JOB TEMPBAN</option>"
|
||||
output += "<option value='[BANTYPE_APPEARANCE]'>APPEARANCE BAN</option>"
|
||||
output += "</select></td>"
|
||||
output += "<td><b>Ckey:</b> <input type='text' name='dbbanaddckey'></td></tr>"
|
||||
output += "<tr><td><b>Duration:</b> <input type='text' name='dbbaddduration'></td>"
|
||||
@@ -375,6 +382,8 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
typedesc = "<b>JOBBAN</b><br><font size='2'>([job])"
|
||||
if("JOB_TEMPBAN")
|
||||
typedesc = "<b>TEMP JOBBAN</b><br><font size='2'>([job])<br>([duration] minutes<br>Expires [expiration]"
|
||||
if("APPEARANCE_PERMABAN")
|
||||
typedesc = "<b>APPEARANCE/NAME BAN</b>"
|
||||
|
||||
output += "<tr bgcolor='[dcolor]'>"
|
||||
output += "<td align='center'>[typedesc]</td>"
|
||||
|
||||
@@ -61,6 +61,7 @@ var/global/floorIsLava = 0
|
||||
body += "<A href='?_src_=holder;warn=[M.ckey]'>Warn</A> | "
|
||||
body += "<A href='?src=\ref[src];newban=\ref[M]'>Ban</A> | "
|
||||
body += "<A href='?src=\ref[src];jobban2=\ref[M]'>Jobban</A> | "
|
||||
body += "<A href='?src=\ref[src];appearanceban=\ref[M]'>Appearance Ban</A> | "
|
||||
body += "<A href='?src=\ref[src];notes=show;mob=\ref[M]'>Notes</A> "
|
||||
|
||||
if(M.client)
|
||||
@@ -1115,4 +1116,4 @@ proc/formatLocation(var/location)
|
||||
return "[A.name] - [loc.x],[loc.y],[loc.z]"
|
||||
|
||||
proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
|
||||
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
|
||||
|
||||
@@ -93,6 +93,12 @@
|
||||
if(!banckey || !banreason || !banjob || !banduration)
|
||||
usr << "Not enough parameters (Requires ckey, reason and job)"
|
||||
return
|
||||
if(BANTYPE_APPEARANCE)
|
||||
if(!banckey || !banreason)
|
||||
usr << "Not enough parameters (Requires ckey and reason)"
|
||||
return
|
||||
banduration = null
|
||||
banjob = null
|
||||
|
||||
var/mob/playermob
|
||||
|
||||
@@ -354,6 +360,55 @@
|
||||
|
||||
/////////////////////////////////////new ban stuff
|
||||
|
||||
else if(href_list["appearanceban"])
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
var/mob/M = locate(href_list["appearanceban"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
return
|
||||
if(!M.ckey) //sanity
|
||||
usr << "This mob has no ckey"
|
||||
return
|
||||
|
||||
var/banreason = appearance_isbanned(M)
|
||||
if(banreason)
|
||||
/* if(!config.ban_legacy_system)
|
||||
usr << "Unfortunately, database based unbanning cannot be done through this panel"
|
||||
DB_ban_panel(M.ckey)
|
||||
return */
|
||||
switch(alert("Reason: '[banreason]' Remove appearance ban?","Please Confirm","Yes","No"))
|
||||
if("Yes")
|
||||
ban_unban_log_save("[key_name(usr)] removed [key_name(M)]'s appearance ban")
|
||||
log_admin("[key_name(usr)] removed [key_name(M)]'s appearance ban")
|
||||
feedback_inc("ban_appearance_unban", 1)
|
||||
DB_ban_unban(M.ckey, BANTYPE_APPEARANCE)
|
||||
appearance_unban(M)
|
||||
message_admins("\blue [key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban", 1)
|
||||
M << "\red<BIG><B>[usr.client.ckey] has removed your appearance ban.</B></BIG>"
|
||||
|
||||
else switch(alert("Appearance ban [M.ckey]?",,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
var/reason = input(usr,"Reason?","reason","Metafriender") as text|null
|
||||
if(!reason)
|
||||
return
|
||||
ban_unban_log_save("[key_name(usr)] appearance banned [key_name(M)]. reason: [reason]")
|
||||
log_admin("[key_name(usr)] appearance banned [key_name(M)]. \nReason: [reason]")
|
||||
feedback_inc("ban_appearance",1)
|
||||
DB_ban_record(BANTYPE_APPEARANCE, M, -1, reason)
|
||||
appearance_fullban(M, "[reason]; By [usr.ckey] on [time2text(world.realtime)]")
|
||||
notes_add(M.ckey, "Appearance banned - [reason]")
|
||||
message_admins("\blue [key_name_admin(usr)] appearance banned [key_name_admin(M)]", 1)
|
||||
M << "\red<BIG><B>You have been appearance banned by [usr.client.ckey].</B></BIG>"
|
||||
M << "\red <B>The reason is: [reason]</B>"
|
||||
M << "\red Appearance ban can be lifted only upon request."
|
||||
if(config.banappeals)
|
||||
M << "\red To try to resolve this matter head to [config.banappeals]"
|
||||
else
|
||||
M << "\red No ban appeals URL has been set."
|
||||
if("No")
|
||||
return
|
||||
|
||||
else if(href_list["jobban2"])
|
||||
// if(!check_rights(R_BAN)) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user