Skip to content

Commit

Permalink
Merge branch 'develop' into master_13513
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Oct 6, 2018
2 parents a1d0c69 + 561b1ef commit ae041e8
Show file tree
Hide file tree
Showing 773 changed files with 111,285 additions and 43,637 deletions.
377 changes: 377 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .htaccess
Expand Up @@ -7,6 +7,14 @@

# otherwise forward it to index.php
RewriteRule . index.php

# deny access to hidden files and directories except .well-known
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^(.*/)?\.+ - [F]
</IfModule>

# deny access to hidden files and directories without mod_rewrite
RedirectMatch 403 ^/(?!\.well-known/)(.*/)?\.+

# General setting to properly handle LimeSurvey paths
# AcceptPathInfo on
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -30,7 +30,8 @@ before_script:
- php application/commands/console.php install admin password TravisLS no@email.com verbose
- cp application/config/config-sample-mysql.php application/config/config.php
# Enable debug=2 in config file. OBS: This assumes debug is on line 59.
- sed -i '59s/.*/ "debug"=>2,/' application/config/config.php
# TODO: Disable, a lines was added to config file and some tests started to fail.
# - sed -i '59s/.*/ "debug"=>2,/' application/config/config.php

# Install Apache.
# Code fetched from https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
Expand Down Expand Up @@ -72,4 +73,4 @@ before_script:

