Actions

Configurações opcionais

From LimeSurvey Manual

Revision as of 21:34, 9 June 2013 by C schmitz (talk | contribs) (Text replace - "ã" to "ã")

Nota

Essas configurações opcionais só podem ser encontradas em config-defaults.php de uma instalação padrão. Se você quiser alterar essas configurações por favor, não mudá-la em config-defaults.php, deve copiar a configuração em particular para config.php e alterá-lo lá. Todas as configurações em config.php substituem os valores padrão de config-defaults.php e começando com a versão 1.87 algumas dessas configurações obter substituído na janela de configuração global. Desta forma é muito mais fácil de atualizar a sua instalação em um momento posterior!

Nota: Cada novo lançamento vê configurações introduzidas ou alteradas, por isso tome cuidado com a edição. Desde a versão 1,72, em agosto de 2008, a maioria das configurações de configuração foram movidos para config-defaults.php do config.php. Na versão 1.0, o config.php foi transferida para fora do admin/ para o diretório principal.

General settings

  • sitename: Give your survey site a name. This name will appear in the survey list overview and in the administration header. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • siteadminemail: This is the default email address of the site administrator and used for system messages and contact options. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • siteadminbounce: This is the email address where bounced emails will be sent to. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • siteadminname: The real name of the site administrator. (starting with 1.87 this setting is overridden in the Global settings dialog)

Security

  • 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. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • usercontrolSameGroupPolicy :  set to true by default. By default non admin users defined in the LimeSurvey management interface will only be able to see other users if they belong to at least one group this user belongs to. This is set by the following parameter:
  • 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. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • 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 save 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. Default: $sessionlifetime    =  3600; (starting with 1.87 this setting is overridden in the Global settings dialog)
  • memorylimit: This sets how much memory LimeSurvey can access. '32' is the minimum (M=mb) recommended. If you receive time out errors or have problems generating statistics or exporting files raise this limit to '128' or '256'.

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: 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. (Obsolete in 2.0)
  • $dropdownthreshold: 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 (flexible) type question, often you'll have a lot of answers, which - when displayed on screen - take up more than one page. The repeat-headers setting lets you decide how many answers 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 (which is the default).
  • $minrepeatheadings: The minimum number of reaming answers that are required before repeating the headings in array (flexible) questions.
  • $addTitleToLinks: If this option is set to true, then LimeSurvey will add 'title' html element to all links used in menus. This will help screen reader to analyze the menus. Only set this to true if you're using a screen reader because it overlaps with tool tips.
  • $defaulttemplate: This setting specifys the default theme used for the 'public list' of surveys. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • $defaulthtmleditormode: Sets the default mode for integrated HTML editor (starting with 1.87 this setting is overridden in the Global settings dialog) . Valid settings are: inline (default), popup and none:
    • inline: Inline replacement of fields by an HTML editor. Slow but convenient and user friendly
    • popup: Adds an icon that runs a popup with and html editor. Faster, but html code is displayed on the form
    • none: No html editor

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 surveys. You can change this setting for public surveys on a survey-by-survey basis from the admin scripts. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • $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. (starting with 1.87 this setting is merely a default and can be changed in the Global settings dialog)
  • $modrewrite: (Note: This setting is obsolete for version >=2.0) If set to 1, it activates the fancy URL feature (Example: http://survey.example.com/123456/lang-fr/tk-sdlfkjozeiru instead of http://survey.example.com/index.php?sid=123456⟨=fr&token;=sdlfkjozeiru). Before you activate this, you must rename "htaccess.txt" file to ".htaccess". You need to run an Apache web server with correctly installed mod_rewrite module.

Survey Behavior

  • $allowmandbackwards: A setting of 1 for this variable will allow survey participants to move to a previous question even if they haven't answered a mandatory question. If it is set on 0, then participants will have to answer that question even to move to a previous question.
  • $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 entry is shown for "N/A" - so that participants may choose to not answer the question. Some people prefer this not to be available. Set this to 0 to turn this off. (starting with 1.87 this setting is overridden in the Global settings dialog)
  • $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: This setting is relevant for all-in-one surveys using conditions and has bene introduced in LimeSurvey 1.85RC3. 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).

Development

  • $debug: With this setting you set the PHP error reporting to E_ALL. That means every little notice, warning or error with the script is shown. This setting should be only switched to 1 if you are trying to debug the application for any reason, if you are a developer switch it to 2. Don't switch it to 1 or 2 in production since it might cause path disclosure. (Default: 0)

