Actions

Preferencias Opcionales

From LimeSurvey Manual

Revision as of 17:43, 22 August 2016 by Elifeleth (talk | contribs)

Nota

Las ajustes opcionales solamente pueden ser encontradas dentro del archivo /application/config/config-defaults.php en un standard de instalación - algunas de estos solamente usados cuando se instala por primera vez, algunas de ellas sobrescritas en Global settings.

  If you want to change these settings please do not change it in config-defaults.php but copy the particular setting/line over to /application/config/config.php in 'config'=>array() and change it there.


All settings in config.php overwrite the default values from config-defaults.php and some of these settings get overridden in the Global settings dialog (New in 1.87 ) . This way it is much easier to upgrade your installation at a later time!

To update/add the LimeSurvey settings in /application/config/config.php you have to update the config array:

    'config'=>array(
        'debug'=>0,
        'debugsql'=>0,
        'LimeSurveySetting'=>'New value',
    )

Yii settings

LimeSurvey uses the Yii framework and Yii has its own configuration parameters in the application/config/config.php file. You can access some specific configuration settings of LimeSurvey also via the Yii configuration.

The Yii-specific settings are set in the components array:

    'components' => array(
        'db' => array(
            ....
        ),
        'Specific settings'=>array(
            ....
        ),
    ),

Database settings

The database settings are written by the installer to the config.php file when you install LimeSurvey for the first time. If needed you can update this part of the config. Please remember that you do this at your own risk. See also the [Yii documentation], and please remember that LimeSurvey supports only the database types mysql,pgsql,dblib,mssql, and sqlsrv.

Session settings

You can set some session parameters in config.php, the first example is the session in the database. You can uncomment/add the part needed in config.php. See [Yii Documentation] for other settings.

If you use SSL ('https') for your LimeSurvey installation adding the following lines to your config.php will increase session security:

        // Set the cookie via SSL
        'session' => array (
            'cookieParams' => array(
                    'secure' => true, // use SSL for cookies
                    'httponly' => true // Cookies may not be used by other protocols - experimental
                ),
            ),

If you want to fix the domain for a cookie use this in config.php:

        // Set the domain for cookie
        'session' => array (
            'cookieParams' => array(
                    'domain' => '.example.org',
                ),
            ),

Request settings

The request settings are important, but the default settings are already optimized for LimeSurvey usage. See Yii Documentation for more information.

Some example you can modify in your LimeSurvey configuration:At your own risk :

        // Disable CSRF protection
        'request' => array(
            'enableCsrfValidation'=>false,    
            ),
        // Enforce a certain base URL 
        'request' => array(
            'hostInfo' => 'http://www.example.org/'  
            ),
        // Set the cookie domain name for CSRF protection
        'request' => array(
            'csrfCookie' => array( 'domain' => '.example.com' )
        ),

URL settings

To have the same behaviour like the old 'Fancy URL' feature , you can update the urlManager

       // Use short URL
		'urlManager' => array(
			'urlFormat' => 'path',
			'showScriptName' => false,
		),

Adding .html after the survey id

       // Use short URL
		'urlManager' => array(
			'urlFormat' => 'path',
			'rules' => array (
			    '<sid:\d+>' => array('survey/index','urlSuffix'=>'.html','matchValue'=>true),
			 ),
			'showScriptName' => false,
		),

Find more information in the Yii documentation.

General settings

  • sitename: Give your survey site a name. This name will appear in the survey list overview and in the administration header. This setting is used only as default value and overridden in the Global settings dialog (New in 1.87 ).
  • siteadminemail: This is the default email address of the site administrator and used for system messages and contact options. This setting is used only as default value and overridden by the Global settings dialog (New in 1.87 ).
  • siteadminbounce: This is the email address where bounced emails will be sent to. This setting is used only as default value and overridden by the Global settings dialog (New in 1.87 ).
  • siteadminname: The real name of the site administrator. This setting is used only as default value and overridden in the Global settings dialog) (New in 1.87 ).
  • proxy_host_name: This is the host name of your proxy server (if you are behind a proxy and want to update LimeSurvey using ComfortUpdate) (New in 2.05 ).
  • proxy_host_port: This is the port of your proxy server (if you are behind a proxy and want to update LimeSurvey using ComfortUpdate) (New in 2.05 ).

