Configuration

From FiFormsWiki

Jump to: navigation, search

This document gives an overview on how to configure the FiForms Framework. If you've just installed the FiForms Framework for the first time, we recommend that you use the graphical screen described below in "Initial Configuration." At the end of this document under Configuration#Configuration Elements is a reference for every configuration element (or parameter) that may be specified in the configuration.

Contents

Configuration Files

Site-specific FiForms configuration is set up in the file localconfig.php located in the scripts folder. The localconfig.php file loads a default configuration by including FiForms_global.inc.php. Individual configuration elements can be overridden by setting elements of the array FIFORMS_CONFIG in localconfig.php.

Application-specific configuration is set in appconfig.php under each application folder (located at %APP_BASE%/%APP_NAME%/appconfig.php) or the application-specific PHP folder (located at %SCRIPT_PATH%/app/%APP_NAME%/appconfig.php). Elements set in appconfig.php override the site-wide configuration set in localconfig.php.

Please note: the localconfig.php files in the application-specific PHP directories should not be used for configuration. These are simply pointers to the site-wide localconfig.php mentioned above.

Also Note: Names enclosed in %% signs in this documentation indicate the names of configuration elements. For example, paths are often given like this:

%SCRIPT_PATH%/themes/

Let's assume that in a given installation, the script path was

C:/xampp/www/FiForms/scripts

Then this path would be

 C:/xampp/www/FiForms/scripts/themes/

Configuration Elements

External Programs

XSLTPROC

xsltproc application used to transform XML if %PHPXSLT% is false. On Linux, this defaults to "xsltproc" and on Windows it defaults to "%APP_BASE%/bin/libxml2/xsltproc.exe".

XMLLINT

xmllint application used to validate XML. On Linux, this defaults to "xmllint" and on Windows it defaults to "%APP_BASE%/bin/libxml2/xmllint.exe".

UNZIP

unzip application used to extract zipfiles uploaded through the FiForms Admin interface. On Linux, this defaults to "unzip" and on Windows it defaults to "%APP_BASE%/bin/unzip/unzip.exe".

MYSQLDUMP

mysqldump application for exporting or backing up a database through the FiForms Admin interface. This defaults to "mysqldump." If mysqldump is not in your path, be sure to set it here if you want database backup functionality.

URI Configuration

SERVER_ADDRESS

The base URI to the root of the webserver i.e. http://localhost

URI

The URL to the FiForms scripts on the webserver i.e. http://localhost/FiForms/scripts This is the URI that is used to run PHP scripts which are located at SCRIPT_PATH.

PHPMYADMIN_URI

The URL to phpMyAdmin on this server, if it is installed.

Database Configuration

DEFAULT_SERVER

Name or IP address of MySQL Database server. Default is localhost.

DEFAULT_USER

User to connect to MySQL database. Password is specified as DEFAULT_PASSWORD. The behavior of this variable depends on the Authentication module specified.

  • With Basic Authentication, if you specify a valid user and password here, users will be able to use applications without logging in and will not be prompted to login. Leave this blank to force users to log in before accessing the forms.
  • With LDAP Authentication, this is the username/password to connect with MySQL, or if LDAP_GROUPS is specified, then this is the password used if no group is matched.

DEFAULT_PASSWORD

If Configuration#DEFAULT_USER is specified, use this password to connect to the MySQL database.

DEFAULT_DATABASE

The name of the MySQL database schema to use by default, if none is specified in the form definition.

MYSQL_VERSION

Numerical value indicating the MySQL server version in use. This should be either 4 or 5 (decimal version, such as 4.1, 5.1 etc. is not needed).

HTTP Report Server Configuration

REPORT_OUTPUT_XMLNS

Boolean variable, If TRUE, then FiReports will declare the XML namespace in the output of all reports:

xmlns="http://xml.fiforms.org/FiReports/"

This defaults to FALSE for compatibility reasons. It is recommended to set this to TRUE for new application development.

ALLOW_USER_QUERIES

If TRUE, allow users to execute arbitrary SQL on the server. This is a HUGE security risk, and should be left disabled unless you are sure you know what you are doing, or you don't care about your data. Default is FALSE.

ALLOWED_SERVERS

Comma-seperated list of database servers that user-supplied SQL queries are allowed to connect to. Default is ",localhost" (localhost only). Can be set to "_ANY_" to allow connection to any arbitrary server on the network.


Debugging Options

QUERY_DEBUGGING

If TRUE, show all SQL queries in an HTML comment in the output of forms. Useful for debugging but also a slight security risk. Default is FALSE. This can be set in conjunction with SHOW_DEFINITION to show debugging and timing output for reports (in raw XML output).

SHOW_DEFINITION

If TRUE, allow showing of SQL statements in the XML output of reports. Default is FALSE. If set in conjuction with QUERY_DEBUGGING, this will display a debug option on the report parameter screen to include SQL and timing information in report output.

PERF_STAT

If TRUE, log page loads, queries, and performance statistics in the fiforms_performance database. See the article on Performance Tuning for more details. Default is FALSE.

USE_XHTML

If TRUE, FiForms will output strict XHTML. Otherwise, FiForms will output HTML. Default is FALSE.

See the article on XHTML Support in Fiforms.

CONNECT_EARLY

Establish MySQL database connection at an earlier point in building the FiForm. Normally not needed and defaults to false. Option is provided for backward compatibility with older versions of FiForms, where this was the default behaviour.

DISABLE_GZIP

Boolean variable. If true, then no gzip compression is applied to pages. Set this option if you receive compression or encoding errors in the browser (often due to notices being printed before compressed output is sent).

