Changes between Version 9 and Version 10 of UserOptInConsent


Ignore:
Timestamp:
May 3, 2018, 1:24:33 PM (7 years ago)
Author:
skwang
Comment:

Added more design details

Legend:

Unmodified
Added
Removed
Modified
  • UserOptInConsent

    v9 v10  
    1919As of April 2018, BOINC already contains a [wiki:TermsOfUse 'terms of use' mechanism] for the BOINC client when creating a new account. If the file 'terms_of_use.txt' (filename is hardcod-ed) is in the root of the project directory, the contents of the file will be presented to the user when s/he creates an account. However, there is no persistent 'storing' of the datetime the user consented to the terms of use.
    2020
    21 The BOINC Web code does not have the ability to sign up directly (this statement has not yet been confirmed). If not, it would have to also use this terms-of-use mechanism.
     21For Web registration, the code does not use the [wiki:TermsOfUse] text. But it can be modified to do so.
    2222
    2323Additionally, it is not known whether account managers, such as BAM!, use this terms-of-use mechanism.
     24
     25`boinccmd` command-line client does not use the [wiki:TermsOfUse] mechanism. Thus when a user creates an account, s/he does not see any terms of use, even if it exists.
    2426
    2527== Technical Implementation ==
     
    3032
    3133* `consent`
    32  * `id` - the user id
     34 * `userid` - the user id
    3335 * `consent_id` - consent id
    3436 * `consent_time` - `datetime` type attribute : unixtime of when user `id` gave consent to `consent_id`. If zero, user has not consented (yet).
    3537 * `consent_flag` - the boolean which explicitly stats that this user id has given consent to this consent id. If this is 0 (FALSE), the following boolean should be 1 (TRUE).
    3638 * `consent_not_required` - a special boolean that indicates whether or not consent is not required. This feature may be used by certain special ...
    37  * `source` - text field containing the technology actor which the user gave consent. Example: if a user gives consent by registering for an account using the BOINC GUI client (BOINC manager), this would be set to 'client'. If the account is created on a Web site registration page, this would be set to 'web'. Other sources may be 'AM' (account manager), 'boinccmd' (command-line client), and 'RPC' (the Web RPC).
     39 * `source` - text field containing the technology actor which the user gave consent. See below
     40
     41`userid` and `consent_id` together make up the primary key of this table.
    3842
    3943* `consent_type`
    40   * `consent_id` - consent id
     44  * `consent_id` - consent id, also the primary key.
    4145  * `description` - text field describing the consent that user gives (or has given).
    4246
    43 It is likely at first there will be one record in `consent_type`: the main terms-of-use a user consents to when joining the project. The `consent` table uses `id` and `consent_id` as the primary key, so a single user may consent to multiple items. This allows for flexibility - a project may decide to present a user with multiple items to consent to. Each can be recorded in the `consent` table with a different `consent_id`, whose description is stored in the `consent_type` table.
     47==== Discussion ====
     48
     49Some discussion on `source` string.
     50
     51Examples
     52
     53* If a user gives consent by registering for an account using the BOINC GUI client (BOINC manager), `source` would be set to 'client'.
     54* If the account is created on a Web site registration page, `source` would be set to 'web'.
     55* Account Managers should put their name in, e.g. `source` = 'BAM!' or `source` = 'GridRepublic'.
     56* command-line client uses 'boinccmd'.
     57* In the case where `source` is not specified (but consent is being used) then a default `source` of 'URL' will be used.
     58  * 'URL' represents the fact that a user can create an account using the RPC by typing the correct parameters into the URL bar of a browser, or using a command line tool such as curl.
     59
     60Re: `consent_type` table
     61
     62At first there will be one record in `consent_type`: the main terms-of-use a user consents to when joining the project. The `consent` table uses `id` and `consent_id` as the primary key, so a single user may consent to multiple items. This allows for flexibility - a project may decide to present a user with multiple items to consent to. Each can be recorded in the `consent` table with a different `consent_id`, whose description is stored in the `consent_type` table.
     63
     64Currently when a project is created, or updated to the latest database schema, the `consent_type` table will be:
     65{{{
     66SELECT * FROM testp1.consent_type\G
     67*************************** 1. row ***************************
     68 consent_id: 1
     69description: General terms-of-use for this BOINC project.
     70}}}
     71
     72This consent type #1 should **not** be modified or deleted by projects!
    4473
    4574=== Project config ===
     
    4978=== RPC ===
    5079
    51 Two RPCs will need to change
    52  * `create_account.php`
    53  * `am_set_info.php`
     80RPCs that will need to change:
     81* `create_account.php`
     82* `am_set_info.php`
    5483
    5584The main RPC that needs to be changed is `create_account.php`, which needs to insert a record into the `consent` table when the user creates his/her account- assuming s/he consents to a site's terms of use.
    5685
    57 Additional parameters for RPC are
    58  * optin=0 | 1 -
    59  * source='string'
    60    * examples: 'client', 'AM', 'web', this would fill the `source` field in the `consent` table.
     86Additional parameters for `create_account.php` RPC are
     87* `consent_id` = 'integer' - optional, defaults to 1 unless specified. If given a `consent_id` that does not exist in the `consent_type` table, then the RPC will return an error.
     88* `optin` = 0|1 - If true, sets the `consent_flag` to 1. If false the `consent_flag` is set to 0 and `consent_not_required` is set to 1. See discussion of anonymous accounts above.
     89* `source` = 'string'
     90  * example: 'client', see above discussion about `source` for more details.
    6191
    6292`am_set_info.php` needs to be modified in order to contain a consent parameter, which also modifies the `consent` table in the database.
    6393
     94Additional parameters are
     95* `consent_id` = 'integer' - required if any of the below are to be set. If this parameter is not present, the `consent` table will not be modified.
     96* `consent_settime` = '0|1' - sets the `consent_time` to the current unixtime.
     97* `consent_flag` - '0|1' - sets the consent_flag to 0 or 1.
     98* `consent_not_required` - '0|1' - sets the consent_not_required flag to 0 or 1.
     99* `consent_source` - 'string'
     100  * example: 'client', see above discussion about `source` for more details.
     101
     102am_set_info.php can be used to update the `consent` table or to insert a new record. The user and consent ids are used as the primary keys of the `consent` table. Thus if both are given and found in already, the RPC will update the fields with the other `consent_` parameters. Likewise if this is a new row, then the RPC will insert a new record into the table using the fields. Note: if inserting a new record the RPC will first check to see if the `consent_id` exists in the `consent_type` table. If not an (-1) XML error will be returned. If the `consent_id` does exist, the insertion of a new record requires the following parameters `consent_id`, `consent_flag`, `consent_not_required`, and `consent_source`. If any of the four are not present, an error is returned. The `consent_settime` boolean is ignored. The record is inserted with the current unixtime.
     103
     104Example:
     105{{{
     106am_set_info.php?consent_id=99&consent_flag=1&consent_not_required=0&consent_source=accountmanager
     107}}}
     108
     109The RPC is attempting to set the consent information for a `consent_id` of 99. First the `consent` table is checked with the userid corresponding to the authenticator and the `consent_id`. If a record is found, it is updated with the parameters in the RPC: e.g., flag, not_required, source.
     110
     111If no record is found in `consent`, the `consent_type` table is checked to see if there a id of 99. If there is not, an error is returned.
     112
     113If there is such a `consent_id`==99, then the RPC will insert `consent_id`=99 and userid (from authenticator) into the `consent` table setting the additional parameters: e.g., flag, source.
    64114
    65115=== Web site ===
    66116
     117The Web site account registration page will have a new panel that includes the terms of use text. This will be the same text file as [wiki:TermsOfUse]. The text file is processed with PHP's `nl2br()` function in order to format the plain text into text that is readable in HTML. Admins should **not** put HTML tags into the plain text [wiki:TermsOfUse] file.
     118
     119The registration page will have an additional checkbox that requires a user opt-in to the terms of use. If this is not checked, the account will not be created, and an error hsown to the user. Only when the checkbox is checked, will an account be created. A new record will be inserted into the `consent` table, in the same manner as the create_account RPC.
     120
     121=== Anonymous Accounts ===
     122
    67123(to be written)