From a8e1862e6f2b23873a832d8249a9854b6be438d3 Mon Sep 17 00:00:00 2001 From: Shawn Kwang Date: Tue, 18 Sep 2018 11:42:37 -0500 Subject: [PATCH] rpc: Modified create_account RPC. RPC checks the version of BOINC client and if the client is newer than 6.10.0, then assume the user has seen the terms-of-use dialog, and thus consented to the TOU. --- html/inc/consent.inc | 1 + html/user/create_account.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/html/inc/consent.inc b/html/inc/consent.inc index a9f2fd57fe..b263268eff 100644 --- a/html/inc/consent.inc +++ b/html/inc/consent.inc @@ -21,6 +21,7 @@ include_once("../inc/boinc_db.inc"); include_once("../inc/util.inc"); +define('MIN_BOINCCLIENT_VERSION_TOU', 61000); define('CONSENT_TYPE_ENROLL','ENROLL'); function consent_to_a_policy($user, $consent_type_id, $consent_flag, $consent_not_required, $source, $ctime = 0) { diff --git a/html/user/create_account.php b/html/user/create_account.php index 59ea027904..ab1cb7c2bc 100644 --- a/html/user/create_account.php +++ b/html/user/create_account.php @@ -100,7 +100,7 @@ if ($user) { if ($checkct) { // As of Sept 2018, this code allows 'legacy' boinc clients to // create accounts. If consent_flag is null, e.g., if an older - // BOINC client creates an account withouth this new + // BOINC client creates an account without this new // parameter, the account is created as normal and there is no // updateto the consent table. // @@ -111,6 +111,14 @@ if ($user) { // is_null($consent_flag) returns TRUE, then return an // xml_error(-1, ...). + // If BOINC client version is larger than the minimum defined, + // then assume consent has been given, because the user must + // have clicked through the terms-of-use dialog box. + $client_version = boinc_client_version(); + if ($client_version >= MIN_BOINCCLIENT_VERSION_TOU) { + $consent_flag=1; + $source='BoincClient'; + } if ( (!is_null($consent_flag)) and $source) { // Record the user giving consent in database - if consent_flag is 0, // this is an 'anonymous account' and consent_not_required is