script:
# Run tests.
- DOMAIN=localhost phpunit --stop-on-failure
- DOMAIN=localhost phpunit # --stop-on-failure
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -51,3 +51,17 @@ for more information please refer to our [homepage](http://www.limesurvey.org),
LimeSurvey software is licensed under the [GPL 2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), or at your choice any later version of the license.

Pictures and the LimeSurvey Logo are registered trademarks of LimeSurvey GmbH, Hamburg, Germany.

## Tools used
We are using BrowserStack to run manual tests on different browsers and devices

[![](https://raw.githubusercontent.com/LimeSurvey/LimeSurvey/master/docs/contributions/browserstack-logo.png "Checkout BrowserStack")](https://www.browserstack.com/)

We are using Scrutinizer to static check our code

[![](https://raw.githubusercontent.com/LimeSurvey/LimeSurvey/master/docs/contributions/scrutinizer-logo.png "Checkout scrutinizer")](https://scrutinizer-ci.com/)

We are using TravisCI to run automated tests before release

[![](https://raw.githubusercontent.com/LimeSurvey/LimeSurvey/master/docs/contributions/travisci-logo.png "Checkout TravisCI")](https://travis-ci.org/)

10 changes: 9 additions & 1 deletion application/commands/InstallFromConfigCommand.php
Expand Up @@ -182,17 +182,25 @@ protected function createDatabase()
switch ($this->connection->driverName) {
case 'mysqli':
case 'mysql':
$this->connection->createCommand("CREATE DATABASE `$sDatabaseName` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")->execute();
$exists = $this->connection->createCommand(
"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$sDatabaseName'"
)->queryScalar();
if (!$exists) {
$this->connection->createCommand("CREATE DATABASE `$sDatabaseName` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")->execute();
}
break;
case 'dblib':
case 'mssql':
case 'odbc':
// TODO: Check if exists
$this->connection->createCommand("CREATE DATABASE [$sDatabaseName];")->execute();
break;
case 'pgsql':
// TODO: Check if exists
$this->connection->createCommand("CREATE DATABASE \"$sDatabaseName\" ENCODING 'UTF8'")->execute();
break;
default:
// TODO: Check if exists
$this->connection->createCommand("CREATE DATABASE $sDatabaseName")->execute();
break;
}
Expand Down
22 changes: 20 additions & 2 deletions application/config/config-defaults.php
Expand Up @@ -93,8 +93,11 @@

$config['memory_limit'] = '256'; // This sets how much memory LimeSurvey can access in megabytes. 256 MB is the minimum recommended - if you are using PDF functions up to 512 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.
$config['showpopups'] = 2; // Show popup messages if mandatory or conditional questions have not been answered correctly.
// 2 = defined by Theme option (default)
// 1 = Show popup message
// 0 = Show message on page instead;
// -1 = Do not show the message at all (in this case, users will still see the question-specific tips indicating which questions must be answered).

$config['maxemails'] = 50; // The maximum number of emails to send in one go (this is to prevent your mail server or script from timeouting when sending mass mail)

Expand Down Expand Up @@ -695,5 +698,20 @@
// This is useful when developing a theme, so changes to XML files are immediately applied without the need to uninstall and reinstall the theme.
$config['force_xmlsettings_for_survey_rendering'] = false;

$config['usePluginWhitelist'] = false;

$config['pluginCoreList'] = [
'AuditLog',
'ExportR',
'ExportSTATAxml',
'extendedStartPage',
'oldUrlCompat',
'AuthLDAP',
'Authdb',
'Authwebserver'
];

$config['pluginWhitelist'] = [];

return $config;
//settings deleted
3 changes: 2 additions & 1 deletion application/config/config-sample-dblib.php
Expand Up @@ -35,7 +35,8 @@
'initSQLs'=>array('SET DATEFORMAT ymd;', 'SET QUOTED_IDENTIFIER ON;'),
),

// Uncomment the following line if you need table-based sessions
// Uncomment the following lines if you need table-based sessions.
// Note: Table-based sessions are currently not supported on MSSQL server.
// 'session' => array (
// 'class' => 'application.core.web.DbHttpSession',
// 'connectionID' => 'db',
Expand Down
3 changes: 2 additions & 1 deletion application/config/config-sample-mysql.php
Expand Up @@ -34,7 +34,8 @@
'tablePrefix' => 'lime_',
),

// Uncomment the following line if you need table-based sessions
// Uncomment the following lines if you need table-based sessions.
// Note: Table-based sessions are currently not supported on MSSQL server.
// 'session' => array (
// 'class' => 'application.core.web.DbHttpSession',
// 'connectionID' => 'db',
Expand Down
3 changes: 2 additions & 1 deletion application/config/config-sample-pgsql.php
Expand Up @@ -35,7 +35,8 @@
'tablePrefix' => 'lime_',
),

// Uncomment the following line if you need table-based sessions
// Uncomment the following lines if you need table-based sessions.
// Note: Table-based sessions are currently not supported on MSSQL server.
// 'session' => array (
// 'class' => 'application.core.web.DbHttpSession',
// 'connectionID' => 'db',
Expand Down
3 changes: 2 additions & 1 deletion application/config/config-sample-sqlsrv.php
Expand Up @@ -35,7 +35,8 @@
'initSQLs'=>array('SET DATEFORMAT ymd;', 'SET QUOTED_IDENTIFIER ON;'),
),

// Uncomment the following line if you need table-based sessions
// Uncomment the following lines if you need table-based sessions.
// Note: Table-based sessions are currently not supported on MSSQL server.
// 'session' => array (
// 'class' => 'application.core.web.DbHttpSession',
// 'connectionID' => 'db',
Expand Down
44 changes: 41 additions & 3 deletions application/config/internal.php
Expand Up @@ -62,7 +62,22 @@
// 'CaptchaExtendedValidator' => realpath(__DIR__ . '/../extensions/captchaExtended/CaptchaExtendedValidator.php')
),

/*
here you can load the different modules
more about YII modules :
https://www.yiiframework.com/doc/guide/1.1/en/basics.module
'modules'=>array(
'yourmodule'=array(
'class' => 'Use a yii Alias',
)
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'toto',
Expand All @@ -71,6 +86,10 @@
),
),
*/

'params'=>array(
'defaultPageSize'=>10, // Default page size for most of the grids
'pageSizeOptions'=>array(5=>5, 10=>10, 20=>20, 50=>50, 100=>100), // Default page size options for most of the grids
Expand Down Expand Up @@ -131,6 +150,7 @@
'class'=>'LSHttpRequest',
'enableCsrfValidation'=>true, // CSRF protection
'enableCookieValidation'=>false, // Enable to activate cookie protection
'noCsrfValidationParams'=>array(),
'noCsrfValidationRoutes'=>array(
'remotecontrol',
'plugins/unsecure',
Expand Down Expand Up @@ -237,17 +257,20 @@
'ellipsizeString' => 'LS_Twig_Extension::ellipsizeString',
'flatEllipsizeText' => 'LS_Twig_Extension::flatEllipsizeText', /* Temporary keep it */
'str_replace' => 'str_replace',
'getConfig' => 'LS_Twig_Extension::getConfig',
'getExpressionManagerOutput' => 'LS_Twig_Extension::getExpressionManagerOutput',/* Not in 3.X */
'getTextDisplayWidget' => 'LS_Twig_Extension::getTextDisplayWidget',/* Not in 3.X */

'checkPermission' => 'LS_Twig_Extension::checkPermission',/* Not in 3.X */
'getAllQuestionClasses' => 'LS_Twig_Extension::getAllQuestionClasses',
'getLanguageNameFromCode' => 'getLanguageNameFromCode',/* Not in 3.X */

'intval' => 'intval',
'empty' => 'empty',
'count' => 'count',
'count' => 'LS_Twig_Extension::safecount',
'reset' => 'reset',
'in_array' => 'in_array',
'in_multiarray' => 'LS_Twig_Extension::in_multiarray',
'array_search' => 'array_search',
'renderCaptcha' => 'LS_Twig_Extension::renderCaptcha',
'getPost' => 'LS_Twig_Extension::getPost',
'getParam' => 'LS_Twig_Extension::getParam',
Expand All @@ -270,6 +293,8 @@
'getEditor' => 'getEditor',
'darkencss' => 'LS_Twig_Extension::darkencss',
'lightencss' => 'LS_Twig_Extension::lightencss',
'getAllTokenAnswers' => 'LS_Twig_Extension::getAllTokenAnswers',
'getAllAnswers' => 'LS_Twig_Extension::getAllAnswers',
),
'filters' => array(
'jencode' => 'CJSON::encode',
Expand All @@ -296,11 +321,13 @@
'round',
'replace',
'last',
'first',
'url_encode',
'capitalize',
'lower',
'upper',
'strip_tags',
'number_format',
),
'methods' => array(
'ETwigViewRendererStaticClassProxy' => array("encode", "textfield", "form", "link", "emailField", "beginForm", "endForm", "dropDownList", "htmlButton", "passwordfield", "hiddenfield", "textArea", "checkBox"),
Expand Down Expand Up @@ -343,16 +370,19 @@
'flatEllipsizeText',
'str_replace',
'flattenText',
'getConfig',
'getExpressionManagerOutput',
'getTextDisplayWidget',

'getLanguageNameFromCode',
'getAllQuestionClasses',
'checkPermission',
'intval',
'empty',
'count',
'reset',
'in_array',
'array_search',
'in_multiarray',
'renderCaptcha',
'getPost',
'getParam',
Expand Down Expand Up @@ -380,9 +410,17 @@
'getEditor',
'darkencss',
'lightencss',
'getAllTokenAnswers',
'getAllAnswers',
),
),
),
'extensionUpdaterServiceLocator' => array(
'class' => '\LimeSurvey\ExtensionInstaller\ExtensionUpdaterServiceLocator',
),
'versionFetcherServiceLocator' => array(
'class' => '\LimeSurvey\ExtensionInstaller\VersionFetcherServiceLocator',
),
)
);