Security

  • maxLoginAttempt: If the user enters password incorrectly this is the number of attempts before the users is locked out by IP address.
  • timeOutTime: If the user enters password incorrectly for <maxLoginAttempt> set the lock out time (in seconds).
  • surveyPreview_require_Auth: true by default. If you set this to false any person can test your survey using the survey URL - without logging in to the administration and without having to activate the survey first. This setting is a default value and can be overridden in the Global settings dialog (New in 1.87 ).
  • usercontrolSameGroupPolicy :  Set to true by default. By default non-admin users defined in the LimeSurvey management interface will only be able to see users they create or users that belongs to at least one same group. This setting is a default value and can be overridden in the Global settings dialog.
  • filterxsshtml: This setting enables filtering of suspicious html tags in survey, group, questions and answer texts in the administration interface. Only leave this to 'false' if you absolutely trust the users you created for the administration of  LimeSurvey and if you want to allow these users to be able to use Javascript, Flash Movies, etc. Super admin never have their HTML filtered. This setting is a default value and can be overridden in the Global settings dialog (New in 1.87 ).
  • demoModeOnly: If this option is set to true, then LimeSurvey will go into demo mode. The demo mode changes the following things:
    • Disables changing of the admin user's details and password
    • Disables uploading files on the template editor
    • Disables sending email invitations and reminders
    • Disables doing a database dump
    • Disables the ability to modify the following global settings: Site name, Default language, Default Htmleditor Mode, XSS filter

Resources

  • sessionlifetime: Defines the time in seconds after which a survey session expires. It applies only if you are using database sessions. This setting is overridden in the Global settings dialog) (New in 1.87 ).
  • memorylimit: This sets how much memory LimeSurvey can access. '128M' is the minimum (M=Megabyte) recommended. If you receive time out errors or have problems generating statistics or exporting files raise this limit to '256M' or higher. If your webserver has set a higher limit then this setting will be ignored.
Please mind that such local settings by an application can always be overruled by global server settings.

To increase the memory limit to 128M you could also try adding:

  • memory_limit = 128M to your server's main php.ini file (recommended, if you have access)
  • memory_limit = 128M to a php.ini file in the LimeSurvey root
  • php_value memory_limit 128M in a .htaccess file in the LimeSurvey root

Appearance

  • lwcdropdowns: (Obsolete since 2.0) This can be set to either "L" or "R". Setting it to "R" will result in 'List with Comment' questions being displayed as radio buttons, whereas "L" will result in 'List with Comment' questions being displayed in a 'dropdown' list box .
  • dropdownthreshold:' (Obsolete since 2.50) When you have selected "R" for $dropdowns, this allows you to set a maximum number of options that will display as radio buttons, before converting back to a dropdown list. If you have a question that has a large number of options, displaying them all as radio buttons can look unweildy, and be counter-intuitive to users. Setting this to a maximum of, say 25 (which is the default) means that large lists are easier for the survey participant to use.
  • repeatheadings: With the Array type question, often you'll have a lot of subquestions, which - when displayed on screen - take up more than one page. This setting lets you decide how many subquestions should be displayed before repeating the header information for the question. A good setting for this is around 15. If you don't want the headings to repeat at all, set this to 0. This setting is overridden in the Global settings dialog) (New in 2.05 ).
  • minrepeatheadings: The minimum number of remaining subquestions that are required before repeating the headings in Array questions.
  • defaulttemplate: This setting specifys the default theme used for the 'public list' of surveys. This setting is overridden in the Global settings dialog) (New in 1.87 ).
  • defaulthtmleditormode: Sets the default mode for integrated HTML editor. This setting is overridden in the Global settings dialog) (New in 1.87 ). Valid settings are:
    • inline: Inline replacement of fields by an HTML editor. Slow but convenient and user friendly
    • popup: Adds an icon that runs the HTML editor in a popup if needed. Faster, but HTML code is displayed in the form.
    • none: No HTML editor
  • column_style: Defines how columns are rendered for survey answers when using display_columns. Valid settings are:
    • 'css' using one of the various CSS only methods for creating columns (see template style sheet for details).
    • 'ul' using multiple floated unordered lists. (default)
    • 'table' using conventional tables based layout.
    • NULL disable the use of columns

