Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/LimeSurvey/LimeSurvey.git …
…into master_RC_AuthPlugin Dev: fix conflict * 'master' of https://github.com/LimeSurvey/LimeSurvey.git: (84 commits) Dev: remove deprecated code _GetSessionUserRights Dev: USER_RIGHT_INITIALSUPERADMIN replaced by config Dev: and not used since 2.6lts or before Fixed issue #13200: LDAP Auth plugin user autocreate broken Dev: just unsubscribe from beforeHasPermission when needed Dev: i hate to find a one line fix after testing, hacking for hours … Dev: removed special characters from sidemenu Dev: minimal changes and typo fixing Dev: translate surveymenuentried Fixed issue: language error Fixed issue #13212: missing translation frontend survey Fixed issue: Emailtemplate reset not working Fixed issue #13215: Missing string Fixed issue #13216: missing translation Updated translation: Catalan by qualitatuvic Updated translation: German by c_schmitz Updated translation: Hungarian by kkd Updated translation: Norwegian (Bokmål) by pmonstad Updated translation: Polish by elissa Updated translation: German (Informal) by c_schmitz Updated translation: Polish (Informal) by elissa Fixed issue #13193: Unable to update question type (simple selector) Dev: added a demomode command to not only restore mint status but also install some demo surveys Fixed issue: Demo rendered unusable with wipe command New feature #12240: Validation settings for "array by column" question type Fixed issue #13190 : Remove text or uncheck checkbox automatically not work Updated translation: Danish by abc99 Updated translation: Georgian by zch5368 Updated translation: German by c_schmitz Updated translation: Hungarian by kkd Updated translation: Japanese by nomoto Updated translation: Norwegian (Bokmål) by pmonstad Updated translation: Romanian by cdorin Fixed issue: Captcha not showing Removed translation: Papiamento (Aruba) ... # Conflicts: # application/helpers/remotecontrol/remotecontrol_handle.php
- Loading branch information
Showing
139 changed files
with
3,120 additions
and
1,846 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<?php | ||
/* | ||
* LimeSurvey (tm) | ||
* Copyright (C) 2011 The LimeSurvey Project Team / Carsten Schmitz | ||
* All rights reserved. | ||
* License: GNU/GPL License v2 or later, see LICENSE.php | ||
* LimeSurvey is free software. This version may have been modified pursuant | ||
* to the GNU General Public License, and as distributed it includes or | ||
* is derivative of works licensed under the GNU General Public License or | ||
* other free or open source software licenses. | ||
* See COPYRIGHT.php for copyright notices and details. | ||
*/ | ||
class DemomodeCommand extends CConsoleCommand | ||
{ | ||
|
||
public function run($sArgument) | ||
{ | ||
if (isset($sArgument) && isset($sArgument[0]) && $sArgument[0] = 'yes') { | ||
echo "\n###### Restoring installation to demomode #####\n"; | ||
echo "|| Resetting Database\n"; | ||
$this->_resetDatabase(); | ||
echo "|| Resetting Files\n"; | ||
$this->_resetFiles(); | ||
echo "|| Installing demo surveys\n"; | ||
$this->_createDemo(); | ||
echo "##### Done recreating demo state #####\n"; | ||
} else { | ||
// TODO: a valid error process | ||
echo 'This CLI command wipes a LimeSurvey installation clean (including all user except for the user ID 1 and user-uploaded content). For security reasons this command can only started if you add the parameter \'yes\' to the command line.'; | ||
} | ||
|
||
} | ||
|
||
private function _resetDatabase(){ | ||
Yii::import('application.helpers.common_helper', true); | ||
Yii::import('application.helpers.database_helper', true); | ||
|
||
//Truncate most of the tables | ||
$truncatableTables = ['{{assessments}}','{{answers}}','{{conditions}}','{{defaultvalues}}','{{labels}}','{{labelsets}}','{{groups}}','{{questions}}','{{surveys}}','{{surveys_languagesettings}}','{{quota}}','{{quota_members}}','{{quota_languagesettings}}','{{question_attributes}}','{{quota}}','{{quota_members}}','{{quota_languagesettings}}','{{question_attributes}}','{{user_groups}}','{{user_in_groups}}','{{templates}}','{{template_configuration}}','{{participants}}','{{participant_attribute_names}}','{{participant_attribute_names_lang}}','{{participant_attribute_values}}','{{participant_shares}}','{{settings_user}}','{{failed_login_attempts}}','{{saved_control}}','{{survey_links}}']; | ||
foreach($truncatableTables as $table){ | ||
$actquery = "truncate table ".$table; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
} | ||
//Now delete the basics in all other tables | ||
$actquery = "delete from {{permissions}} where uid<>1"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "delete from {{users}} where uid<>1"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{users}} set lang='en'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{users}} set lang='auto'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "delete from {{settings_global}} where stg_name LIKE 'last_question%'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "delete from {{settings_global}} where stg_name LIKE 'last_survey%'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{users}} set email = 'test@domain.test', full_name='Administrator'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{settings_global}} set stg_value='' where stg_name='googleanalyticsapikey' or stg_name='googleMapsAPIKey' or stg_name='googletranslateapikey' or stg_name='ipInfoDbAPIKey' or stg_name='pdfheadertitle' or stg_name='pdfheaderstring'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{settings_global}} set stg_value='test@domain.test' where stg_name='siteadminbounce' or stg_name='siteadminemail'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{settings_global}} set stg_value='Administrator' where stg_name='siteadminname'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
$actquery = "update {{settings_global}} set stg_value='Sea_Green' where stg_name='admintheme'"; | ||
Yii::app()->db->createCommand($actquery)->execute(); | ||
|
||
$surveyidresult = dbGetTablesLike("tokens%"); | ||
foreach ($surveyidresult as $sv) { | ||
Yii::app()->db->createCommand("drop table ".$sv)->execute(); | ||
} | ||
|
||
$surveyidresult = dbGetTablesLike("old\_%"); | ||
foreach ($surveyidresult as $sv) { | ||
Yii::app()->db->createCommand("drop table ".$sv)->execute(); | ||
} | ||
|
||
$surveyidresult = dbGetTablesLike("survey\_%"); | ||
foreach ($surveyidresult as $sv) { | ||
if (strpos($sv, 'survey_links') === false && strpos($sv, 'survey_url_parameters') === false) { | ||
Yii::app()->db->createCommand("drop table ".$sv)->execute(); | ||
} | ||
} | ||
|
||
// At last reset the basic themes | ||
foreach($templateData=LsDefaultDataSets::getTemplatesData() as $template){ | ||
Yii::app()->db->createCommand()->insert("{{templates}}", $template ); | ||
} | ||
foreach($templateConfigurationData=LsDefaultDataSets::getTemplateConfigurationData() as $templateConfiguration){ | ||
Yii::app()->db->createCommand()->insert("{{template_configuration}}", $templateConfiguration ); | ||
} | ||
} | ||
|
||
private function _resetFiles(){ | ||
|
||
$sBaseUploadDir = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'upload'; | ||
|
||
SureRemoveDir($sBaseUploadDir.DIRECTORY_SEPARATOR.'surveys', false); | ||
SureRemoveDir($sBaseUploadDir.DIRECTORY_SEPARATOR.'templates', false); | ||
SureRemoveDir($sBaseUploadDir.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'survey', false); | ||
SureRemoveDir($sBaseUploadDir.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'question', false); | ||
} | ||
|
||
private function _createDemo(){ | ||
Yii::app()->loadHelper('admin/import'); | ||
require_once(dirname(dirname(dirname(__FILE__))).'/application/helpers/expressions/em_manager_helper.php'); | ||
|
||
Yii::app()->session->add( 'loginID', 1 ); | ||
$documentationSurveyPath = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'docs'.DIRECTORY_SEPARATOR.'demosurveys'.DIRECTORY_SEPARATOR; | ||
$aSamplesurveys = scandir($documentationSurveyPath); | ||
foreach($aSamplesurveys as $sSamplesurvey) { | ||
@XMLImportSurvey($documentationSurveyPath.$sSamplesurvey); | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
function SureRemoveDir($dir, $DeleteMe) | ||
{ | ||
if (!$dh = @opendir($dir)) { | ||
return; | ||
} | ||
while (false !== ($obj = readdir($dh))) { | ||
if ($obj == '.' || $obj == '..') { | ||
continue; | ||
} | ||
if (!@unlink($dir.'/'.$obj)) { | ||
SureRemoveDir($dir.'/'.$obj, true); | ||
} | ||
} | ||
closedir($dh); | ||
if ($DeleteMe) { | ||
if (!@rmdir($dir)) { | ||
echo "Error: could not delete ".$dir; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php if (!defined('BASEPATH')) { | ||
exit('No direct script access allowed'); | ||
} | ||
/** | ||
* Font packages | ||
* @license GPL v3 | ||
* core path is application/core/packages | ||
* | ||
* Note: When debug mode, asset manager is turned off by default. | ||
* To enjoy this feature, add to your package definition a 'devBaseUrl' with the relative url to your package | ||
* | ||
*/ | ||
$debug = isset($userConfig['config']['debug']) ? $userConfig['config']['debug'] : 0; | ||
/* To add more easily min version : config > 2 , seems really an core dev issue to fix bootstrap.js ;) */ | ||
$minVersion = ($debug > 0) ? "" : ".min"; | ||
/* needed ? @see third_party.php */ | ||
if (isset($_GET['isAjax'])) { | ||
return array(); | ||
} | ||
return array( | ||
|
||
'fontawesome' => array( | ||
//'basePath' => 'third_party.bootstrap', // Need fix third_party alias | ||
'devBaseUrl' => 'assets/fonts/font-src/fontawesome/', | ||
'basePath' => 'fonts.font-src.fontawesome', | ||
'css'=> array( | ||
'css/font-awesome'.$minVersion.'.css', | ||
), | ||
), | ||
|
||
'font-roboto' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'roboto.css', | ||
), | ||
), | ||
|
||
'font-icomoon' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'icomoon.css', | ||
), | ||
), | ||
|
||
'font-noto' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'noto.css', | ||
), | ||
), | ||
|
||
'font-news_cycle' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'news_cycle.css', | ||
), | ||
), | ||
|
||
'font-ubuntu' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'ubuntu.css', | ||
), | ||
), | ||
|
||
'font-lato' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'lato.css', | ||
), | ||
), | ||
|
||
// see: https://www.w3schools.com/cssref/css_websafe_fonts.asp | ||
'font-websafe' => array( | ||
'devBaseUrl' => 'assets/fonts/', | ||
'basePath' => 'fonts', | ||
'css' => array( | ||
'websafe.css', | ||
), | ||
), | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.