Configuration files

There are two configuration files used that control how the database is accessed and used, and how you can login to the system.

local/conndb.inc.php

This file has the database configuration stored. A sample can look like this.

$mysql_server="localhost";
$mysql_user="exampleuser";
$mysql_password="examplepass";
$mysql_database="customerdb";

$server_id=1;
$server_min_no=1;
$server_max_no=9999999;

The mysql_ variables are set so it can connect to the database. How much the user and password is used depends on the login configuration, it can range from accessing the user records and nothing more to having access to the full database. The server settings are used for inserts in the database, all generated keys will be between the min and the max values. The current value is stored in the aseqno table to keep track of what's being inserted. The id must correspond to the MySQL database server ID. This is to allow several servers to be running in distant locations with replication between them to keep it all in sync.

local/settingsGlobal.php

This file has some base configuration to do with how users are authenticated.

//$loginSystem="dbAuth";
$loginSystem="internal";
//$loginSystem="fixedAuth";
$module_setup=array("auth"=>
                    array("ldap"=>array(0=>array("description"=>"Local LDAP",
                                                 "hostspec"=>"192.168.0.1",
                                                 "basedn"=>"dc=home,dc=example,dc=com",
                                                 "uid"=>"uid"),
                                        1=>array("description"=>"Enterprise LDAP",
                                                 "hostspec"=>"ldap.example.com",
                                                 "basedn"=>"dc=example,dc=com",
                                                 "uid"=>"uid")),
                          "imap"=>array("description"=>"Local Imap",
                                        "folder"=>"INBOX",
                                        "hostspec"=>"192.168.0.1",
                                        "port"=>143,
                                        "protocol"=>"imap/notls/novalidate-cert"),
                          "spotsql"=>array("description"=>"Local DB",
                                       "phptype"=>"mysql",
                                       "encryption"=>"md5-hex",
                                       "table"=>"user",
                                       "password_field"=>"md5pwd",
                                       "username_field"=>"username",
                                       "database"=>$mysql_database,
                                       "username"=>$mysql_user,
                                       "password"=>$mysql_password)
                          )
                    );

There are three methods to connect to the database. "dbAuth" uses the login/password to connect directly to the database. That way the access can be set for each user to exactly what is needed. "internal" uses the login/password supplied in the conndb.inc.php file to get a connection to the database. "fixedAuth" connects using the login of the user, but a password stored in the user table. "internal" and "fixedAuth" is useful if you're using a secondary system to validate users.

The module_setup variable holds the different methods of authentication that will be used in sequence. If the type holds an array, the same module will be used several times with different configuration.