Language & time

  • defaultlang: This should be set to the default language to be used in your administration scripts, and also the default setting for language in the public survey list. This setting is overridden in the Global settings dialog) (New in 1.87 ).
  • timeadjust: If your web server is in a different time zone to the location where your surveys will be based, put the difference between your server and your home time zone here. For example, I live in Australia but use a US web server. The web server is 14 hours behind my local time zone. So my setting here is "14". In other words, it adds 14 hours to the web servers time. This setting is particularly important when surveys timestamp the responses. This setting is overridden in the Global settings dialog) (New in 1.87 ).

Survey behavior

  • deletenonvalues: Use this feature with caution.  By default (a value of 1), irrelevant questions are NULLed in the database.  This ensures that the data in your database is internally consistent.  However, there are rare cases where you might want to hold onto irrelevant values, in which case you can set the value to 0.  Say you ask the person his gender, and he accidentally says 'female' and then answers some female-specific questions (questions that are conditioned on being female, so are only relevant for women).  Then, he realizes his mistake, backs up, sets the gender to 'male', and continues with the survey.  Now, the female-specific questions are irrelevant.  If $deletenonvalues==1, those irrelevant values will be cleared (NULLed) in the database.  If $deletenonvalues==0, his erroneous answers will not be deleted, so they will still be present in the database when you analyze it.
  • shownoanswer: When a question of a radio button/select type that contains editable answers (ie: List, Array questions) is not mandatory and shownoanswer is set to 1, an additional 'No answer' entry is shown - so that participants may choose to not answer the question. Some people prefer this not to be available. This setting is overridden in the Global settings dialog) (New in 1.87 ). Valid values are:
    • 0 = no ,
    • 1 = yes ,
    • 2 = survey admin can choose.
  • printanswershonorsconditions: This setting determines if the printanswers feature will display entries from questions that were hidden by conditions-branching (Default: 1 = hide answers from questions hidden by conditions).
  • hide_groupdescr_allinone: (New in 1.85 ) This setting is relevant for all-in-one surveys using conditions . When this is set to true the group name and description is hidden if all questions in the group are hidden. (Default: true - hide group name and description when all conditions in the group are hidden by conditions)
  • showpopups:  Show popup messages if mandatory or conditional questions have not been answered correctly. 1=Show popup message (default), 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).

Desarrollo

  • $debug: Con esta opción puedes ajustar el reporte de errores de PHP a E_ALL. Esto significa que cada pequeño aviso, alerta o error del script se mostrará. Esta opción sólo debe ser 1 si estás intentando depurar la aplicación por alguna razón, si eres un desarrollador, debe ser 2. No lo cambies a 1 ni a 2 en la producción, ya que tal vez pueda causar la revelación de rutas. (Por defecto es 0)

If you experience an error in the application, we strongly recommend to acivate the debug setting so you usually get some more detailed error that you can submit with the bug report:

    'config'=>array(
        'debug'=>2,
        'debugsql'=>0,
    )

Opciones de correo electrónico

