Loading...
 
Skip to main content

History: Terms_of_Use_Demo

Source of version: 6

Copy to clipboard
            {maketoc}
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

!!The User Tracker
First you need a user tracker. You could already have a user tracker. If so, you don't need to create one.
{CODE(caption=>YAML)}
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
{CODE}

!!Pretty tracker registration
Then you need to setup pretty tracker registration

{CODE()}
objects:
  - 
    type: wiki_page
    ref: registration_tpl
    data: 
      name: registration_tpl
      content: wikicontent:registration_tpl_include
      description: 
      lang: 
{CODE}

!!Features & settings
{CODE(caption=>YAML)}
preferences:
  feature_trackers: y
  allowRegister: true
  userTracker: true
  user_register_prettytracker: true
  user_register_prettytracker_tpl:$profileobject:registration_tpl$
{CODE}



!!The Checkbox field
You need to add the checkbox field to your user tracker
{CODE(caption=>YAML)}
objects:
  - 
    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
{CODE}
!!The wiki pages needed
{CODE(caption=>YAML)}
objects:
  - 
    type: wiki_page
    ref: renewterms
    data: 
      name: RenewTerms
      content: wikicontent:RenewTerms_include
      description: 
      lang: en
    type: wiki_page
    ref: terms_tpl
    data: 
      name: terms_tpl
      content: wikicontent:terms_tpl_include
      description: 
      lang: en
  - 
    type: wiki_page
    ref: terms
    data:
      name: Terms
      content: wikicontent:Terms_include
      description:
      lang: en
{CODE}
!! Example checker module that check the user has accepted or not.
You can also simply include the TRACKERITEMFIELD on selected pages like the homepage
{CODE()}
objects:
  - 
    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")}{REDIRECT}
        {TRACKERITEMFIELD}
      parse: true

{CODE}

Links to included wiki pages:
((registration_tpl_include))
((RenewTerms_include))
((terms_tpl_include))
((Terms_include))

        

History

Information Version
Sat 21 of Dec, 2013 22:15 GMT-0000 Nelson Ko deny edit perms 20
Sat 21 of Dec, 2013 21:40 GMT-0000 Nelson Ko tracker perms 19
Sat 21 of Dec, 2013 21:23 GMT-0000 Nelson Ko instructions 18
Sat 21 of Dec, 2013 21:20 GMT-0000 Nelson Ko perms 17
Sat 21 of Dec, 2013 21:10 GMT-0000 Nelson Ko indentation 16
Sat 21 of Dec, 2013 21:09 GMT-0000 Nelson Ko add user regis info 15
Sat 21 of Dec, 2013 20:48 GMT-0000 Nelson Ko add wikiplugin_redit=rect 14
Sat 21 of Dec, 2013 18:37 GMT-0000 Nelson Ko more fixes [rollback version 8] 13
Sat 21 of Dec, 2013 19:47 GMT-0000 Nelson Ko test basic profile to see if it works 12
Sat 21 of Dec, 2013 19:47 GMT-0000 Nelson Ko test basic profile to see if it works 11
Sat 21 of Dec, 2013 19:47 GMT-0000 Nelson Ko test basic profile to see if it works 10
Sat 21 of Dec, 2013 18:54 GMT-0000 Nelson Ko add necessary wikiplugin prefs 9
Sat 21 of Dec, 2013 18:37 GMT-0000 Nelson Ko more fixes 8
Sat 21 of Dec, 2013 18:34 GMT-0000 Nelson Ko trying to fix 7
Sat 21 of Dec, 2013 18:31 GMT-0000 Nelson Ko add feature_trackers 6
Sat 21 of Dec, 2013 18:25 GMT-0000 Nelson Ko categorization 5
Sat 21 of Dec, 2013 18:24 GMT-0000 Nelson Ko remove useless param 4
Sat 21 of Dec, 2013 18:11 GMT-0000 Nelson Ko fix included wikicontent 3
Sat 21 of Dec, 2013 18:07 GMT-0000 Nelson Ko rearrange 2
Sat 21 of Dec, 2013 18:01 GMT-0000 Nelson Ko new example 1