Expand Down
29 changes: 18 additions & 11 deletions application/config/packages.php
Expand Up @@ -119,7 +119,7 @@
'devBaseUrl' => 'assets/packages/pjax/',
'basePath' => 'core.pjax',
'js' => array(
$debug > 0 ? 'pjax.js' : 'min/pjax.min.js',
'pjax.js',
),
'depends' => array(
'lslog',
Expand Down Expand Up @@ -205,14 +205,12 @@
'css/displayParticipants.css',
),
'js' => array(
'js/confirmdeletemodal.js',
'js/bootstrap-remote-modals.js',
'js/admin_core.js',
'js/notifications.js',
'build/adminbasics'.(($debug > 0) ? '' : '.min').'.js',
),
'depends' => array(
'jquery',
'pjaxbackend',
'lslog',
)
),

Expand All @@ -229,8 +227,7 @@
'css/rtl/displayParticipants-rtl.css',
),
'js' => array(
'js/admin_core.js',
'js/notifications.js',
'build/adminbasics.js',
),
'depends' => array(
'jquery',
Expand All @@ -243,14 +240,11 @@
'basePath' => 'core.adminbasics',
'position' =>CClientScript::POS_BEGIN,
'js' => array(
'js/notify.js',
'js/panelclickable.js',
'js/panelsanimation.js',
'js/save.js',
),
'depends' => array(
'jquery',
'pjaxbackend',
'adminbasics'
)
),

Expand All @@ -259,6 +253,7 @@
'basePath' => 'core.surveymenufunctions',
'js' => array(
'surveymenufunctionswrapper'.$minVersion.'.js',
'surveymenuentryfunctions'.$minVersion.'.js',
),
'depends' => array(
'adminbasics',
Expand Down Expand Up @@ -316,5 +311,17 @@
// Empty, 'expressions' for 4.0
)
),
),

'decimalcustom' => array(
'devBaseUrl' => 'assets/packages/decimalcustom/',
'basePath' => 'core.decimalcustom',
'position' =>CClientScript::POS_BEGIN,
'js' => array(
'decimalcustom.js',
),
'depends' => array(
'decimal',
)
)
);
22 changes: 22 additions & 0 deletions application/config/questiontypes.php
Expand Up @@ -94,4 +94,26 @@
'emoji'
]
),
/* array-numeric question */
'question-array-numeric'=>array(
'devBaseUrl' => 'assets/packages/questions/arraynumeric/',
'basePath' => 'core.questions.arraynumeric',
'position' => CClientScript::POS_BEGIN,
'css'=> array(
),
'js'=>array(
'scripts/array-totalsum'.$minVersion.'.js',
),
),
/* array-numeric question */
'timer-addition'=>array(
'devBaseUrl' => 'assets/packages/questions/timer/',
'basePath' => 'core.questions.timer',
'position' => CClientScript::POS_BEGIN,
'css'=> array(
),
'js'=>array(
'timer'.$minVersion.'.js',
),
),
);

0 comments on commit ae041e8

Please sign in to comment.