Note: All these settings in this section are overridden in the Global settings dialog (New in 1.87 ).

  • emailmethod:  This determines how E-mail messages are being sent. The following options are available:
    • mail: use internal PHP mailer
    • sendmail: use sendmail mailer
    • smtp:use SMTP relaying. Use this setting when you are running LimeSurvey on a host that is not your mail server.
  • emailsmtphost: If you use 'smtp' as $emailmethod then you have to put your SMTP-server here. If you are using Google mail you might have to add the port number like $emailsmtphost = 'smtp.gmail.com:465';
  • emailsmtpuser: If your SMTP-server needs authentication then set this to your user name, otherwise it must be blank.
  • emailsmtppassword: If your SMTP-server needs authentication then set this to your password, otherwise it must be blank.
  • emailsmtpssl: Set this to 'ssl' or 'tls' to use SSL/TLS for SMTP connection
  • maxemails: When sending invitations or reminders to survey participants, this setting is used to determine how many emails can be sent in one bunch. Different web servers have different email capacities, and if your script takes too long to send a bunch of emails, the script could time out and cause errors. Most web servers can send 100 emails at a time within the default 30 second time limit for a PHP script. If you get script timeout errors when sending large numbers of emails, reduce the number in this setting.  Clicking the 'send email invitation' button on the token control toolbar, (not the button on the right of each token), sends the maxemails number of invitations, then displays a list of the addresses sent to and a warning that "There are more emails pending than could be sent in one batch. Continue sending emails by clicking below. There are ### emails still to be sent." and provides a "continue button" to proceed with the next batch. I.e., the user determines when to send the next batch after each batch gets emailed.  It is not necessary to wait with this screen active.  The admin could log off and come back at a later time to send the next batch of invites.

Statistics and Response Browsing

  • usejpgraph: (Obsolete since 1.8) The JPGraph-library lets you display the results of your survey in the statistics part of LimeSurvey  in bar- and pie charts. If you have a correctly configured jpgraph class set up on your server, you can turn this feature on or off (1=on, 0=off). Please have a look, every version of PHP needs another version of JPGraph! This feature is currently in development, so expect a few weird outcomes.
  • jpgraphdir: (Obsolete since 1.8) The physical disk location of the jpgraph class scripts. This setting is only required if $usejpgraph is equal to 1.
  • jpgraphfont: (Obsolete since 1.8) The font to use with graphs. A failsafe setting would be "FF_FONT1"
  • embedded: (Obsolete since 2.0) If you want to integrate LimeSurvey into another page then you can turn off sending HTML headers by using this setting and point instead to the header method of a custom function. This is a dirty hack but should work for a quick integration.
  • filterout_incomplete_answers: Control the default behaviour of  filtering incomplete answers when browsing or analyzing responses. For a discussion on incomplete Responses see Browsing survey results. Since these records can corrupt the statistics, an option is given to switch this filter on or off in several GUI forms. This parameter config.php is just the default state for the incomplete answer filter. The following options are available:
    • show: Show both complete and incomplete answers
    • filter: Show only complete answers
    • incomplete: Show only incomplete answers
  • strip_query_from_referer_url: This setting determine if the referrer URL saves parameter or not. Default value is "false" (in this case referrer URL saves all parameter). Alternatively this value can be set to "true" and the parameter part of the referrer URL will be removed.
  • showaggregateddata: (New in 1.8 ) When activated there are additional values like arithmetic mean and standard deviation at statistics. Furthermore data is aggregated to get a faster overview e.g. results of scale 1+2 and 4+5 are added to have a general ranking like "good" (1/2), "average" (3) and "bad" (4/5). This only affects question types "A" (5 point array) and "5" (5 point choice).
  • PDF Export Settings: (New in 1.85 ) This feature activates PDF export for printable survey and Print Answers. The PDF export is totally experimental. The output is mostly ugly. At this point no support can be given - if you want to help to fix it please get in touch with us.
    • usepdfexport: Set 0 to disable; 1 to enable
    • pdfdefaultfont: Default font for the pdf Export
    • alternatepdffontfile: an array with key for language and specific font for this language can be replaced or just updated .
    • pdffontsize: Fontsize for normal text; Surveytitle is +4; grouptitle is +2
    • notsupportlanguages = array('zh-Hant-TW','zh-Hant-HK','zh-Hans','ja','th');
    • pdforientation: Set L for Landscape or P for portrait format
  • '"Graph setting"'
    • chartfontfile : Font file to be used : must be in the server font directory or in ./fot directory
    • alternatechartfontfile : an array with key for language and specific font for this language can be replaced or just updated .
  • showsgqacode: (New in 1.91 ) This setting is used at the printable survey feature and defaults to false. If you set showsgqacode = true; the IDs for each question - and answer if applicable - will be shown; these IDs match the column heading at the Lime_survey_12345 table which holds the answer data for a certain survey. These Ids can be used for a code book for manual database queries.

