URL configuration

This commit is contained in:
AffectedArc07
2021-05-16 21:14:10 +01:00
parent 400a25dc01
commit 8dd5dfbf7f
41 changed files with 150 additions and 144 deletions
+4 -4
View File
@@ -38,8 +38,8 @@
if(check_ipintel && config.ipintel_email && config.ipintel_whitelist && ipintel_is_banned(key, address))
log_adminwarn("Failed Login: [key] [computer_id] [address] - Proxy/VPN")
var/mistakemessage = ""
if(config.banappeals)
mistakemessage = "\nIf you have to use one, request whitelisting at: [config.banappeals]"
if(GLOB?.configuration?.url.banappeals_url)
mistakemessage = "\nIf you have to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]"
INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_IPINTEL)
return list("reason"="using proxy or vpn", "desc"="\nReason: Proxies/VPNs are not allowed here. [mistakemessage]")
@@ -116,8 +116,8 @@
expires = " The ban is for [duration] minutes and expires on [expiration] (server time)."
else
var/appealmessage = ""
if(config.banappeals)
appealmessage = " You may appeal it at <a href='[config.banappeals]'>[config.banappeals]</a>."
if(GLOB?.configuration?.url.banappeals_url)
appealmessage = " You may appeal it at <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>."
expires = " This ban does not expire automatically and must be appealed.[appealmessage]"
var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban was applied by [ackey] on [bantime][ban_round_id ? " (Round [ban_round_id])" : ""].[expires]"
+2 -2
View File
@@ -10,8 +10,8 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
. = list()
var/appeal
if(config && config.banappeals)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
if(GLOB?.configuration?.url.banappeals_url)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>"
GLOB.banlist_savefile.cd = "/base"
if( "[ckey][id]" in GLOB.banlist_savefile.dir )
GLOB.banlist_savefile.cd = "[ckey][id]"
+2 -2
View File
@@ -92,7 +92,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] "
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]</a>\]"
body += "<br>BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= config.byond_account_age_threshold ? "<b>" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= config.byond_account_age_threshold ? "</b>" : ""]"
body += "<br>Global Ban DB Lookup: [config.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
body += "<br>Global Ban DB Lookup: [GLOB?.configuration?.url.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
body += "<br>"
@@ -127,7 +127,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
body += "<A href='?_src_=holder;appearanceban=[M.UID()];dbbanaddckey=[M.ckey]'>Appearance Ban</A> | "
body += "<A href='?_src_=holder;shownoteckey=[M.ckey]'>Notes</A> | "
body += "<A href='?_src_=holder;viewkarma=[M.ckey]'>View Karma</A> | "
if(config.forum_playerinfo_url)
if(GLOB?.configuration?.url.forum_playerinfo_url)
body += "<A href='?_src_=holder;webtools=[M.ckey]'>WebInfo</A> | "
if(M.client)
if(check_watchlist(M.client.ckey))
+2 -2
View File
@@ -186,7 +186,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
qdel(select_query)
if(is_actually_banned)
if(config.banappeals)
to_chat(src, "<span class='warning'>You can appeal the bans at: [config.banappeals]</span>")
if(GLOB?.configuration?.url.banappeals_url)
to_chat(src, "<span class='warning'>You can appeal the bans at: [GLOB.configuration.url.banappeals_url]</span>")
else
to_chat(src, "<span class='warning'>You have no active jobbans!</span>")
+2 -2
View File
@@ -14,7 +14,7 @@
*/
/datum/admins/proc/create_ccbdb_lookup(ckey)
// Bail if disabled
if(!config.centcom_ban_db_url)
if(!GLOB?.configuration?.url.centcom_ban_db_url)
to_chat(usr, "<span class='warning'>The CentCom Ban DB lookup is disabled. Please inform a maintainer or server host.</span>")
return
// Bail if no ckey is supplied
@@ -22,7 +22,7 @@
return
var/datum/callback/cb = CALLBACK(src, /datum/admins/.proc/ccbdb_lookup_callback, usr, ckey)
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[config.centcom_ban_db_url][ckey]", proc_callback=cb)
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[GLOB.configuration.url.centcom_ban_db_url][ckey]", proc_callback=cb)
/**
* CCBDB Lookup Callback
+8 -8
View File
@@ -541,8 +541,8 @@
to_chat(M, "<span class='warning'><big><b>You have been appearance banned by [usr.client.ckey].</b></big></span>")
to_chat(M, "<span class='danger'>The reason is: [reason]</span>")
to_chat(M, "<span class='warning'>Appearance ban can be lifted only upon request.</span>")
if(config.banappeals)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
if(GLOB?.configuration?.url.banappeals_url)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
else
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
if("No")
@@ -1008,8 +1008,8 @@
else if(href_list["webtools"])
var/target_ckey = href_list["webtools"]
if(config.forum_playerinfo_url)
var/url_to_open = config.forum_playerinfo_url + target_ckey
if(GLOB?.configuration?.url.forum_playerinfo_url)
var/url_to_open = "[GLOB.configuration.url.forum_playerinfo_url][target_ckey]"
if(alert("Open [url_to_open]",,"Yes","No")=="Yes")
usr.client << link(url_to_open)
@@ -1074,8 +1074,8 @@
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
if(M.client)
M.client.link_forum_account(TRUE)
if(config.banappeals)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
if(GLOB.configuration.url.banappeals_url)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
else
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
@@ -1091,8 +1091,8 @@
to_chat(M, "<span class='warning'>This ban does not expire automatically and must be appealed.</span>")
if(M.client)
M.client.link_forum_account(TRUE)
if(config.banappeals)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
if(GLOB?.configuration?.url.banappeals_url)
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
else
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This ban does not expire automatically and must be appealed.")