diff --git a/sources/.htaccess b/sources/.htaccess
deleted file mode 100644
index 3a10131..0000000
--- a/sources/.htaccess
+++ /dev/null
@@ -1,11 +0,0 @@
-
- RewriteEngine on
-
- # if a directory or a file exists, use it directly
- RewriteCond %{REQUEST_FILENAME} !-f
-
- # otherwise forward it to index.php
- RewriteRule . index.php
-
-# General setting to properly handle LimeSurvey paths
-# AcceptPathInfo on
\ No newline at end of file
diff --git a/sources/.scrutinizer.yml b/sources/.scrutinizer.yml
deleted file mode 100644
index 7041363..0000000
--- a/sources/.scrutinizer.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-filter:
- excluded_paths: [framework/*, locale/*, docs/*, fonts/*, third_party/*, application/third_party/*, images/*, styles/*, styles-public/*, templates/*, themes/*, tmp/*, upload/*]
- paths: [application/*]
-tools:
- php_code_sniffer:
- config:
- standard: "PSR1"
- php_pdepend:
- command: pdepend
- php_cs_fixer:
- config: { level: psr1 }
\ No newline at end of file
diff --git a/sources/application/commands/InstallCommand.php b/sources/application/commands/InstallCommand.php
index 70e2713..ffd6756 100644
--- a/sources/application/commands/InstallCommand.php
+++ b/sources/application/commands/InstallCommand.php
@@ -41,9 +41,6 @@
$sql_file = 'mysql';
break;
case 'pgsql':
- if (version_compare($this->connection->getServerVersion(),'9','>=')) {
- $this->connection->createCommand("ALTER DATABASE ". $this->connection->quoteTableName($this->getDBConnectionStringProperty('dbname')) ." SET bytea_output='escape';")->execute();
- }
$sql_file = 'pgsql';
break;
case 'dblib':
@@ -52,7 +49,7 @@
$sql_file = 'mssql';
break;
default:
- throw new Exception(sprintf('Unkown database type "%s".', $this->connection->driverName));
+ throw new Exception(sprintf('Unknown database type "%s".', $this->connection->driverName));
}
$this->_executeSQLFile(dirname(Yii::app()->basePath).'/installer/sql/create-'.$sql_file.'.sql');
$this->connection->createCommand()->insert($this->connection->tablePrefix.'users', array(
@@ -130,10 +127,12 @@
protected function createDatabase()
{
+ App()->configure(array('components'=>array('db'=>array('autoConnect'=>false)))) ;
+ $this->connection=App()->db;
+ App()->configure(array('components'=>array('db'=>array('autoConnect'=>true)))) ;
$connectionString = $this->connection->connectionString;
$this->connection->connectionString = preg_replace('/dbname=([^;]*)/', '', $connectionString);
- try
- {
+ try {
$this->connection->active=true;
}
catch(Exception $e){
diff --git a/sources/application/config/config-defaults.php b/sources/application/config/config-defaults.php
index 3d8cdfa..eef5dcb 100644
--- a/sources/application/config/config-defaults.php
+++ b/sources/application/config/config-defaults.php
@@ -68,10 +68,8 @@ $config['minrepeatheadings'] = 3; // The minimum number of rem
$config['defaultlang'] = 'en'; // The default language to use - the available languages are the directory names in the /locale dir - for example de = German
$config['timeadjust'] = 0; // Number of hours to adjust between your webserver local time and your own local time (for datestamping responses)
-$config['allowexportalldb'] = 1; // 0 will only export prefixed tables when doing a database dump. If set to 1 ALL tables in the database will be exported
+$config['allowexportalldb'] = 0; // 0 will only export prefixed tables when doing a database dump. If set to 1 ALL tables in the database will be exported
$config['maxdumpdbrecords'] = 500; // The maximum number of records that would be ouputted in a go during a database backup. Reduce this number if you're getting errors while backing up the entire database.
-$config['allowmandbackwards'] = 1; // Allow moving backwards (ie: << prev) through survey if a mandatory question
-// has not been answered. 1=Allow, 0=Deny
$config['deletenonvalues'] = 1; // By default, LimeSurvey does not save responses to conditional questions that haven't been answered/shown. To have LimeSurvey save these responses change this value to 0.
$config['stringcomparizonoperators'] = 0; // By default, LimeSurvey assumes the numrical order for comparizon operators in conditions. If you need string comparizon operators, set this parameter to 1
$config['shownoanswer'] = 1; // Show 'no answer' for non mandatory questions ( 0 = no , 1 = yes , 2 = survey admin can choose )
@@ -84,11 +82,11 @@ $config['allowunblacklist'] = 'N'; // Allow participant to unbl
$config['userideditable'] = 'N'; // Allow editing of user IDs
$config['defaulttemplate'] = 'default'; // This setting specifys the default theme used for the 'public list' of surveys
-$config['allowedtemplateuploads'] = 'gif,ico,jpg,png,css,js'; // File types allowed to be uploaded in the templates section.
+$config['allowedtemplateuploads'] = 'gif,ico,jpg,png,css,js,map,json,eot,svg,ttf,woff,txt,md'; // File types allowed to be uploaded in the templates section.
$config['allowedresourcesuploads'] = '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,ico,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,xml,zip,pstpl,css,js'; // File types allowed to be uploaded in the resources sections, and with the HTML Editor
-$config['memory_limit'] = '32'; // This sets how much memory LimeSurvey can access in megabytes. 32 mb is the minimum recommended - if you are using PDF functions up to 64 mb may be needed
+$config['memory_limit'] = '128'; // This sets how much memory LimeSurvey can access in megabytes. 128 MB is the minimum recommended - if you are using PDF functions up to 256 MB may be needed
$config['showpopups'] = 1; // Show popup messages if mandatory or conditional questions have not been answered correctly.
// 1=Show popup message, 0=Show message on page instead.
@@ -237,15 +235,15 @@ $config['usercontrolSameGroupPolicy'] = true;
$config['demoMode'] = false;
/**
-* Prefill the login mask using the parameters 'defaultuser' and 'default pass'. This works only if demo mode (demoMode) is activated.
+* Prefill the login mask using the parameters 'defaultuser' and 'default pass'. This works only if demo mode (demoMode) is activated.
* Also a notice will be shown that the user knows that he can just login by using the Login button.
-*
+*
* @var $config['demoModePrefill'] boolan If set to true prefill the login mask
*/
$config['demoModePrefill'] = false;
-/**
+/**
* column_style
* Because columns are tricky things, in terms of balancing visual
* layout against semantic markup. The choice has been left to the
@@ -312,15 +310,22 @@ $config['standard_templates_readonly'] = true;
$config['showsgqacode'] = false;
/**
-* When this settings is true/1 (default = false/0) then the printable survey option will show
+* When this settings is true/1 (default = false/0) then the printable survey option will show
* the raw relevance equation below the general fill-out instructions in case the question has conditions.
*/
$config['showrelevance'] = false;
+/**
+* To prevent brute force against forgotten password functionality, there is a random delay
+* that prevent attacker from knowing whether username and email address are valid or not.
+*/
+$config['minforgottenpasswordemaildelay'] = 500000;
+$config['maxforgottenpasswordemaildelay'] = 1500000;
+
/**
* PDF Export Settings
* This feature configures PDF export for Export Answers
-* PDF core fonts are not included in PDF: make ligther pdf
+* PDF core fonts are not included in PDF: make ligther pdf
* See http://www.tcpdf.org/fonts.php to have the list of PDF core fonts
*/
@@ -334,14 +339,15 @@ $config['alternatepdffontfile']=array(
'ar'=>'dejavusans',// 'dejavusans' work but maybe more characters in aealarabiya or almohanad: but then need a dynamic font size too
'be'=>'dejavusans',
'bg'=>'dejavusans',
- 'zh-Hans'=>'chinese',
- 'zh-Hant-HK'=>'chinese',
- 'zh-Hant-TW'=>'chinese',
+ 'zh-Hans'=>'cid0cs',
+ 'zh-Hant-HK'=>'cid0ct',
+ 'zh-Hant-TW'=>'cid0ct',
'cs'=>'dejavusans',
'cs-informal'=>'dejavusans',// This one not really tested: no translation for Yes/No or Gender
'el'=>'dejavusans',
'he'=>'freesans',
'hi'=>'dejavusans',
+ 'hr'=>'dejavusans',
'hu'=>'dejavusans',
'ja'=>'cid0jp',
'ko'=>'cid0kr',
@@ -367,27 +373,19 @@ $config['notsupportlanguages'] = array(
);
$config['pdffontsize'] = 9; //Fontsize for normal text; Surveytitle is +4; grouptitle is +2
$config['pdforientation'] = 'P'; // Set L for Landscape or P for portrait format
+$config['pdfshowheader'] = 'N'; // Show header in pdf answer export
+$config['pdflogofile'] = 'logo_pdf.png'; // File name of logo for single answer export. Path is template path, i.e. template/default/logo_pdf.png.
+ // If not found, resulting pdf doesn't have header. A large image implies slower pdf generation.
+$config['pdflogowidth'] = '50'; // Logo width
+$config['pdfheadertitle'] = ''; // Header title (bold font). If this config param is empty and header is enabled, site name is used
+$config['pdfheaderstring'] = ''; // Header string (under title). If this config param is empty and header is enabled, survey name is used
// QueXML-PDF: If set to true, the printable_help attribute will be visible on the exported PDF questionnaires
// If used, the appearance (font size, justification, etc.) may be adjusted by editing td.questionHelpBefore and $helpBeforeBorderBottom of quexml.
$config['quexmlshowprintablehelp'] = false;
-// CAS Settings
-/**
-* Please note that CAS functionality is very basic and you have to modify the client to your needs.
-* At least the hard work is done.
-* The Client is deployed in Limesurvey and a file login_check_cas.php does what login_check.php does in normal mode.
-*
-* $casEnabled determines if CAS should be used or not for Authentication.
-* $casAuthServer the servername of the cas Auth Server. Without http://
-* $casAuthPort CAS Server listening Port
-* $casAuthUri relative uri from $casAuthServer to cas workingdirectory
-*/
-$config['casEnabled'] = false;
-$config['casAuthServer'] = 'localhost';
-$config['casAuthPort'] = 8443;
-$config['casAuthUri'] = '/cas-server/';
-
+$config['minlengthshortimplode'] = 20; // Min length required to use short_implode instead of standard implode
+$config['maxstringlengthshortimplode'] = 100; // short_implode: Max length of returned string
/**
* Statistics chart settings
diff --git a/sources/application/config/config-sample-mysql.php b/sources/application/config/config-sample-mysql.php
index 7e97fba..e1b7aa1 100644
--- a/sources/application/config/config-sample-mysql.php
+++ b/sources/application/config/config-sample-mysql.php
@@ -22,10 +22,9 @@
|
*/
return array(
- 'name' => 'LimeSurvey',
'components' => array(
'db' => array(
- 'connectionString' => 'mysql:host=localhost;port=3306;dbname=limesurvey',
+ 'connectionString' => 'mysql:host=localhost;port=3306;dbname=limesurvey;',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
diff --git a/sources/application/config/routes.php b/sources/application/config/routes.php
index daf6058..df3ceea 100644
--- a/sources/application/config/routes.php
+++ b/sources/application/config/routes.php
@@ -18,6 +18,7 @@ $route['<_sid:\d+>/lang-<_lang:\w+[-\w]+>/tk-<_token:\w+>/*'] = "survey/index/si
$route['<_sid:\d+>/lang-<_lang:\w+[-\w]+>/*'] = "survey/index/sid/<_sid>/lang/<_lang>";
$route['<_sid:\d+>/tk-<_token:\w+>/*'] = "survey/index/sid/<_sid>/token/<_token>";
$route['<_sid:\d+>/*'] = "survey/index/sid/<_sid>";
+$route[''] = array('survey/index','matchValue'=>true);
//Admin Routes
$route['admin/index'] = "admin";
@@ -28,12 +29,15 @@ $route['admin///*'] = 'admin//sa/';
$route['admin/labels/<_action:\w+>'] = "admin/labels/index/<_action>";
$route['admin/labels/<_action:\w+>/<_lid:\d+>'] = "admin/labels/index/<_action>/<_lid>";
-$route['<_controller:\w+>/<_action:\w+>'] = '<_controller>/<_action>';
-
//Expression Manager tests
$route['admin/expressions'] = "admin/expressions/index";
-//optout
+//optout - optin
$route['optout/<_sid:\d+>/(:any)/(:any)'] = "optout/index/<_sid>/$2/$3";
+$route['optout/tokens/'] = array('optout/tokens','matchValue'=>true);
+$route['optin/tokens/'] = array('optin/tokens','matchValue'=>true);
+$route['statistics_user/'] = array('statistics_user/action','matchValue'=>true);
-return $route;
\ No newline at end of file
+$route['<_controller:\w+>/<_action:\w+>'] = '<_controller>/<_action>';
+
+return $route;
diff --git a/sources/application/config/tcpdf.php b/sources/application/config/tcpdf.php
index d0f19ee..21d7c2f 100644
--- a/sources/application/config/tcpdf.php
+++ b/sources/application/config/tcpdf.php
@@ -47,7 +47,7 @@
* ADD TRAILING SLASH!
***********************************************************/
- $tcpdf['base_url'] = '';
+ $tcpdf['base_url'] = 'dummy'; // If empty and debug === 2, "empty needle" occurs
/************************************************************
@@ -97,15 +97,6 @@
$tcpdf['blank_image'] = $tcpdf['image_directory'].'_blank.png';
- /************************************************************
- * TCPDF language settings file
- * ----------------------------------------------------------
- * Directory and filename of the language settings file
- ***********************************************************/
-
- $tcpdf['language_file'] = $tcpdf['base_directory'].'config'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.'eng.php';
-
-
/***************************************************************************
* DOCUMENT CONFIGURATION PARAMETERS
@@ -203,8 +194,11 @@
* HTML font size ratio
***********************************************************/
- $tcpdf['page_font'] = 'freemono';
+ $tcpdf['page_font'] = 'freesans';
$tcpdf['page_font_size'] = 9;
+ $tcpdf['data_font'] = 'freesans';
+ $tcpdf['data_font_size'] = 8;
+ $tcpdf['mono_font'] = 'freemono';
$tcpdf['small_font_ratio'] = 2/3;
diff --git a/sources/application/config/version.php b/sources/application/config/version.php
index 245286f..aff6dbf 100644
--- a/sources/application/config/version.php
+++ b/sources/application/config/version.php
@@ -13,8 +13,8 @@
*/
$config['versionnumber'] = "2.05+";
-$config['dbversionnumber'] = 177;
-$config['buildnumber'] = '';
+$config['dbversionnumber'] = 178;
+$config['buildnumber'] = '150520';
$config['updatable'] = true;
return $config;
diff --git a/sources/application/controllers/InstallerController.php b/sources/application/controllers/InstallerController.php
index 864180a..779b9a3 100644
--- a/sources/application/controllers/InstallerController.php
+++ b/sources/application/controllers/InstallerController.php
@@ -47,6 +47,7 @@ class InstallerController extends CController {
{
self::_checkInstallation();
self::_sessioncontrol();
+ Yii::import('application.helpers.common_helper', true);
switch ($action) {
@@ -237,6 +238,13 @@ class InstallerController extends CController {
$aData['classesForStep'] = array('off','off','off','on','off','off');
$aData['progressValue'] = 40;
$aData['model'] = $oModel = new InstallerConfigForm;
+ if (isset(Yii::app()->session['populateerror']))
+ {
+ $oModel->addError('dblocation',Yii::app()->session['populateerror']);
+ $oModel->addError('dbpwd','');
+ $oModel->addError('dbuser','');
+ unset(Yii::app()->session['populateerror']);
+ }
if(isset($_POST['InstallerConfigForm']))
{
@@ -461,7 +469,7 @@ class InstallerController extends CController {
$bCreateDB=false;
}
break;
- case 'postgres':
+ case 'pgsql':
try
{
$this->connection->createCommand("CREATE DATABASE \"$sDatabaseName\" ENCODING 'UTF8'")->execute();
@@ -547,7 +555,7 @@ class InstallerController extends CController {
case 'mysql':
$sql_file = 'mysql';
break;
- case 'dblib':
+ case 'dblib':
case 'sqlsrv':
case 'mssql':
$sql_file = 'mssql';
@@ -556,7 +564,7 @@ class InstallerController extends CController {
$sql_file = 'pgsql';
break;
default:
- throw new Exception(sprintf('Unkown database type "%s".', $sDatabaseType));
+ throw new Exception(sprintf('Unknown database type "%s".', $sDatabaseType));
}
//checking DB Connection
@@ -575,12 +583,15 @@ class InstallerController extends CController {
}
else
{
- $sConfirmation = $clang->gT('Database was populated but there were errors:').'
';
+ $sConfirmation = $clang->gT('There were errors when trying to populate the database:').'
';
foreach ($aErrors as $sError)
{
$sConfirmation.='
'.htmlspecialchars($sError).'
';
}
$sConfirmation.='
';
+ Yii::app()->session['populateerror']=$sConfirmation;
+
+ $this->redirect(array('installer/database'));
}
Yii::app()->session['tablesexist'] = true;
@@ -617,7 +628,7 @@ class InstallerController extends CController {
$sDefaultAdminRealName = $model->adminName;
$sDefaultSiteName = $model->siteName;
$sDefaultSiteLanguage = $model->surveylang;
- $sDefaultAdminEmail = $model->adminEmail;
+ $sDefaultAdminEmail = $model->adminEmail;
$aData['title'] = $clang->gT("Database configuration");
$aData['descp'] = $clang->gT("Please enter the database settings you want to use for LimeSurvey:");
@@ -631,8 +642,16 @@ class InstallerController extends CController {
if ($this->connection->getActive() == true) {
$sPasswordHash=hash('sha256', $sDefaultAdminPassword);
try {
+
+ if (User::model()->count()>0){
+ die();
+ }
// Save user
$user=new User;
+ // Fix UserID to 1 for MySQL even if installed in master-master configuration scenario
+ if (in_array($this->connection->getDriverName(), array('mysql', 'mysqli'))) {
+ $user->uid=1;
+ }
$user->users_name=$sDefaultAdminUserName;
$user->password=$sPasswordHash;
$user->full_name=$sDefaultAdminRealName;
@@ -835,10 +854,10 @@ class InstallerController extends CController {
if (version_compare(PHP_VERSION, '5.3.0', '<'))
$bProceed = !$aData['verror'] = true;
- if ($this->return_bytes(ini_get('memory_limit'))/1024/1024<64 && ini_get('memory_limit')!=-1)
+ if (convertPHPSizeToBytes(ini_get('memory_limit'))/1024/1024<64 && ini_get('memory_limit')!=-1)
$bProceed = !$aData['bMemoryError'] = true;
-
-
+
+
// mbstring library check
if (!check_PHPFunction('mb_convert_encoding', $aData['mbstringPresent']))
$bProceed = false;
@@ -904,16 +923,15 @@ class InstallerController extends CController {
function _setup_tables($sFileName, $aDbConfig = array(), $sDatabasePrefix = '')
{
extract(empty($aDbConfig) ? self::_getDatabaseConfig() : $aDbConfig);
- switch ($sDatabaseType) {
- case 'mysql':
- case 'mysqli':
- $this->connection->createCommand("ALTER DATABASE ". $this->connection->quoteTableName($sDatabaseName) ." DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;")->execute();
- break;
- case 'pgsql':
- if (version_compare($this->connection->getServerVersion(),'9','>=')) {
- $this->connection->createCommand("ALTER DATABASE ". $this->connection->quoteTableName($sDatabaseName) ." SET bytea_output='escape';")->execute();
- }
- break;
+ try{
+ switch ($sDatabaseType) {
+ case 'mysql':
+ case 'mysqli':
+ $this->connection->createCommand("ALTER DATABASE ". $this->connection->quoteTableName($sDatabaseName) ." DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;")->execute();
+ break;
+ }
+ } catch(Exception $e) {
+ return array($e->getMessage());
}
return $this->_executeSQLFile($sFileName, $sDatabasePrefix);
@@ -1052,7 +1070,7 @@ class InstallerController extends CController {
$sConfig .="\t\t" . ")," . "\n"
."\t\t" . "" . "\n"
-
+
."\t\t" . "// Uncomment the following line if you need table-based sessions". "\n"
."\t\t" . "// 'session' => array (" . "\n"
."\t\t\t" . "// 'class' => 'system.web.CDbHttpSession'," . "\n"
@@ -1133,7 +1151,7 @@ class InstallerController extends CController {
case 'mysql':
case 'mysqli':
// MySQL allow unix_socket for database location, then test if $sDatabaseLocation start with "/"
- if(substr($sDatabaseLocation,0,1)=="/")
+ if(substr($sDatabaseLocation,0,1)=="/")
$sDSN = "mysql:unix_socket={$sDatabaseLocation};dbname={$sDatabaseName};";
else
$sDSN = "mysql:host={$sDatabaseLocation};port={$sDatabasePort};dbname={$sDatabaseName};";
@@ -1153,7 +1171,7 @@ class InstallerController extends CController {
}
break;
- case 'dblib' :
+ case 'dblib' :
$sDSN = $sDatabaseType.":host={$sDatabaseLocation};dbname={$sDatabaseName}";
break;
case 'mssql' :
@@ -1238,33 +1256,12 @@ class InstallerController extends CController {
return true;
} catch(Exception $e) {
if (!empty($aData['model']) && !empty($aData['clang'])) {
- $aData['model']->addError('dblocation', $aData['clang']->gT('Try again! Connection with database failed. Reason: ') . $e->message);
+ $aData['model']->addError('dblocation', $aData['clang']->gT('Try again! Connection with database failed. Reason: ') . $e->getMessage());
$this->render('/installer/dbconfig_view', $aData);
} else {
return false;
}
}
}
-
- /**
- * This function returns the full number from a PHP ini value
- *
- * @param string $sValue
- */
- function return_bytes($sValue) {
- $sValue = trim($sValue);
- $sLast = strtolower($sValue[strlen($sValue)-1]);
- switch($sLast) {
- // The 'G' modifier is available since PHP 5.1.0
- case 'g':
- $sValue *= 1024;
- case 'm':
- $sValue *= 1024;
- case 'k':
- $sValue *= 1024;
- }
-
- return $sValue;
- }
}
diff --git a/sources/application/controllers/OptoutController.php b/sources/application/controllers/OptoutController.php
index d528f86..92cd270 100644
--- a/sources/application/controllers/OptoutController.php
+++ b/sources/application/controllers/OptoutController.php
@@ -73,7 +73,7 @@ class OptoutController extends LSYii_Controller {
}
else
{
- if ($oToken->emailstatus == 'OK')
+ if (substr($oToken->emailstatus, 0, strlen('OptOut')) !== 'OptOut')
{
$oToken->emailstatus = 'OptOut';
$oToken->save();
@@ -148,7 +148,7 @@ class OptoutController extends LSYii_Controller {
}
else
{
- if ($oToken->emailstatus == 'OK')
+ if (substr($oToken->emailstatus, 0, strlen('OptOut')) !== 'OptOut')
{
$oToken->emailstatus = 'OptOut';
$oToken->save();
@@ -166,7 +166,8 @@ class OptoutController extends LSYii_Controller {
{
$sMessage .= " ";
$sMessage .= $clang->gT("You have already been removed from the central participants list for this site");
- } else
+ }
+ else
{
$oParticipant->blacklisted='Y';
$oParticipant->save();
diff --git a/sources/application/controllers/PluginsController.php b/sources/application/controllers/PluginsController.php
index 38bcece..5110227 100644
--- a/sources/application/controllers/PluginsController.php
+++ b/sources/application/controllers/PluginsController.php
@@ -95,15 +95,19 @@ class PluginsController extends LSYii_Controller
$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)
diff --git a/sources/application/controllers/PrintanswersController.php b/sources/application/controllers/PrintanswersController.php
index 21464c0..e4abf2c 100644
--- a/sources/application/controllers/PrintanswersController.php
+++ b/sources/application/controllers/PrintanswersController.php
@@ -91,104 +91,130 @@
$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'];
//OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
//SHOW HEADER
- $sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
- ."
".$clang->gT("Survey name (ID):")." $sSurveyName ($iSurveyID)
\n";
- LimeExpressionManager::StartProcessingPage(true); // means that all variables are on the same page
- // Since all data are loaded, and don't need JavaScript, pretend all from Group 1
- LimeExpressionManager::StartProcessingGroup(1,($aSurveyInfo['anonymized']!="N"),$iSurveyID);
- $printanswershonorsconditions = Yii::app()->getConfig('printanswershonorsconditions');
- $aFullResponseTable = getFullResponseTable($iSurveyID,$sSRID,$sLanguage,$printanswershonorsconditions);
- //Get the fieldmap @TODO: do we need to filter out some fields?
- if($aSurveyInfo['datestamp']!="Y" || $sAnonymized == 'Y'){
- unset ($aFullResponseTable['submitdate']);
- }else{
- unset ($aFullResponseTable['id']);
- }
- unset ($aFullResponseTable['token']);
- unset ($aFullResponseTable['lastpage']);
- unset ($aFullResponseTable['startlanguage']);
- unset ($aFullResponseTable['datestamp']);
- unset ($aFullResponseTable['startdate']);
- $sOutput .= "
".$clang->gT("Survey name (ID):")." $sSurveyName ($iSurveyID)
\n";
+ LimeExpressionManager::StartProcessingPage(true); // means that all variables are on the same page
+ // Since all data are loaded, and don't need JavaScript, pretend all from Group 1
+ LimeExpressionManager::StartProcessingGroup(1,($aSurveyInfo['anonymized']!="N"),$iSurveyID);
+ $printanswershonorsconditions = Yii::app()->getConfig('printanswershonorsconditions');
+ $aFullResponseTable = getFullResponseTable($iSurveyID,$sSRID,$sLanguage,$printanswershonorsconditions);
+ //Get the fieldmap @TODO: do we need to filter out some fields?
+ if($aSurveyInfo['datestamp']!="Y" || $sAnonymized == 'Y'){
+ unset ($aFullResponseTable['submitdate']);
+ }else{
+ unset ($aFullResponseTable['id']);
}
- elseif (substr($sFieldname,0,4)=='qid_')
+ unset ($aFullResponseTable['token']);
+ unset ($aFullResponseTable['lastpage']);
+ unset ($aFullResponseTable['startlanguage']);
+ unset ($aFullResponseTable['datestamp']);
+ unset ($aFullResponseTable['startdate']);
+ $sOutput .= "