Application Registry

These variables are not set in localconfig.php but are built dynamically by the appreg.php scripts under each application.

AVAILABLE_APPS

An array containing the unix names of each application

AVAILABLE_APP_INFO

An associative, multi-dimensional array containing additional information about each application. Each element of the array is indexed by the application unix name, and is an associative array containing elements apptitle, appsummary, and appdatabase.

Behavior Options

MENU_POPUPS

Set to either 'default' or 'new'. If set to 'new', forms are always opened in a new tab, rather than the popup window as defined in the form definition. Default is 'default'.

MENU_XMLNS

Boolean variable. If true, then menu definitions are expected to be namespace qualified, with all elements in the namespace http://xml.fiforms.org/FiFormsMenu/ . This should always be set to TRUE for new development. Defaults to FALSE for backwards compatibility.

USE_COMBINED

Use the combined, single include file rather than multiple files in the FiForms-includes directory. Defaults to FALSE. (Experimental)

NEW_FILE_MODE

Octal file mode set to newly created files, such as applications files and forms. Defaults to 0775. Affects Linux and Unix-based Operating Systems (has no effect on Windows). (effective in version 1.1.1 and later)

NEW_FILE_GROUP

Group for newly created files. The webserver user must be a member of this group. Affects Linux and Unix-based Operating Systems (has no effect on Windows). (effective in version 1.1.1 and later)

NEW_DIR_MODE

Octal file mode set to newly created directories in applications. Defaults to 0775. Affects Linux and Unix-based Operating Systems (has no effect on Windows). (effective in version 1.1.1 and later)

NEW_DIR_GROUP

Group for newly created directories. The webserver user must be a member of this group. Affects Linux and Unix-based Operating Systems (has no effect on Windows). (effective in version 1.1.1 and later)

BINARY_PKEY

Treat all primary keys in a binary-safe manner. This should be TRUE if you are using binary UUIDs in any applicaiton. Defaults to FALSE.

Login and Authentication System

UPDATEPW_HASH

sha1 hash of the online administrative password (used to protect system pages like the application creator, form creator, fiforms info page, etc when using Basic Authentication).

You can set the password manually by specifying the SHA1 here. On Linux, use a command similar to the following to generate the hash sum for a new password:

echo -n "password" | sha1sum

Alternatively, you can use a service like this one: http://www.xorbin.com/tools/sha1-hash-calculator

If you got "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" then your password is definitely too weak... ;)

UPDATE_HOST

Determines which hosts have access to the administrative features of FiForms. Should be one of "any" or "localhost".

AUTH_MODULE

Full path to authentication module to use. The following authentication modules are available in the development version of FiForms:

  • FiForms_BasicAuth.inc.php
    • A simple authentication system using basic HTTP Authentication. Credentials are passed from the user directly to MySQL, so no credentials are stored in the configuration, and new users are setup as MySQL users.
  • FiForms_CookieAuthSimple.inc.php
    • Simplistic session-based authentication. This is provided mainly as a demonstration or template for creating your own authentication module.
  • FiForms_CookieAuth.inc.php
    • Cookie-based authentication that aims to support multiple users and roles, with users and roles stored in a MySQL database.
  • FiForms_CookieAuthLDAP.inc.php
    • Authenticates users against an external LDAP server such as Active Directory. Internally uses PHP sessions to keep track of user logins. See LDAP Authentication for setup details.

AUTH_REALM

The authentication realm used in HTTP Basic Authentication. Default is "FiForms".

AUTH_SERVER

The MySQL Server with the user privilege and authentication database for Cookie based authentication

AUTH_DB

Name of MySQL Database to use for privileges and authentication.

AUTH_USER

MySQL Login username with select privileges only on the database specified in AUTH_DB, as well as select, insert, update, delete privileges on the sessionmaster table in the same database.

AUTH_PASSWORD

Password for AUTH_USER

LDAP_SERVER

URL to external LDAP server for external LDAP Authentication, e.g. "ldaps://domain.example.com"

LDAP_DOMAIN

Fully Qualified Active Directory Domain Name for external LDAP Authentication. e.g. "domain.example.com"

LDAP_RDN

LDAP RDN. If not set, the default value is based on LDAP_DOMAIN.

   $FIFORMS_CONFIG['LDAP_RDN'] = "domain\\%u";

LDAP_BASE

Search base for finding the user in LDAP (Only needed if LDAP_GROUPS is set).

  $FIFORMS_CONFIG['LDAP_BASE'] = 'dc=domain,dc=example,dc=com';


LDAP_FILTER

Filter to search for the user account (Only needed if LDAP_GROUPS is set). If unset, the value below is the default:

   $FIFORMS_CONFIG['LDAP_FILTER'] = 'samAccountName=%u';

LDAP_GROUPS

Maps LDAP Groups to internal FiForms group names.

   $FIFORMS_CONFIG['LDAP_GROUPS'] = array(
        "CN=Domain Admins,CN=Users,DC=domain,DC=example,DC=com" => 'domainadmin',
        "CN=Administrators,CN=Builtin,DC=domain,DC=example,DC=com" => 'admin'
     );

GROUP_USERS

Maps FiForms group names to MySQL User Account names. Applicable groups match in array order, so list highest privilege users first. Un-matched groups get the default username and password.

   $FIFORMS_CONFIG['GROUP_USERS'] = array(
         'domainadmin' => 'root'
     );

USER_PASSWORDS

Passwords for MySQL Users

   $FIFORMS_CONFIG['USER_PASSWORDS'] = array(
         'root' => 'password'
     );

.

Personal tools