A little bit more GDPR compliance stuff (#17367)

This commit is contained in:
AffectedArc07
2022-01-25 10:15:58 +01:00
committed by GitHub
parent 1c041634c2
commit f11e4082bb
6 changed files with 68 additions and 7 deletions
+32
View File
@@ -138,6 +138,22 @@
if(href_list["link_forum_account"])
link_forum_account()
return // prevents a recursive loop where the ..() 5 lines after this makes the proc endlessly re-call itself
if(href_list["withdraw_consent"])
var/choice = alert(usr, "Are you SURE you want to withdraw your consent to the Terms of Service?\nYou will be instantaneously removed from the server and will have to re-accept the Terms of Service.", "Warning", "Yes", "No")
if(choice == "Yes")
// Update the DB
var/datum/db_query/query = SSdbcore.NewQuery("REPLACE INTO privacy (ckey, datetime, consent) VALUES (:ckey, Now(), 0)", list(
"ckey" = ckey
))
if(!query.warn_execute())
to_chat(usr, "Well, this is embarassing. We tried to save your ToS withdrawal but the DB failed. Please contact the server host")
return
// I know its a very rare occurance, but I wouldnt doubt people using this to withdraw consent right when sec captures them
message_admins("[key_name_admin(usr)] was disconnected due to withdrawing their ToS consent.")
to_chat(usr, "<span class='boldannounce'>Your ToS consent has been withdrawn. You have been kicked from the server</span>")
del(src)
switch(href_list["action"])
if("openLink")
src << link(href_list["link"])
@@ -1026,6 +1042,22 @@
else
SSambience.ambience_listening_clients -= src
// Verb scoped to the client level so its ALWAYS available
/client/verb/open_tos()
set category = "OOC"
set name = "Terms of Service"
var/output = GLOB.join_tos
output += "<hr><p>By withdrawing your consent, you acknowledge that you will be instantaneously kicked from the server and will have to re-accept the Terms of Service. If you do not wish to withdraw your consent at this moment, feel free to close this window.</p>"
output += "<p><a href='byond://?src=[UID()];withdraw_consent=1'>Withdraw consent</a></p>"
src << browse(output,"window=privacy_consent;size=600x500")
var/datum/browser/popup = new(src, "privacy_consent", "<div align='center'>Privacy Consent</div>", 500, 400)
popup.set_content(output)
popup.open(FALSE)
return
#undef LIMITER_SIZE
#undef CURRENT_SECOND
#undef SECOND_COUNT
@@ -13,9 +13,9 @@
C.tos_consent = TRUE
return
// If our query failed, just assume yes
// If our query failed dont just assume yes
if(Q.last_error)
C.tos_consent = TRUE
C.tos_consent = FALSE
return
// If we returned a row, they accepted