Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LimeSurvey/LimeSurvey
Browse files Browse the repository at this point in the history
  • Loading branch information
mdamien committed Jan 24, 2013
2 parents 62398f9 + db0327a commit 9b717c2
Show file tree
Hide file tree
Showing 361 changed files with 19,405 additions and 18,046 deletions.
16 changes: 16 additions & 0 deletions .gitattributes
@@ -0,0 +1,16 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.php text eol=lf
*.css text eol=lf
*.js text eol=lf
*.pstpl text eol=lf
*.html text eol=lf

# Denote all files that are truly binary and should not be modified.
*.jpg binary
*.png binary
*.gif binary
*.ico binary
*.mo binary
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,8 @@
/upload/templates/*
/tmp/runtime/HTML
/application/controllers/admin/updater.php
/tmp/*.html
/tmp/*.lss
/tmp/*.png
/tmp/*.xls
/upload/.htaccess
18 changes: 2 additions & 16 deletions admin/admin.php
@@ -1,16 +1,2 @@
<?php
/*
* LimeSurvey
* Copyright (C) 2007-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.
*/

// Simple redirect to still have the old /admin URL
header( 'Location: ../index.php/admin' ) ;
?>
<?php
include 'index.php';
43 changes: 29 additions & 14 deletions admin/index.php
@@ -1,16 +1,31 @@
<?php
/*
* LimeSurvey
* Copyright (C) 2007-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.
*/
/*
* LimeSurvey
* Copyright (C) 2007-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.
*/

// Simple redirect to still have the old /admin URL
header( 'Location: ../index.php/admin' ) ;
?>
$config_folder = dirname(__FILE__) . '/../application/config/';
$config_file = $config_folder . 'config.php';
if (!file_exists($config_file))
{
$config_file = $config_folder . 'config-sample-mysql.php';
}
define('BASEPATH', dirname(__FILE__) . '/..'); // To prevent direct access not allowed
$config = require($config_file);

$urlStyle = $config['components']['urlManager']['urlFormat'];

// Simple redirect to still have the old /admin URL
if ($urlStyle == 'path') {
header( 'Location: ../index.php/admin' );
} else {
// For IIS use get style
header( 'Location: ../index.php?r=admin' );
}
48 changes: 48 additions & 0 deletions application/commands/console.php
@@ -0,0 +1,48 @@
#!/usr/bin/php
<?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.
*
*
* File edited by Sam Mousa for Marcel Minke.
* This loader bypasses the default Yii loader and loads a custom console class instead.
*/
if (!isset($argv[0])) die();
define('BASEPATH','.');

// Load configuration.
$sCurrentDir=dirname(__FILE__);
$config=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
$core = dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR;
unset ($config['defaultController']);
unset ($config['config']);



// fix for fcgi
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

defined('YII_DEBUG') or define('YII_DEBUG',true);

require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'yii.php');

if(isset($config))
{
require_once($core . 'ConsoleApplication.php');
$app=Yii::createApplication('ConsoleApplication', $config);
define('APPPATH', Yii::app()->getBasePath() . DIRECTORY_SEPARATOR);
$app->commandRunner->addCommands(YII_PATH.'/cli/commands');
$env=@getenv('YII_CONSOLE_COMMANDS');
if(!empty($env))
$app->commandRunner->addCommands($env);
}
$app->run();
?>
62 changes: 54 additions & 8 deletions application/config/config-defaults.php
Expand Up @@ -87,7 +87,7 @@

$config['allowedresourcesuploads'] = '7z,aiff,asf,avi,bmp,csv,doc,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,xml,zip,pstpl,css,js'; // File types allowed to be uploaded in the resources sections, and with the HTML Editor

$config['memorylimit'] = '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'] = '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['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.
Expand Down Expand Up @@ -200,7 +200,7 @@
// defined above by its return value
//
// You can use any external DB in order to fill the profile for the user_name passed as the first parameter
// A dummy example for the 'hook_get_autouserprofile' function is given below:
// A dummy example for the 'hook_get_auth_webserver_profile' function is given below:
//
//function hook_get_auth_webserver_profile($user_name)
//{
Expand Down Expand Up @@ -314,15 +314,55 @@
$config['showsgqacode'] = false;



/**
* PDF Export Settings
* This feature configures PDF export for Export Answers
* 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
*/

$config['pdfdefaultfont'] = 'freemono'; //Default font for the pdf Export
$config['pdfdefaultfont'] = 'auto'; //Default font for the pdf Export
/**
* $alternatepdffontfile - array of the font file name used to created pdf in statistics in specific langage - this font are included in tcpdf core
* Only used if $pdfdefaultfont is set to auto or set to a PDF core fonts
* Some langage are not tested : need translation for Yes,No and Gender : ckb, swh
*/
$config['alternatepdffontfile']=array(
'ar'=>'freesans',// 'dejavusans' work too 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',
'cs'=>'dejavusans',
'cs-informal'=>'dejavusans',// This one not really tested: no translation for Yes/No or Gender
'el'=>'dejavusans',
'he'=>'freesans',
'hi'=>'dejavusans',
'hu'=>'dejavusans',
'ja'=>'cid0jp',
'ko'=>'cid0kr',
'lv'=>'dejavusans',
'lt'=>'dejavusans',
'mk'=>'dejavusans',
'mt'=>'dejavusans',
'fa'=>'dejavusans',
'pl'=>'dejavusans',
'pa'=>'freesans',
'ro'=>'dejavusans',
'ru'=>'dejavusans',
'sr'=>'dejavusans',
);
/**
* $notsupportlanguages - array of language where no font was found for PDF
* Seems not used actually
*/
$config['notsupportlanguages'] = array(
'am',// Amharic
'si',// Sinhala
'th',// Thai
);
$config['pdffontsize'] = 9; //Fontsize for normal text; Surveytitle is +4; grouptitle is +2
$config['notsupportlanguages'] = array('zh-Hant-TW','zh-Hant-HK','zh-Hans','ja','th');
$config['pdforientation'] = 'P'; // Set L for Landscape or P for portrait format


Expand Down Expand Up @@ -499,13 +539,19 @@
*/
$config['RPCInterface'] = 'off';


/**
* This parameter sets the default session expiration time in seconds
* Default is 8 hours
* Default is 2 hours
* @var integer
*/
$config['iSessionExpirationTime'] = 28800;
$config['iSessionExpirationTime'] = 7200;

/**
* This parameter can be used to set some question not selectable in LimeReplacementFiels
* Default is an empty array, leave it for new question modules system
* @var array
*/
$config['InsertansUnsupportedtypes'] = array();

// === Advanced Setup
// The following parameters need information from config.php
Expand Down
1 change: 1 addition & 0 deletions application/config/routes.php
Expand Up @@ -17,6 +17,7 @@
$route['<_sid:\d+>/lang-<_lang:\w+[-\w]+>/tk-<_token:\w+>'] = "survey/index/sid/<_sid>/lang/<_lang>/token/<_token>"; //This one must be first
$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>";

//Admin Routes
$route['admin/index'] = "admin";
Expand Down

0 comments on commit 9b717c2

Please sign in to comment.