View Issue Details

This bug affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
19274Bug reportsCentral participant databasepublic2024-11-19 18:14
ReporterMazi Assigned Totibor.pacalat  
PrioritynoneSeverityblock 
Status closedResolutionfixed 
Product Version5.6.x 
Summary19274: Attribute encryption can not be turned OFF, it can only be turned on
Description

At the Attribute overview, the status at column "encrypted" can only be switched to ON. The change gets saved on click (see 18799 for report UI issue).
When reloading the page, the change is still visible. If I then switch the status to OFF and reload the page, the value is still set to ON.
-> There is no way to turn an encrypted attribute back to OFF. You have to do that manually at table lime_participant_attribute_names.

Steps To Reproduce

Steps to reproduce

Go to the attribute page at the CPDB.
Turn encryption status to ON.
Reload page -> status is ON
Switch status to OFF
Reload page -> status is still ON

Expected result

Status OFF needs to be saved.

Actual result

Only status ON gets saved properly.

TagsNo tags attached.
Attached Files
image.png (76,327 bytes)   
image.png (76,327 bytes)   
Bug heat12
Complete LimeSurvey version number (& build)Version 5.6.46+231121
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache 2.0
PHP Version8.1

Relationships

related to 18926 closedgabrieljenik CPDB participant Actions menu items don't work 

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2023-11-29 15:56

manager   ~78804

Last edited: 2023-11-29 15:56

Couldn't reproduce it.

When I set it to Yes, the existing data in the DB is saved and encrypted. When I set it to No, the existing data in the DB is saved and decrypted.
Just in case, I tried it in German too, without problem.

gabrieljenik

gabrieljenik

2023-11-29 15:56

manager   ~78805

Peek_2023-11-29_08-21.gif (524,862 bytes)
Mazi

Mazi

2023-11-29 22:52

updater   ~78813

The problem was caused by having copied CPDB tables directly from 3.x to 5.x. That caused DB updates to not be executed.
The fix was to execute these updates manually:
UPDATE lime_participant_attribute_names SET core_attribute='N';
UPDATE lime_participant_attribute_names SET encrypted='N';

Thanks @gabrieljenik for the great help. This ticket can be closed.

gabrieljenik

gabrieljenik

2023-11-30 14:10

manager   ~78831

I am not sure those are included in the update scrtips.
Anyway, the code doesn't consider blank to be a N when reading if an attribute is encrypted or not.

Then, when asking to encrypt, the data was not encrypted but still the attribute marked as encrypted.
Then wen trying to decrypt, the decryption failed.

Another problem, when failed, it failed silently, as the exception was not shown, neither frienly error informed.

gabrieljenik

gabrieljenik

2023-11-30 14:11

manager   ~78832

There are issues. Still, de-assigning myself from it as to allow priorization from @tibor.pacalat
Thanks

gabrieljenik

gabrieljenik

2023-12-18 16:48

manager   ~79033

Master: https://github.com/LimeSurvey/LimeSurvey/pull/3670
v5: https://github.com/LimeSurvey/LimeSurvey/pull/3671

During the update from 3 to 5, the “encrypted” and “core_attribute” fields of the existing attributes are not set.

So in this part the variables do not have “N”, but ““ (see attachment)

We updated the code so that it does not check “N” but !=”Y”. Maybe even add isEncrypted and isCoreAttribute methods to the model.

image-2.png (160,879 bytes)
gabrieljenik

gabrieljenik

2023-12-18 16:49

manager   ~79034

@tibor.pacalat: This is very sensistive as it involves encryption.

DenisChenu

DenisChenu

2023-12-18 17:33

developer   ~79036

We updated the code so that it does not check “N” but !=”Y”. Maybe even add isEncrypted and isCoreAttribute methods to the model.

I'm OK with this solution.

What for token and response ? We check != 'N' or == 'Y' ?

tibor.pacalat

tibor.pacalat

2024-01-16 16:09

administrator   ~79185

Tested and merged.

guest

guest

2024-01-16 16:22

viewer   ~79186

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35969

guest

guest

2024-01-16 16:22

viewer   ~79187

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35968

LimeBot

LimeBot

2024-01-22 12:45

administrator   ~79265

Fixed in Release 6.4.3+240122

LimeBot

LimeBot

2024-01-22 12:50