LDAP settings

Ya que es un tema bastante largo, movimos LDAP settings a otra página.

Autenticación

Starting with LimeSurvey 2.05 authentication will be handled by plugins. Because of this the information below might be outdated. See Plugins for most up to date information.

Delegar Autenticación al servidor web

A los administradores de sistema les puede interesar que sus administradores de encuesta sean autenticados usando un sistema de autenticación central (Active Directory, openLdap, Radius, ...) en vez de usar la base de datos interna de LimeSurvey. Una manera fácil de hacer esto es configurar tu servidor web para que use este sistema de autenticación externa, y después decirle a LimeSurvey que confíe en la identidad suplida por el servidor web. Para activar esta función necesitas:

  • ajustar $useWebserverAuth a true en config.php
  • habilitar la autenticación del lado del servidor web

Por favor note que:

  • LimeSurvey se saltará su propio proceso de autenticación (usando el nombre de usuario reportado por el servidor web sin pedir contraseña)
  • Esto sólo puede reemplazar el sistema gráfico de autenticación de LimeSurvey, no el sistema de invitaciones de encuestas (interfaz del participante)

Delegación de la Autenticación sin importación automática de usuarios

Por favor note que por defecto la delegación de autenticación no anula el sistema de autorización de LimeSurvey: esto significa que incluso si no quieres administrar contraseñas usando LimeSurvey, tienes que definir los usuarios en la base de datos de LimeSurvey y asignar los permisos pertinentes para dejar que usen los recursos de la encuesta.

Un usuario tiene acceso a LimeSurvey si y sólo si:

  • ya fue autenticado por el servidor web
  • su nombre de usuario está definido la base de datos de LimeSurvey (se le han otorgado los privilegios definidos en la base de datos de LimeSurvey)

Delegación de Autenticación con importación automática de usuario

Cuando se administra una base de datos muy grande, es más fácil auto-importar los usuarios a la base de datos de LimeSurvey.

  • $WebserverAuth_autocreateUser: si es true, LimeSurvey intentará auto-importar a los usuarios autenticados por el servidor web pero que no estén en su base de datos.
  • $WebserverAuth_autouserprofile: un arreglo describiendo el perfil por defecto que se le asignará al usuario (incluyendo nombre y apellidos falsos, correo electrónico y privilegios)

Si quieres personalizar el perfil del usuario para que se acople al usuario, deberás desarrollar una función simple llamada hook_get_autouserprofile: con esta función puedes conseguir de la base de datos central (por ejemplo, un directorio LDAP), los nombres, apellidos y correo electrónico del usuario. Incluso puedes personalizar sus privilegios del sistema basado en su grupo y la base de datos externa.

La función hook_get_autouserprofile toma el nombre de usuario como su único argumento, y puede regresar:

  • False o un arreglo vacío: en este caso, al usuario se le deniega el acceso a LimeSurvey.
  • un arreglo que contiene todas las entradas comunes del perfil del usuario, definidas en $WebserverAuth_autouserprofile
