# config.inc

This file includes all functions needed to manage configuration profiles. It includes classes for the profiles itself and the master configuration (default profile, master password, etc.).
There are also two global functions for general use: setlanguage and metarefresh

## Meta refresh

The global function metaRefresh() takes an URL as argument and prints all HTML code needed for a meta refresh to this URL.

## Language

LAM uses gettext to translate the HTML pages to the different languages. Therefore some preferences need to be set on every page load. This is done by setlanguage().
The function should be called directly after starting the session.
The list of possible languages is stored in config/language. It includes the locale name, the character encoding an the language name.
All languages use UTF-8 as encoding because LDAP also stores values in this format.

## Configuration profiles

Each configuration profile is saved in a single file in config/.
There are two types of configuration options:

- Static options (LDAP server settings, etc.)
- Module options (UID/GID ranges)

All static options have a describing comment in the configuration file to make it easier for the user to modify the values. The dynamic options provided by the modules do not include a comment.

## Master configuration file

LAM stores the default configuration profile and a master password in config/config.cfg.
The master password is verified when the user wants to create/delete configuration profiles.