mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-18 03:36:07 +01:00
Configuration Controller (#7857)
This commit is contained in:
+23
-23
@@ -178,19 +178,19 @@
|
||||
if(null,"") return
|
||||
if("*New Rank*")
|
||||
new_rank = tgui_input_text(usr, "Please input a new rank", "New custom rank")
|
||||
if(config.admin_legacy_system)
|
||||
if(CONFIG_GET(flag/admin_legacy_system)) // CHOMPEdit
|
||||
new_rank = ckeyEx(new_rank)
|
||||
if(!new_rank)
|
||||
to_chat(usr, "<span class='filter_adminlog warning'>Error: Topic 'editrights': Invalid rank</span>")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(CONFIG_GET(flag/admin_legacy_system)) // CHOMPEdit
|
||||
if(admin_ranks.len)
|
||||
if(new_rank in admin_ranks)
|
||||
rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
else
|
||||
admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
||||
else
|
||||
if(config.admin_legacy_system)
|
||||
if(CONFIG_GET(flag/admin_legacy_system)) // CHOMPEdit
|
||||
new_rank = ckeyEx(new_rank)
|
||||
rights = admin_ranks[new_rank] //we input an existing rank, use its rights
|
||||
|
||||
@@ -680,7 +680,7 @@
|
||||
to_chat(usr, "<span class='filter_adminlog warning'>You do not have the appropriate permissions to add job bans!</span>")
|
||||
return
|
||||
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0) && !config.mods_can_job_tempban) // If mod and tempban disabled
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0) && !CONFIG_GET(flag/mods_can_job_tempban)) // If mod and tempban disabled // CHOMPEdit
|
||||
to_chat(usr, "<span class='filter_adminlog warning'>Mod jobbanning is disabled!</span>")
|
||||
return
|
||||
|
||||
@@ -781,14 +781,14 @@
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_BAN, 0))
|
||||
to_chat(usr, "<span class='filter_adminlog warning'> You cannot issue temporary job-bans!</span>")
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
if(CONFIG_GET(flag/ban_legacy_system)) // CHOMPEdit
|
||||
to_chat(usr, "<span class='filter_adminlog warning'>Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.</span>")
|
||||
return
|
||||
var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440)
|
||||
if(!mins)
|
||||
return
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_job_tempban_max)
|
||||
to_chat(usr, "<span class='filter_adminlog warning'> Moderators can only job tempban up to [config.mod_job_tempban_max] minutes!</span>")
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > CONFIG_GET(number/mod_job_tempban_max)) // CHOMPEdit
|
||||
to_chat(usr, "<span class='filter_adminlog warning'> Moderators can only job tempban up to [CONFIG_GET(number/mod_job_tempban_max)] minutes!</span>") // CHOMPEdit
|
||||
return
|
||||
var/reason = sanitize(tgui_input_text(usr,"Reason?","Please State Reason",""))
|
||||
if(!reason)
|
||||
@@ -840,7 +840,7 @@
|
||||
//Unbanning joblist
|
||||
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
|
||||
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
|
||||
if(!config.ban_legacy_system)
|
||||
if(!CONFIG_GET(flag/ban_legacy_system)) // CHOMPEdit
|
||||
to_chat(usr, "<span class='filter_adminlog'>Unfortunately, database based unbanning cannot be done through this panel</span>")
|
||||
DB_ban_panel(M.ckey)
|
||||
return
|
||||
@@ -903,7 +903,7 @@
|
||||
to_chat(usr, "<span class='warning'>You do not have the appropriate permissions to add bans!</span>")
|
||||
return
|
||||
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !config.mods_can_job_tempban) // If mod and tempban disabled
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !CONFIG_GET(flag/mods_can_job_tempban)) // If mod and tempban disabled // CHOMPEdit
|
||||
to_chat(usr, "<span class='warning'>Mod jobbanning is disabled!</span>")
|
||||
return
|
||||
|
||||
@@ -917,8 +917,8 @@
|
||||
var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440)
|
||||
if(!mins)
|
||||
return
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_tempban_max)
|
||||
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [config.mod_tempban_max] minutes!</span>")
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > CONFIG_GET(number/mod_tempban_max)) // CHOMPEdit
|
||||
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [CONFIG_GET(number/mod_tempban_max)] minutes!</span>") // CHOMPEdit
|
||||
return
|
||||
if(mins >= 525600) mins = 525599
|
||||
var/reason = sanitize(tgui_input_text(usr,"Reason?","reason","Griefer"))
|
||||
@@ -932,8 +932,8 @@
|
||||
feedback_inc("ban_tmp",1)
|
||||
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
|
||||
feedback_inc("ban_tmp_mins",mins)
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='filter_system warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(CONFIG_GET(string/banappeals)) // CHOMPEdit
|
||||
to_chat(M, "<span class='filter_system warning'>To try to resolve this matter head to [CONFIG_GET(string/banappeals)]</span>") // CHOMPEdit
|
||||
else
|
||||
to_chat(M, "<span class='filter_system warning'>No ban appeals URL has been set.</span>")
|
||||
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
@@ -958,8 +958,8 @@
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
||||
to_chat(M, "<span class='filter_system critical'>You have been banned by [usr.client.ckey].\nReason: [reason].</span>")
|
||||
to_chat(M, "<span class='filter_system warning'>This is a permanent ban.</span>")
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='filter_system warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(CONFIG_GET(string/banappeals)) // CHOMPEdit
|
||||
to_chat(M, "<span class='filter_system warning'>To try to resolve this matter head to [CONFIG_GET(string/banappeals)]</span>") // CHOMPEdit
|
||||
else
|
||||
to_chat(M, "<span class='filter_system warning'>No ban appeals URL has been set.</span>")
|
||||
ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.")
|
||||
@@ -1254,7 +1254,7 @@
|
||||
to_chat(usr, "<span class='filter_adminlog'>This can only be used on instances of type /mob/living</span>")
|
||||
return
|
||||
|
||||
if(config.allow_admin_rev)
|
||||
if(CONFIG_GET(flag/allow_admin_rev)) // CHOMPEdit
|
||||
L.revive()
|
||||
message_admins(span_red("Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!"), 1)
|
||||
log_admin("[key_name(usr)] healed / Rrvived [key_name(L)]")
|
||||
@@ -1362,13 +1362,13 @@
|
||||
to_chat(X, take_msg)
|
||||
to_chat(M, "<span class='filter_pm notice'><b>Your adminhelp is being attended to by [usr.client]. Thanks for your patience!</b></span>")
|
||||
// VoreStation Edit Start
|
||||
if (config.chat_webhook_url)
|
||||
if (CONFIG_GET(string/chat_webhook_url)) // CHOMPEdit
|
||||
spawn(0)
|
||||
var/query_string = "type=admintake"
|
||||
query_string += "&key=[url_encode(config.chat_webhook_key)]"
|
||||
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]" // CHOMPEdit
|
||||
query_string += "&admin=[url_encode(key_name(usr.client))]"
|
||||
query_string += "&user=[url_encode(key_name(M))]"
|
||||
world.Export("[config.chat_webhook_url]?[query_string]")
|
||||
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]") // CHOMPEdit
|
||||
// VoreStation Edit End
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Unable to locate mob.</span>")
|
||||
@@ -1581,7 +1581,7 @@
|
||||
else if(href_list["jumpto"])
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
|
||||
return
|
||||
if(!config.allow_admin_jump)
|
||||
if(!CONFIG_GET(flag/allow_admin_jump)) // CHOMPEdit
|
||||
tgui_alert_async(usr, "Admin jumping disabled")
|
||||
return
|
||||
|
||||
@@ -1601,7 +1601,7 @@
|
||||
else if(href_list["getmob"])
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
|
||||
return
|
||||
if(!config.allow_admin_jump)
|
||||
if(!CONFIG_GET(flag/allow_admin_jump)) // CHOMPEdit
|
||||
tgui_alert_async(usr, "Admin jumping disabled")
|
||||
return
|
||||
if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes")
|
||||
@@ -1620,7 +1620,7 @@
|
||||
else if(href_list["sendmob"])
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
|
||||
return
|
||||
if(!config.allow_admin_jump)
|
||||
if(!CONFIG_GET(flag/allow_admin_jump)) // CHOMPEdit
|
||||
tgui_alert_async(usr, "Admin jumping disabled")
|
||||
return
|
||||
|
||||
@@ -1688,7 +1688,7 @@
|
||||
else if(href_list["object_list"]) //this is the laggiest thing ever
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
if(!config.allow_admin_spawning)
|
||||
if(!CONFIG_GET(flag/allow_admin_spawning)) // CHOMPEdit
|
||||
to_chat(usr, "<span class='filter_adminlog'>Spawning of items is not allowed.</span>")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user