administrator   ~79267

Fixed in Release 5.6.52+240123

Related Changesets

LimeSurvey: master 9d045ca3

2024-01-16 16:58

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 19274: Attribute encryption can not be turned OFF, it can only be turned on (#3670)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
19274
mod - application/controllers/admin/ParticipantsAction.php Diff File
mod - application/models/ParticipantAttributeName.php Diff File

LimeSurvey: master 9d045ca3

2024-01-16 16:58

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 19274: Attribute encryption can not be turned OFF, it can only be turned on (#3670)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
19274
mod - application/controllers/admin/ParticipantsAction.php Diff File
mod - application/models/ParticipantAttributeName.php Diff File

LimeSurvey: 5.x be215e4c

2024-01-16 17:06

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 19274: Attribute encryption can not be turned OFF, it can only be turned on (#3671)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
19274
mod - application/controllers/admin/ParticipantsAction.php Diff File
mod - application/models/ParticipantAttributeName.php Diff File

LimeSurvey: 5.x be215e4c

2024-01-16 17:06

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 19274: Attribute encryption can not be turned OFF, it can only be turned on (#3671)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
19274
mod - application/controllers/admin/ParticipantsAction.php Diff File
mod - application/models/ParticipantAttributeName.php Diff File

Issue History

Date Modified Username Field Change
2023-11-23 13:07 Mazi New Issue
2023-11-23 13:07 Mazi File Added: image.png
2023-11-27 23:34 gabrieljenik Assigned To => gabrieljenik
2023-11-27 23:34 gabrieljenik Status new => assigned
2023-11-29 14:57 Mazi Relationship added related to 18926
2023-11-29 15:56 gabrieljenik Status assigned => feedback
2023-11-29 15:56 gabrieljenik Note Added: 78804
2023-11-29 15:56 gabrieljenik Bug heat 0 => 2
2023-11-29 15:56 gabrieljenik Note Added: 78805
2023-11-29 15:56 gabrieljenik File Added: Peek_2023-11-29_08-21.gif
2023-11-29 15:56 gabrieljenik Note Edited: 78804
2023-11-29 22:52 Mazi Note Added: 78813
2023-11-29 22:52 Mazi Bug heat 2 => 4
2023-11-29 22:52 Mazi Status feedback => assigned
2023-11-30 14:10 gabrieljenik Note Added: 78831
2023-11-30 14:11 gabrieljenik Assigned To gabrieljenik =>
2023-11-30 14:11 gabrieljenik Status assigned => confirmed
2023-11-30 14:11 gabrieljenik Note Added: 78832
2023-12-18 16:48 gabrieljenik Note Added: 79033
2023-12-18 16:48 gabrieljenik File Added: image-2.png
2023-12-18 16:48 gabrieljenik Assigned To => DenisChenu
2023-12-18 16:48 gabrieljenik Status confirmed => ready for code review
2023-12-18 16:49 gabrieljenik Note Added: 79034
2023-12-18 17:33 DenisChenu Assigned To DenisChenu => tibor.pacalat
2023-12-18 17:33 DenisChenu Status ready for code review => ready for testing
2023-12-18 17:33 DenisChenu Note Added: 79036
2023-12-18 17:33 DenisChenu Bug heat 4 => 6
2024-01-16 16:09 tibor.pacalat Status ready for testing => resolved
2024-01-16 16:09 tibor.pacalat Resolution open => fixed
2024-01-16 16:09 tibor.pacalat Note Added: 79185
2024-01-16 16:09 tibor.pacalat Bug heat 6 => 8
2024-01-16 16:22 Changeset attached => LimeSurvey master 9d045ca3
2024-01-16 16:22 Changeset attached => LimeSurvey 5.x be215e4c
2024-01-16 16:22 guest Note Added: 79186
2024-01-16 16:22 guest Bug heat 8 => 10
2024-01-16 16:22 Changeset attached => LimeSurvey master 9d045ca3
2024-01-16 16:22 Changeset attached => LimeSurvey 5.x be215e4c
2024-01-16 16:22 guest Note Added: 79187
2024-01-22 12:45 LimeBot Note Added: 79265
2024-01-22 12:45 guest Bug heat 10 => 12
2024-01-22 12:50 LimeBot Note Added: 79267
2024-11-19 18:14 c_schmitz Status resolved => closed