Skip to content

Commit 9472341

Browse files
authored
WIP: GDPR (#2606)
Admin: Add configuration setting 'enable_gdpr' to enable special privacy options to ease implementation of European GDPR. Add personal data info page, LegalRepository, personal data treatment types display and update getLastLogin() results including track_e_login for legacy users - refs #2568 #GDPR
1 parent cc61f12 commit 9472341

File tree

14 files changed

+24893
-24342
lines changed

14 files changed

+24893
-24342
lines changed

main/admin/legal_list.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
<?php
22
/* For licensing terms, see /license.txt */
33

4+
use Chamilo\CoreBundle\Entity\Repository\LegalRepository;
5+
46
/**
57
* Sessions list script.
68
*
79
* @package chamilo.admin
810
*/
911
$cidReset = true;
1012
require_once __DIR__.'/../inc/global.inc.php';
13+
1114
$this_section = SECTION_PLATFORM_ADMIN;
1215
api_protect_admin_script();
13-
$interbreadcrumb[] = ["url" => 'index.php', "name" => get_lang('PlatformAdmin')];
16+
$interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
1417
$tool_name = get_lang('TermsAndConditions');
15-
Display :: display_header($tool_name);
18+
Display::display_header($tool_name);
1619

1720
$parameters['sec_token'] = Security::get_token();
1821

1922
// action menu
2023
echo '<div class="actions">';
2124
echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">';
22-
echo Display::return_icon('edit.png', get_lang('EditTermsAndConditions')).get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
25+
echo Display::return_icon(
26+
'edit.png',
27+
get_lang('EditTermsAndConditions')
28+
);
29+
echo get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
2330
echo '</div>';
2431

25-
$legal_count = LegalManager::count();
32+
$em = Database::getManager();
33+
/** @var LegalRepository $legalTermsRepo */
34+
$legalTermsRepo = $em->getRepository('ChamiloCoreBundle:Legal');
35+
$legalCount = $legalTermsRepo->countAllActiveLegalTerms();
2636
$languages = api_get_languages();
2737
$available_languages = count($languages['folder']);
28-
if ($legal_count != $available_languages) {
38+
if ($legalCount != $available_languages) {
2939
echo Display::return_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'), 'warning');
3040
}
3141

main/inc/lib/legal.lib.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,4 +380,28 @@ public static function deleteLegal($userId)
380380
$extraFieldValue->delete($value['id']);
381381
}
382382
}
383+
384+
/**
385+
* @return array
386+
*/
387+
public static function getTreatmentTypeList()
388+
{
389+
return [
390+
101 => 'collection',
391+
102 => 'recording',
392+
103 => 'organization',
393+
104 => 'structure',
394+
105 => 'conservation',
395+
106 => 'adaptation',
396+
107 => 'extraction',
397+
108 => 'consultation',
398+
109 => 'usage',
399+
110 => 'communication',
400+
111 => 'interconnection',
401+
112 => 'limitation',
402+
113 => 'deletion',
403+
114 => 'destruction',
404+
115 => 'profiling',
405+
];
406+
}
383407
}

main/inc/lib/social.lib.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ public static function show_social_menu(
925925
$sharedProfileIcon = Display::return_icon('sn-profile.png', get_lang('ViewMySharedProfile'));
926926
$searchIcon = Display::return_icon('sn-search.png', get_lang('Search'), null, ICON_SIZE_SMALL);
927927
$portfolioIcon = Display::return_icon('wiki_task.png', get_lang('Portfolio'));
928+
$personalDataIcon = Display::return_icon('database.png', get_lang('PersonalDataReport'));
928929

929930
$html = '';
930931
$active = null;
@@ -1012,7 +1013,18 @@ public static function show_social_menu(
10121013
</li>
10131014
';
10141015
}
1015-
$links .= '</ul>';
1016+
1017+
if (api_get_configuration_value('enable_gdpr')) {
1018+
$active = $show == 'personal-data' ? 'active' : null;
1019+
$personalData = '
1020+
<li class="personal-data-icon '.$active.'">
1021+
<a href="'.api_get_path(WEB_CODE_PATH).'social/personal_data.php">
1022+
'.$personalDataIcon.' '.get_lang('PersonalDataReport').'
1023+
</a>
1024+
</li>';
1025+
$links .= $personalData;
1026+
$links .= '</ul>';
1027+
}
10161028

10171029
$html .= Display::panelCollapse(
10181030
get_lang('SocialNetwork'),

main/install/configuration.dist.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,19 @@
931931
// ALTER TABLE usergroup ADD author_id INT DEFAULT NULL;
932932
//$_configuration['allow_teachers_to_classes'] = false;
933933

934+
// GDPR: European's General Data Protection Rules activation option
935+
// Set to true to automatically enable a new personal data page inside the social network menu
936+
// $_configuration['enable_gdpr'] = false;
937+
938+
// GDPR requires users to be informed of the Data Protection Officer name and contact point
939+
// These can only be defined here for now, but will be moved to web settings in the future.
940+
// Name of the person or organization that is responsible for the treatment of personal info
941+
//$_configuration['data_protection_officer_name'] = '';
942+
// A description of the role of the DP Officer in this context
943+
//$_configuration['data_protection_officer_role'] = '';
944+
// An e-mail address where to contact the data protection officer for queries
945+
//$_configuration['data_protection_officer_email'] = '';
946+
934947
// Validate user login via a webservice, Chamilo will send a "login" and "password" parameters
935948
// to the "myWebServiceFunctionToLogin" function, the result should be "1" if the user have access.
936949
/*$_configuration['webservice_validation'] = [

0 commit comments

Comments
 (0)