From e56663c3329b4b516ee477897e8a300d6197c940 Mon Sep 17 00:00:00 2001 From: Patricia Stelling Date: Wed, 25 Mar 2020 14:43:17 +0100 Subject: [PATCH] Dev: some smaller issues while testing ipanonymization --- .../helpers/expressions/em_manager_helper.php | 9 ++++++ .../admin/survey/activateSurvey_view.php | 32 +++++++++---------- .../subview/accordion/_notification_panel.php | 11 ++----- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 208b7afaa6c..f05c27f1b32 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -5591,6 +5591,15 @@ private function _UpdateValuesInDatabase($finished=false) } if ($this->surveyOptions['ipaddr']) { $aResponseAttributes['ipaddr'] = getIPAddress(); + + //anonymize ip adress + if($this->surveyOptions['ipAnonymize']){ + $ipAddressAnonymizer = new LimeSurvey\Models\Services\IpAddressAnonymizer($aResponseAttributes['ipaddr']); + $result = $ipAddressAnonymizer->anonymizeIpAddress(); + if($result){ + $aResponseAttributes['ipaddr'] = $result; + } + } } foreach ($updatedValues as $key=>$value) diff --git a/application/views/admin/survey/activateSurvey_view.php b/application/views/admin/survey/activateSurvey_view.php index c3abe05ff3d..df557695a27 100644 --- a/application/views/admin/survey/activateSurvey_view.php +++ b/application/views/admin/survey/activateSurvey_view.php @@ -203,22 +203,6 @@ function alertPrivacy() - -
-
- -
- -
-
-
@@ -238,6 +222,22 @@ function alertPrivacy()
+
+
+ +
+ +
+
+
+



diff --git a/application/views/admin/survey/subview/accordion/_notification_panel.php b/application/views/admin/survey/subview/accordion/_notification_panel.php index 58e38a44c99..757b6907a53 100755 --- a/application/views/admin/survey/subview/accordion/_notification_panel.php +++ b/application/views/admin/survey/subview/accordion/_notification_panel.php @@ -104,7 +104,7 @@
- +
isActive) { @@ -114,20 +114,15 @@ eT("Responses will have the IP address anonymized"); } ?> - ipanonymize); + ipanonymize); }else { // $this->widget('yiiwheels.widgets.buttongroup.WhButtonGroup', array( 'name' => 'ipanonymize', 'value' => $oSurvey->ipanonymize, 'selectOptions' => ($bShowInherited) ? array_merge($optionsOnOff, array( - 'I' => gT('Inherit', 'unescaped') . ' [' . $oSurveyOptions->ipaddr . ']' + 'I' => gT('Inherit', 'unescaped') . ' [' . $oSurveyOptions->ipanonymize . ']' )) : $optionsOnOff, - /*'events'=>array('switchChange.bootstrapSwitch'=>"function(event,state){ - if ($('#anonymized').is(':checked') == true) { - $('#datestampModal_2').modal(); - } - }")*/ )); } ?>