function hook_get_auth_webserver_profile($user_name)
{
     // Retrieve user's data from your database backend (for instance LDAP) here
     ... get $user_name_from_backend
     ... get $user_email_from_backend
     ... get $user_lang_from_backend
     ... from groups defined in your backend set $user_admin_status_frombackend_0_or_1
     return Array(
                     'full_name' => "$user_name_from_backend",
                     'email' => "$user_email_from_backend",
                     'lang' => '$user_lang_from_backend',
                     'htmleditormode' => 'inline',
                     'templatelist' => 'default,basic,MyOrgTemplate',
                     'create_survey' => 1,
                     'create_user' => 0,
                     'delete_user' => 0,
                     'superadmin' => $user_admin_status_frombackend_0_or_1,
                     'configurator' =>0,
                     'manage_template' => 0,
                     'manage_label' => 0);
}

     // If user should be denied access, return an empty array

     // return Array();

Mapeo de nombres de usuario

Algunos usuarios tienen un nombre de usuario externo diferente al de LimeSurvey; te puede ser útil usar el mapeo de nombres de usuario. Esto se hace con el parámetro $userArrayMap. Por ejemplo, imagina que no tienes un nombre de usuario 'admin' en tu base de datos de autenticación externa. Para poder accesar a LimeSurvey, deberás mapear tu nombre de usuario externo al nombre de usuario en LimeSurvey. Se hace así:

$config['auth_webserver_user_map'] = Array ('myname' => 'admin');

Después de una autenticación exitosa con el nombre de usuario 'myname' y contraseña con el servidor web, serás autorizado a LimeSurvey como el usuario 'admin'.

Esto tiene obviamente implicaciones de seguridad bastante serias, así que úsalo con cuidado, y por favor protege tu archivo config.php contra escritura por parte del servidor web.

Uso de contraseñas de sólo un uso

Uso de contraseñas de sólo un uso

Desde la versión 1.81, el usuario puede llamar la autenticación de limesurvey en /limesurvey/admin y pasar un nombre de usuario y contraseña de un sólo uso que se escribió con anterioridad en la tabla de usuarios (en la columna one_time_pw) por una aplicación externa.

This setting has to be turned on (use_one_time_passwords => true) to enable the usage of one time passwords (default = false). More information can be found at "Manage Users".

Configuraciones avanzadas de rutas

If possible do no touch these settings. Additionally these settings can only be adjusted on config-defaults.php.

  • homeurl: This should be set to the URL location of your administration scripts. These are the scripts in the /limesurvey/admin folder. This should be set to the WEB URL location - for example "http://www.example.com/limesurvey/html/admin". Don't add a trailing slash to this entry. The default setting in config.php attempts to detect the name of your server automatically using a php variable setting - {$_SERVER['SERVER_NAME']}. In most cases you can leave this and just modify the remainder of this string to match the directory name you have put the LimeSurvey scripts in.
  • publicurl: This should be set to the URL location of your 'public scripts'. The public scripts are those located in the "limesurvey" folder (or whatever name you gave to the directory that all the other scripts and directories are kept in).
  • tempurl: This should be set to the URL location of your "/limesurvey/tmp" directory - or a directory which you would like LimeSurvey to use to store temporary files, including uploads. This directory must be set to read & write for your webserver (e.g. chmod 755)
  • imagefiles: By default you should leave this pointing to the URL location of /limesurvey/admin/images - where the images are installed initially. You may, however, prefer to move these images to another location and if so point this to the URL directory where they are stored.
  • homedir: This should be set to the physical disk location of your administration scripts - for example "/home/usr/htdocs/limesurvey/admin". Don't add a trailing slash to this entry. The default setting in config.php attempts to detect the default root path of all your documents using the php variable setting - {$_SERVER['DOCUMENT_ROOT']}. In most cases you can leave this and just modify the remainder of this string to match the directory name you have put the LimeSurvey scripts in.
  • publicdir: This should be set to the physical disk location of your 'public scripts'.
  • tempdir: This should be set to the physical disk location of your /limesurvey/tmp directory so that the script can read and write files.
  • sCKEditorURL: url of the fckeditor script
  • fckeditexpandtoolbar: defines if the FCKeditor toolbar should be opened by default
  • pdfexportdir: Directory with the tcpdf.php extensiontcpdf.php
  • pdffonts: Directory for the TCPDF fonts