Email Settings

Note: Starting with 1.87 the settings in this section are overridden in the Global settings dialog.

  • $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: (< 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: (< 1.8) The physical disk location of the jpgraph class scripts. This setting is only required if $usejpgraph is equal to 1.
  • jpgraphfont: (< 1.8) The font to use with graphs. A failsafe setting would be "FF_FONT1"
  • embedded: 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: (>=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: (>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
    • 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
  • $showsgqacode: (>1.91) This setting is used at the printable survey feature {IMG(attId="78",height="16",width="16")} 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.
  • {IMG(attId="79",height="200",width="400")}

Configurando o LDAP

Como este é um assunto extenso passamos Configurando o LDAP para outra página.

Autenticação

Delegado de autenticação para o servidor web

Administradores de sistema pode querer ter seu survey administrators autenticado em um sistema de autenticação central (Active Directory, OpenLDAP, Radius, ...) ao invés de usar o banco de dados LimeSurvey interno. Uma maneira fácil de fazer isso é configurar o seu software de servidor web para usar este sistema de autenticação externa, e então pedir LimeSurvey confiar a identidade do usuário relatado pelo servidor. A fim de habilitar esse recurso você precisa:

  • Definir $useWebserverAuth = true no config.php
  • Habilitar a autenticação no lado servidor

Please note that:

  • LimeSurvey will then bypass its own authentication process (by using the login name reported by the webserver without asking for a password)
  • this can only replace the LimeSurvey GUI authentication system, not the survey invitation system (participant interface)

Delegação de autenticação do usuário com nenhuma importação automática

Observe, porém, que por padrão autenticação delegação não burlar o sistema de autorização LimeSurvey : isto significa que, mesmo se você não tem que gerenciar senhas em LimeSurvey, você ainda precisa definir os usuários do LimeSurvey banco de dados e atribuir-lhes o conjunto correto de direitos, a fim de deixá-los de Pesquisa de Recursos de acesso.

Um usuário é, então, acesso a LimeSurvey se e somente se:

  • Ele foi autenticado para o servidor
  • Seu nome de usuário é definido como um usuário no banco de dados do usuário LimeSurvey (o usuário é, então, concedeu os privilégios do usuário definido na base de dados LimeSurvey).

Delegação de autenticação do usuário com importação automática

Quando o gerenciamento do banco de dados de usuários é enorme, às vezes é mais fácil fazer a importação automáticos dos usuários para o banco de dados LimeSurvey.

  • $WebserverAuth_autocreateUser: Se definido como verdadeiro LimeSurvey tentará importa automaticamente os usuários autenticados pelo servidor, mas não já no PO de seus usuários
  • $WebserverAuth_autouserprofile: uma matriz que descreve o perfil padrão que será atribuído ao usuário (incluindo o primeiro fake e último nome, e-mail, privilégios)

Se você quiser personalizar o perfil do usuário para que ele corresponda o usuário logado, você terá que desenvolver uma função simples chamado hook_get_autouserprofile: com esta função você pode recuperar a partir de um banco central conta de usuário (por exemplo, um diretório LDAP), Primeiro true & Sobrenomes e-mail de um usuário em particular. Você pode até personalizar seus privilégios no sistema baseado em seus grupos na DB externo.

A função hook_get_autouserprofile leva o nome de login do usuário como o único argumento e pode retornar:

  • Falso ou uma matriz vazia: neste caso, o usuário é negado o acesso a LimeSurvey
  • Um array contendo todos os itens comuns userprofile conforme descrito no $ 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();

An example of using a hook with Atlassian's Crowd as a backend is available here.

User name mapping

In case some users have an external user name that is different from their LimeSurvey user name, you may find useful to use a user name mapping. This is done in LimeSurvey by using the auth_webserver_user_map parameter. For instance imagine you don't have an 'admin' username defined in your external authentication database. Then in order to login to LimeSurvey as admin, you'll have to map your external username let's call it 'myname' to the admin login name ine LimeSurvey. The corresponding setup is :

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

After a successful authentication with the 'myname' login and password to the webserver, you'll be directly authorized to use LimeSurvey as the 'admin' user.

This obviously has serious security implications, so use it with care, and please protect your config.php from write access by the web server.

Use one time passwords

(since 1.81)

A user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.

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".

Advanced Path Settings

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.mydomain.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.
  • $fckeditordir: 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