Commit 9f5d04bc authored by Chenu Denis's avatar Chenu Denis

[fix] Better protection of public method

parent dbb54d0b
......@@ -4,10 +4,10 @@
* Export code and complete answer in CSV
*
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2014-2018 Denis Chenu <http://sondages.pro>
* @copyright 2014-2020 Denis Chenu <http://sondages.pro>
* @copyright 2014-2018 Belgian Health Care Knowledge Centre (KCE) <http://kce.fgov.be>
* @license AGPL v3
* @version 1.0.0
* @version 1.0.1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
......@@ -125,12 +125,12 @@ class exportCompleteAnswers extends PluginBase {
$this->subscribe('listExportOptions');
$this->subscribe('newExport');
}
public function beforeActivate()
{
$oEvent = $this->getEvent();
}
public function listExportOptions()
{
if (!$this->getEvent()) {
throw new CHttpException(403);
}
$event = $this->getEvent();
$type = $event->get('type');
......@@ -149,6 +149,9 @@ class exportCompleteAnswers extends PluginBase {
*/
public function listExportPlugins()
{
if (!$this->getEvent()) {
throw new CHttpException(403);
}
$event = $this->getEvent();
$exports = $event->get('exportplugins');
$newExport=array('csv'=>$exports['csv'],'csv-allanswer'=>get_class());
......@@ -158,6 +161,9 @@ class exportCompleteAnswers extends PluginBase {
}
public function newExport()
{
if (!$this->getEvent()) {
throw new CHttpException(403);
}
$event = $this->getEvent();
$type = $event->get('type');
switch ($type) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment