====== Additional Server Settings ======
You can make most settings for the web server under **Server Management** -> **Server Settings**. However, SoSci Survey also has some default values that you cannot change there, because a change is usually not necessary -- for example, the maximum file sizes for uploading files or the default templates for questions or layouts.
The constants are defined in the file ''/inc/definitions.php'' (hereinafter only ''definitions.php'') and can be overwritten/adjusted in the configuration ''/system/config.php'' (hereinafter only ''config.php''). Never change the file ''definitions.php'' directly, because such changes are overwritten by an update.
**Warning:** A change to the file ''config.php'' may result in the survey server no longer being accessible in the browser (neither for project managers nor for participants). Only make changes if a temporary server outage is acceptable, and always create a backup copy of the file before making changes.
**Important:** Manual changes to the file ''config.php'' are always made at your own risk. As a matter of principle, other files must not be changed -- for technical reasons __and__ because the software license prohibits this on the basis of copyright law.
**Important:** Before you manually adjust settings other than those mentioned below, please contact us. We can then clarify that a manual change of the setting does not unexpectedly impair the survey server.
===== Maximum File Sizes =====
The maximum file sizes for uploading files (and also the file types) are stored in the variable $GLOBALS['oFb']['allowed']. You will find the default settings in the file ''definitions.php'' if you search for "allowed":
'allowed' => array(
'audios' => array('mp3','wma','ra'),
'audio.size' => 5242880, // 5 MB
'images' => array('gif','jpg','jpeg','png','svg'),
'image.size' => 512000, // 500 KB
'documents' => array('pdf', 'html'),
'document.size' => 5242880, // 5 MB
'videos' => array('swf','flv','mpg','ogg','avi','rm', 'mov', 'wmv'),
'video.size' => 33554432, // 32 MB
'control' => array('css', 'js', 'xml'),
'control.size' => 102400, // 100 KB
'logo size' => 204800, // Maximum size of a logo to upload or import: 200K
'upload.size' => 1048576 // Max. filesize of respondents' uploads: 1 MB (PDFs for example)
),
Accordingly, the maximum file size for video uploads is specified in the variable ''$GLOBALS['oFb']['allowed']['video.size']''. To allow uploading files up to 100 MB, now overwrite this variable in the file ''config.php'' by adding the following line __directly before__ the ''?>'' at the end of the file:
$GLOBALS['oFb']['allowed']['video.size'] = 104857600;
You can also add PHP comments here as you like. The end of the file ''config.php'' would then look something like this:
...
false // Use persistent connection
);
// end(database)
// Manual adjustments
$GLOBALS['oFb']['allowed']['video.size'] = 104857600; // Videos up to 100 MB
?>
===== Default Templates =====
If you have implemented a CI-compliant layout for SoSci Survey, you can import it as an XML file directly from within SoSci Survey. By adding to the configuration, you can also make the layout available in the user interface as a default template under //Layout Templates//.
- Save the XML file to a directory on the web server in ''/templates'' (e.g., "layout.OurCompany.2015.xml").
- Take a screenshot of the layout, scale it to the size 180×180 pixels, and save it on the web server as well (e.g., "layout.OurCompany.png").
- In the ''config.php'', add the following lines __directly before__ the ''?>'' at the end of the file:
$GLOBALS['oFb']['features']['layouts'][] = array(
'url' => 'layout.OurCompany.2015.xml',
'comment' => 'Our Company',
'img' => 'templates/layout.OurCompany.png'
);
===== PHP Functions =====
With the parameter ''%%'allow functions'%%'', the use of PHP functions that SoSci Survey normally blocks can be allowed.
$GLOBALS['oFb']['allow functions'] = ['array_filter'];
**Warning:** By using unchecked PHP functions, project managers may be able to access projects, data, files, scripts, and settings that they should not have access to. Functions that call callback functions may also allow further functions to be called.
**Note:** If you use callback functions, please note that functions defined under **Compose Questionnaire** in the PHP code and in the tab "PHP Functions" are located in the namespace ''\s2survey\questionnaire\environment''.
$b = array_filter($a, '\s2survey\questionnaire\environment\my_call');
===== Welcome Email =====
If you create a file named ''config.welcome.php'' in the directory ''system'', based on the template below, users receive an email after registering a new user account.
You can provide a German (''%%'ger'%%'') and/or English (''%%'eng'%%'') template for the email. The following placeholders are available for the email:
* ''%name%'' -- First and last name as specified during registration
* ''%email%'' -- Email address of the user account (usually used as the user name for the login)
* ''%login%'' -- ID of the user account
* ''%url%'' -- Internet address (URL) of the survey server
* ''%agb%'' -- Content of the configuration variable ''$GLOBALS['oFb']['server terms']''