Config.php contiene una serie de variables definidas por el usuario que determinan cómo se comporta el sistema. Críticamente contiene el host (nombre del equipo), nombre de usuario y la contraseña de la conexión de base de datos necesaria para conectarse al servidor de base de datos. También hay una opción para elegir el tipo de servidor de base de datos que se va a utilizar. Actualmente sólo hay opciones para mysql y mysqli. No hay marcha hacia adelante sin estos datos.
Los contenidos predeterminados del archivo config.php son los siguientes y se deben editar en un editor de su elección. Luego, guarde config.php en el directorio web donde se encuentran los comandos. Tenga en cuenta que el sistema está evolucionando continuamente y puede que haya cambiado desde que fue escrito.
La zona horaria del negocio también debe especificarse aquí usando una declaración como:
Putenv (“Australia / Sydney ');
Esto garantiza que la zona horaria de la empresa se muestre en todos los navegadores que utilizan el sistema, independientemente de donde se encuentra el servidor web (es decir, la zona horaria del servidor web).
La matriz CompanyList se define al final del archivo config.php y generalmente lo agrega el instalador, o una secuencia de comandos de utilidad WebERP (Z_MakeNewCompany.php) que creará una nueva configuración adicional de la empresa y base de datos para WebERP. La matriz CompanyList contiene una lista de las bases de datos utilizadas con su nombre de compañía asociada. Una de las funciones es la de permitir el acceso para mostrar las Empresas disponibles y esconder el nombre de la base de datos por razones de seguridad. Esta matriz CompanyList debe añadirse como en el ejemplo a continuación.
// User configurable variables
//---------------------------------------------------
// Defaultlanguage to use for the login screen and the setup of new users
//The users' language selection will overrid
$DefaultLanguage = 'es_GB.utf8';
// Whether to display the demo login and password or not on the login screen
$AllowDemoMode = FALSE;
// email address of the system administrator
$SysAdminEmail = Esta dirección de correo electrónico está siendo protegida contra los robots de spam. Necesita tener JavaScript habilitado para poder verlo.';
// webERP version
$Version = '3.04';
// The timezone of the business - this allows the possibility of having
// the web-server on a overseas machine but record local time
// this is not necessary if you have your own server locally
// putenv('TZ=Europe/London');
// putenv('Australia/Melbourne');
// putenv('Australia/Sydney');
// putenv('TZ=Pacific/Auckland');
// Connection information for the database
// $host is the computer ip address or name where the database is located
// assuming that the web server is also the sql server
$host = 'localhost';
$mysqlport=3306;
/The type of db server being used - currently only mysqli or mysql
//$DBType = 'mysql';
//$DBType = 'mysqli';
// sql user & password
$DBUser = 'weberp_db_user';
$DBPassword = 'weberp_db_pwd';
//It would probably be inappropriate to allow selection of the company in a hosted environment so this option can be turned off with this parameter
$AllowCompanySelectionBox = true;
//If $AllowCompanySelectionBox = false above then the $DefaultCompany string is entered in the login screen as a default
//otherwise the user is expected to know the name of the company to log into and a selection is required from the company selection box.
//The selection box is populated from the list of directories under the companies directory.
//These directories are created automatically each time a company is created from the Z_MakeNewCompany.php script
//This script also creates the company databases.
$DefaultDatabase = 'weberpdemo';
//The maximum time that a login session can be idle before automatic logout
//time is in seconds 3600 seconds in an hour
SessionLifeTime = 3600;
//The maximum time that a script can execute for before the web-server should terminate it
$MaximumExecutionTime =120;
/*The path to which session files should be stored in the server - useful for some multi-host web servers where pages are serviced using load balancing servers
- when the load picks a different server then the session can be lost unless this option is used - which tells the server explicitly where to find the session file.
It is also useful where there are several webERP installs where the code is in two different paths on the same server and being used by the same client browser.
It is possible in this scenario for the session to be over-written by the two different webERP installations. The solution is to specify different $SessionSavePath in each installations config.php
If there is only one installation of webERP on the web-server - which can be used with many company databases (and there is no load balancing difficulties to circumvent then this can be left commented out
*/
//$SessionSavePath = '/tmp';
// which encryption function should be used
//$CryptFunction = "md5"; // MD5 Hash
$CryptFunction = "sha1"; // SHA1 Hash
//$CryptFunction = ""; // Plain Text
//Setting to 12 or 24 determines the format of the clock display at the end of all screens
$DefaultClock = 12;
//$DefaultClock = 24
// END OF USER CONFIGURABLE VARIABLES
/*The $RootPath is used in most scripts to tell the script the installation details of the files.
NOTE: In some windows installation this command doesn't work and the administrator must set this to the path of the installation manually:
eg. if the files are under the web server root directory then rootpath =''; if they are under weberp then weberp is the rootpath - notice no additional slashes are necessary.
*/
$RootPath = dirname(htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'));
if (isset($DirectoryLevelsDeep)){
for ($i=0;$i<$DirectoryLevelsDeep;$i++){
$RootPath = mb_substr($RootPath,0, strrpos($RootPath,'/'));
}
}
if ($RootPath == "/" OR $RootPath == "\\") {
RootPath = "";
}
//Report all errors except E_NOTICE This is the default value set in php.ini for most installations
//but just to be sure it is forced here turning on NOTICES destroys things
error_reporting (E_ALL & ~E_NOTICE);
//Installed companies
$CompanyList[0] = array('database'=>'weberptest' ,'company'=>'My Company' );
$CompanyList[1] = array('database'=>'weberpdemo' ,'company'=>'WebERP Demo Company' );
//End Installed companies-do not change this line
/*Make sure there is nothing - not even spaces after this last ?> */ ?>
============================================
end of config.php
============================================