ensure privacy settings

More
6 months 2 weeks ago #176431 by bewi
ensure privacy settings was created by bewi
How can I determine that surveys always have special settings about privacy
Save IP address: [ ]
Save referrer URL: [ ]
Google Analytics settings:  None
 
Anonymized responses: [x]
These settings should be applied to every survey at least by default at creation.
The best would be if no admin could change it later.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
6 months 2 weeks ago #176446 by jelo
Replied by jelo on topic ensure privacy settings
There is currently no way to assign settings as a default or enforce settings to certain usergroups.
Modifying the php code of your LimeSurvey installation looks not like a sustainable solution.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #176459 by DenisChenu
Replied by DenisChenu on topic ensure privacy settings

jelo wrote: There is currently no way to assign settings as a default or enforce settings to certain usergroups.

enforce can be done easily with some php in a plugin.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #176461 by bewi
Replied by bewi on topic ensure privacy settings
can you give an example?
I'm not very familiar with limesurvey and it's plugins

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #176499 by DenisChenu
Replied by DenisChenu on topic ensure privacy settings

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
6 months 2 days ago #177317 by DenisChenu
Replied by DenisChenu on topic ensure privacy settings
Tested (and working)
public function beforeSurveySave()
    {
        $oSurvey = $this->getEvent()->get('model');
        $oSurvey->anonymized = 'Y';
    }

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago #177579 by bewi
Replied by bewi on topic ensure privacy settings
Finaly I got that simple plugin. But only from documentation I would be lost. So great thanks to DenisChenu.

the plugin consists of one simple file (AnonOnly.php) in the plugin folder (AnonOnly/).
<?php
class AnonOnly extends \LimeSurvey\PluginManager\PluginBase {
 
	static protected $name = 'AnonOnly';
	static protected $description = 'forces all surveys to be anonymized';
 
 
	public function init() {
		/**
		 * Here you should handle subscribing to the events your plugin will handle
		 */
		$this->subscribe('beforeSurveySave');
	}
 
	public function beforeSurveySave() {
		$model = $this->getEvent()->get('model');
		$model->anonymized = 'Y';
	}
}

This will set each survey as anonymized on each saving. Starting from creating to each edit. An admin could change the field/checkbox in the edit form to 'N', but on save it is set again.

There is a loophole as you could change the value in the database itself, but that needs far more rights.
The following user(s) said Thank You: DenisChenu, tpartner

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago - 5 months 3 weeks ago #177587 by DenisChenu
Replied by DenisChenu on topic ensure privacy settings
I think you can do same with other settings too :
googleanalyticsstyle github.com/LimeSurvey/LimeSurvey/blob/e3...odels/Survey.php#L81
ipaddr github.com/LimeSurvey/LimeSurvey/blob/e3...odels/Survey.php#L48
refurl github.com/LimeSurvey/LimeSurvey/blob/e3...odels/Survey.php#L49

Else : you can hide it with another plugin adding a script in admin part, or create an admin template to hide it with CSS.

If user have access to database : he can deactivate any plugin … then … :/ o even update config if it's done via LimeSurvey core …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 5 months 3 weeks ago by DenisChenu.

Please Log in or Create an account to join the conversation.

More
5 months 1 week ago #178208 by bewi
Replied by bewi on topic ensure privacy settings
now I added this plugin into another instance and in the moment I want to enable the plugin I received an error:

500: Interner Serverfehler
CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value


Have I removed one line too much?
or a file?

I started with the AuditLog plugin. Based from that I deleted the line
protected $storage = 'DbStorage';
in the main class.

Also I removed the file 'mdlAnonOnly.php' which was an adapted version of 'mdlAuditLog.php'.

Both changes were done in the dev installation and no error occurred.

Please Log in or Create an account to join the conversation.

More
5 months 1 week ago #178234 by DenisChenu
Replied by DenisChenu on topic ensure privacy settings
Strange, LimeSurvey version difference ?

This one : www.limesurvey.org/forum/development/117...vacy-settings/178208

Must be OK in all 3.X version, for previous version, just remove \LimeSurvey\PluginManager\

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!