How can I obtain the registration of the participant's ip, to validate that only those who responded to the survey can view the public statistics, since anyone with the url can view them, I know yii, php, but I do not see how to return the model in the driver the value of ipaddr.
I got a half solution since I have to manually add in a txt file the ip addresses, some comments my code:
if ($surveyinfo != 'Y' || (!in_array($_SERVER, $whitelist))) {
throw new CHttpException(404, 'Las estadisticas para esta Encuesta no son públicas.');
}
My Code: /application/controllers/Statistics_userController.php:
$whitelist = SurveyDynamic::model($iSurveyID)->findByAttributes(array("ipaddr"=>$_SERVER['REMOTE_ADDR']));
if ($surveyinfo['publicstatistics'] != 'Y' || (!$whitelist)) {
throw new CHttpException(404, 'Las estadisticas para esta Encuesta no son públicas.');
}
In this way, the results of the survey can only be viewed by the participants.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
I know that there is that function so I asked the question which would be the best way, as an improvement could be offered that the public statistics will be shown by ip or token would be great.
You could show us how to use the BeforeControllerAction in LimeSurvey.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.