Skip to content

Commit

Permalink
Merge branch 'master' of github:LimeSurvey/LimeSurvey
Browse files Browse the repository at this point in the history
  • Loading branch information
Aestu committed Dec 19, 2014
2 parents 1a68b62 + d6bdf70 commit b94b2ff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 6 additions & 2 deletions application/controllers/PluginsController.php
Expand Up @@ -95,15 +95,19 @@ public function actionConfigure($id)
$this->forward('plugins/index', true);
}

// Prepare settings to be send to the view.
$aSettings = $oPluginObject->getPluginSettings();

if (empty($aSettings))
{
// And show a message
Yii::app()->user->setFlash('pluginmanager', 'This plugin has no settings');
$this->forward('plugins/index', true);
}
$this->render('/plugins/configure', array('settings' => $aSettings, 'plugin' => $arPlugin));

// Send to view plugin porperties: name and description
$aPluginProp = App()->getPluginManager()->getPluginInfo($arPlugin['name']);

$this->render('/plugins/configure', array('settings' => $aSettings, 'plugin' => $arPlugin, 'properties' => $aPluginProp));
}

public function actionDeactivate($id)
Expand Down
7 changes: 5 additions & 2 deletions application/controllers/PrintanswersController.php
Expand Up @@ -91,10 +91,13 @@ function actionView($surveyid,$printableexport=FALSE)
$sSRID = $_SESSION['survey_'.$iSurveyID]['srid']; //I want to see the answers with this id
//Ensure script is not run directly, avoid path disclosure
//if (!isset($rootdir) || isset($_REQUEST['$rootdir'])) {die( "browse - Cannot run this script directly");}
if ($aSurveyInfo['printanswers'] == 'N')

//Ensure Participants printAnswer setting is set to true or that the logged user have read permissions over the responses.
if ($aSurveyInfo['printanswers'] == 'N' && !Permission::model()->hasSurveyPermission($iSurveyID,'responses','read'))
{
die(); //Die quietly if print answers is not permitted
throw new CHttpException(401, 'You are not allowed to print answers.');
}

//CHECK IF SURVEY IS ACTIVATED AND EXISTS
$sSurveyName = $aSurveyInfo['surveyls_title'];
$sAnonymized = $aSurveyInfo['anonymized'];
Expand Down
1 change: 1 addition & 0 deletions application/core/LSYii_Validators.php
Expand Up @@ -151,6 +151,7 @@ public function xssFilter($value)
$sNewValue.="}";
}
}
gc_collect_cycles(); // To counter a high memory usage of HTML-Purifier
return $sNewValue;
}
/**
Expand Down
9 changes: 6 additions & 3 deletions application/views/plugins/configure.php
@@ -1,8 +1,11 @@
<?php
$this->widget('ext.SettingsWidget.SettingsWidget', array(

$title = isset($properties['pluginName']) ? sprintf(gT("Settings for plugin: %s"), $properties['pluginName']) : null;
if (is_null($title)) $title = isset($plugin['name']) ? sprintf(gT("Settings for plugin %s"), $plugin['name']) : null;

$this->widget('ext.SettingsWidget.SettingsWidget', array(
'settings' => $settings,
'title' => isset($plugin['name']) ? sprintf(gT("Settings for plugin %s"), $plugin['name']) : null,
'title' => $title,
'formHtmlOptions' => array(
'id' => "pluginsettings-{$plugin['name']}",
),
Expand All @@ -15,4 +18,4 @@
)
)
));
?>
?>

0 comments on commit b94b2ff

Please sign in to comment.