How can I add a link to my Terms of Service with the new “default attribute” = “Terms of Service”?
Mantis Issue #19003 created a new default attribute requiring users to tick a checkbox that they’ve read our Terms of Service.
The default text for this attribute is
"I agree to the terms of service of <website_domain>".
I would like to change the text of this attribute to:
But when I try to edit the attribute (“Config” -> “Configure attributes” -> change the contents of the input field next to “Tag Name” -> “Save changes”), my html is stripped from the attribute’s Tag Name
Is this a bug? Is there a workaround for this? What have other people done to ensure that they actually provide access to their ToS/PP when mandating that their users agree to it?
It links to:
Thanks for that, corrected link to correct page.
fyi, I created a mantis bug about this here:
@maltfield, do you have any solution? I can’t see issue #19436 ins Mantis.
Manual says: “Consider adding a required consent checkbox which links to your legal policies” (https://www.phplist.org/manual/books/phplist-manual/page/gdpr) but I don’t know how to do this.
@gellert.gyuris my solution is to manually modify the code of my phplist installs
Edit the file
public_html/lists/admin/attributes.php by removing the
strip_tags() function from three distinct places:
- the code that populates the value="" tag of the input on the page load
- the code that UPDATEs existing attributes in the DB
- the code that INSERTs new attributes in the DB
More specifically, here’s a diff of the original file and my updated version:
< $tables['attribute'], sql_escape(strip_tags($_POST['name'])), sql_escape($_POST['type']),
> $tables['attribute'], sql_escape($_POST['name']), sql_escape($_POST['type']),
< $tables['attribute'], sql_escape(strip_tags($_POST['name'][$id])), sql_escape($_POST['type'][$id]),
> $tables['attribute'], sql_escape($_POST['name'][$id]), sql_escape($_POST['type'][$id]),
< <input type="text" name="name[' .$row['id'].']" value="'.htmlspecialchars(stripslashes(strip_tags($row['name']))).'" size="40" />';
> <input type="text" name="name[' .$row['id'].']" value="'.htmlspecialchars(stripslashes($row['name'])).'" size="40" />';
After this change, you should be able to set the “Name” of the attribute to include an html
<a href="..."> anchor tag that links to your ToS.
@maltfield, tanks for the detailed description. Yes, this workaround works for me too. I think, this is not an official solution , but works. Thank you very much.