History: Terms_of_Use_Demo
Preview of version: 1
- «
- »
Table of contents
The purpose of this profile is to make the users accept a terms of use on registration. Also existing users will be asked to fill in the terms of use on login if they are already registered prior to the terms of use implementation
Features & settings
YAML
Copy to clipboard
preferences: allowRegister: true userTracker: true user_register_prettytracker: true user_register_prettytracker_tpl:$profileobject:registration_tpl$
The User Tracker
You could already have a user tracker. If so, you don't need to create one.YAML
Copy to clipboard
objects: - type: tracker ref: user_tracker data: name: User Tracker description: restrict_end: 0 restrict_start: 0 allow: - one_item_per_user - creator_modification show: - list_creation_date - status_admin_only - type: tracker_field ref: user_tracker_f_39 data: name: User permname: f_39 tracker: $profileobject:user_tracker$ options: autoassign: 1 type: user order: 0 flags: - searchable - public - mandatory
The Checkbox field
You need to add the checkbox field to your user trackerYAML
Copy to clipboard
- type: tracker_field ref: user_tracker_acceptedTerms data: name: I have accepted the Terms of Use permname: acceptedTerms tracker: $profileobject:user_tracker$ options: type: checkbox order: 170 flags: - public - mandatory
The wiki pages needed
Copy to clipboard
- type: wiki_page ref: registration_tpl data: name: registration_tpl content: wikicontent:registration_tpl description: lang: - type: wiki_page ref: renewterms data: name: RenewTerms content: wikicontent:RenewTerms description: lang: en type: wiki_page ref: terms_tpl data: name: terms_tpl content: wikicontent:terms_tpl description: lang: en - type: wiki_page ref: terms data: name: Terms content: wikicontent:Terms description: lang: en
The checker module that check the user has accepted or not.
Copy to clipboard
- type: module ref: terms_checker data: name: Terms Checker position: bottom order: 2 cache: 0 rows: 10 groups: - Registered params: custom: | {TRACKERITEMFIELD(fieldId="$profileobject:user_tracker_acceptedTerms$", test="1", value="y", trackerId="$profileobject:user_tracker$")} {ELSE} {REDIRECT(page="RenewTerms", from_pages_only="y")}{REDIRECT} {TRACKERITEMFIELD} parse: true