Admin: Add configuration setting 'gdpr_terms_public' to enable the public availability of GDPR terms used on the platform - refs BT#16553

pull/3085/head^2^2
Yannick Warnier 6 years ago
parent 42517177ac
commit ab3f9bcab7
  1. 15
      main/install/configuration.dist.php
  2. 10
      main/template/default/user_portal/terms.tpl
  3. 50
      terms.php

@ -947,12 +947,15 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// $_configuration['show_pending_survey_in_menu'] = false; // $_configuration['show_pending_survey_in_menu'] = false;
// GDPR: European's General Data Protection Rules activation option // GDPR: European's General Data Protection Rules activation option
// Set to true to disable the new personal data page inside the social network menu // Set to true to disable the new personal data page inside the social network
// menu
// $_configuration['disable_gdpr'] = true; // $_configuration['disable_gdpr'] = true;
// GDPR requires users to be informed of the Data Protection Officer name and contact point // GDPR requires users to be informed of the Data Protection Officer name and
// These can only be defined here for now, but will be moved to web settings in the future. // contact point. These can only be defined here for now, but will be moved to
// Name of the person or organization that is responsible for the treatment of personal info // web settings in the future.
// Name of the person or organization that is responsible for the treatment of
// personal info
//$_configuration['data_protection_officer_name'] = ''; //$_configuration['data_protection_officer_name'] = '';
// A description of the role of the DP Officer in this context // A description of the role of the DP Officer in this context
//$_configuration['data_protection_officer_role'] = ''; //$_configuration['data_protection_officer_role'] = '';
@ -976,6 +979,10 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
], ],
];*/ ];*/
// Make GDPR terms public (useful when using the platform for anonymous survey
// invitations where users can leave personal info).
// $_configuration['gdpr_terms_public'] = false;
// Hide LP item prerequisite label in the LP view // Hide LP item prerequisite label in the LP view
//$_configuration['hide_accessibility_label_on_lp_item'] = true; //$_configuration['hide_accessibility_label_on_lp_item'] = true;

@ -0,0 +1,10 @@
{% extends 'layout/layout_1_col.tpl'|get_template %}
{% import 'default/macro/macro.tpl' as display %}
{% block content %}
<div class="col-md-12">
{% if term %}
{{ display.panel('TermsAndConditions'|get_lang, term.content, term.date_text ) }}
{% endif %}
</div>
{% endblock %}

@ -0,0 +1,50 @@
<?php
/* For licensing terms, see /license.txt */
$cidReset = true;
require_once __DIR__.'/main/inc/global.inc.php';
if (api_get_setting('allow_terms_conditions') !== 'true') {
api_not_allowed(true);
}
if (api_is_anonymous() && api_get_configuration_value('gdpr_terms_public') !== true) {
api_not_allowed(true);
}
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term = LegalManager::get_last_condition($language);
if (!$term) {
// look for the default language
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$term = LegalManager::get_last_condition($language);
}
$termExtraFields = new ExtraFieldValue('terms_and_condition');
$values = $termExtraFields->getAllValuesByItem($term['id']);
foreach ($values as $value) {
if (!empty($value['value'])) {
$term['content'] .= '<h3>'.get_lang($value['display_text']).'</h3><br />'.$value['value'].'<br />';
}
}
$term['date_text'] = get_lang('PublicationDate').': '.
api_get_local_time(
$term['date'],
null,
null,
false,
true,
true
);
$tpl = new Template(null);
$tpl->assign('term', $term);
$socialLayout = $tpl->get_template('user_portal/terms.tpl');
$tpl->display($socialLayout);
Loading…
Cancel
Save