2005-11-03 19:00:17 +01:00
< ? php
2009-01-20 00:32:18 +01:00
/* Copyright ( C ) 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2008-04-04 02:03:21 +02:00
* Copyright ( C ) 2004 Benoit Mortier < benoit . mortier @ opensides . be >
* Copyright ( C ) 2004 Sebastien DiCintio < sdicintio @ ressource - toi . org >
2010-08-09 21:08:22 +02:00
* Copyright ( C ) 2007 - 2010 Laurent Destailleur < eldy @ users . sourceforge . net >
2005-11-03 19:00:17 +01:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:24:38 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2005-11-03 19:00:17 +01:00
*/
2005-11-04 02:28:28 +01:00
2005-11-03 19:00:17 +01:00
/** \file htdocs / install / inc . php
2009-11-04 23:23:48 +01:00
* \ingroup core
* \brief File that define environment for install pages
2011-08-01 01:24:38 +02:00
* \version $Id : inc . php , v 1.137 2011 / 07 / 31 23 : 26 : 18 eldy Exp $
2009-11-04 23:23:48 +01:00
*/
2005-11-04 02:28:28 +01:00
2011-07-13 23:19:58 +02:00
define ( 'DOL_VERSION' , '3.1.0-beta' ); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
2008-04-19 23:52:14 +02:00
2010-04-28 12:11:41 +02:00
require_once ( '../core/class/translate.class.php' );
2008-04-05 16:18:13 +02:00
require_once ( '../lib/functions.lib.php' );
2008-02-01 02:01:56 +01:00
require_once ( '../lib/admin.lib.php' );
2010-02-04 10:54:45 +01:00
require_once ( '../lib/files.lib.php' );
2007-10-04 19:07:15 +02:00
2007-10-29 13:47:43 +01:00
// DOL_DOCUMENT_ROOT has been defined in function.inc.php to '..'
2010-10-06 00:38:14 +02:00
error_reporting ( E_ALL ); // To have all errors without disabled E_STRICT
2009-01-12 20:36:40 +01:00
// Define $_REQUEST["logtohtml"]
$_REQUEST [ " logtohtml " ] = 1 ;
2008-12-15 02:04:32 +01:00
2007-03-06 19:30:16 +01:00
// Correction PHP_SELF (ex pour apache via caudium) car PHP_SELF doit valoir URL relative
// et non path absolu.
if ( isset ( $_SERVER [ " DOCUMENT_URI " ]) && $_SERVER [ " DOCUMENT_URI " ])
{
$_SERVER [ " PHP_SELF " ] = $_SERVER [ " DOCUMENT_URI " ];
}
2007-12-17 19:33:34 +01:00
// Definition des constantes syslog
if ( function_exists ( " define_syslog_variables " ))
{
2009-10-19 21:10:51 +02:00
if ( version_compare ( PHP_VERSION , '5.3.0' , '<' ))
{
define_syslog_variables (); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized
}
2007-12-17 19:33:34 +01:00
}
else
{
// Pour PHP sans syslog (comme sous Windows)
define ( 'LOG_EMERG' , 0 );
define ( 'LOG_ALERT' , 1 );
define ( 'LOG_CRIT' , 2 );
define ( 'LOG_ERR' , 3 );
define ( 'LOG_WARNING' , 4 );
define ( 'LOG_NOTICE' , 5 );
define ( 'LOG_INFO' , 6 );
define ( 'LOG_DEBUG' , 7 );
}
2007-12-11 01:58:18 +01:00
$includeconferror = '' ;
2011-07-30 12:23:24 +02:00
$conffiletoshowshort = " conf.php " ;
# Define localization of conf file
2006-06-17 20:12:46 +02:00
$conffile = " ../conf/conf.php " ;
2011-07-30 12:23:24 +02:00
$conffiletoshow = " htdocs/conf/conf.php " ;
2011-08-01 01:24:38 +02:00
$lockfile = '../../install.lock' ;
# For debian/redhat like systems
2011-07-30 12:23:24 +02:00
#$conffile = "/etc/dolibarr/conf.php";
#$conffiletoshow = "/etc/dolibarr/conf.php";
2011-08-01 01:24:38 +02:00
#$lockfile = '/etc/dolibarr/install.lock'; # Web has no permission to write here
$lockfile = '../../install.lock' ;
2009-08-26 20:59:13 +02:00
2007-12-11 01:58:18 +01:00
if ( ! defined ( 'DONOTLOADCONF' ) && file_exists ( $conffile ))
2006-10-20 23:42:57 +02:00
{
2007-12-11 01:58:18 +01:00
$result = include_once ( $conffile ); // Load conf file
2009-01-20 00:32:18 +01:00
if ( $result )
2006-10-21 00:21:46 +02:00
{
2009-10-25 08:42:54 +01:00
//if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // For backward compatibility
2009-01-20 00:32:18 +01:00
2007-12-11 01:58:18 +01:00
// Remove last / or \ on directories or url value
2009-10-21 20:14:00 +02:00
if ( ! empty ( $dolibarr_main_document_root ) && ! preg_match ( '/^[\\/]+$/' , $dolibarr_main_document_root )) $dolibarr_main_document_root = preg_replace ( '/[\\/]+$/' , '' , $dolibarr_main_document_root );
if ( ! empty ( $dolibarr_main_url_root ) && ! preg_match ( '/^[\\/]+$/' , $dolibarr_main_url_root )) $dolibarr_main_url_root = preg_replace ( '/[\\/]+$/' , '' , $dolibarr_main_url_root );
if ( ! empty ( $dolibarr_main_data_root ) && ! preg_match ( '/^[\\/]+$/' , $dolibarr_main_data_root )) $dolibarr_main_data_root = preg_replace ( '/[\\/]+$/' , '' , $dolibarr_main_data_root );
2010-12-16 19:10:06 +01:00
if ( ! empty ( $dolibarr_main_document_root_alt ) && ! preg_match ( '/^[\\/]+$/' , $dolibarr_main_document_root_alt )) $dolibarr_main_document_root_alt = preg_replace ( '/[\\/]+$/' , '' , $dolibarr_main_document_root_alt );
if ( ! empty ( $dolibarr_main_url_root_alt ) && ! preg_match ( '/^[\\/]+$/' , $dolibarr_main_url_root_alt )) $dolibarr_main_url_root_alt = preg_replace ( '/[\\/]+$/' , '' , $dolibarr_main_url_root_alt );
2007-12-11 01:58:18 +01:00
// Create conf object
if ( ! empty ( $dolibarr_main_document_root ))
{
$result = conf ( $dolibarr_main_document_root );
}
// Load database driver
if ( $result )
{
if ( ! empty ( $dolibarr_main_document_root ) && ! empty ( $dolibarr_main_db_type ))
{
$result = include_once ( $dolibarr_main_document_root . " /lib/databases/ " . $dolibarr_main_db_type . " .lib.php " );
if ( $result )
{
// OK
}
else
{
$includeconferror = 'ErrorBadValueForDolibarrMainDBType' ;
}
}
}
else
{
2009-01-20 00:32:18 +01:00
$includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot' ;
2007-12-11 01:58:18 +01:00
}
2006-10-21 00:21:46 +02:00
}
2007-12-11 01:58:18 +01:00
else
2007-04-18 19:38:55 +02:00
{
2009-01-20 00:32:18 +01:00
$includeconferror = 'ErrorBadFormatForConfFile' ;
2007-04-18 19:38:55 +02:00
}
2006-10-20 23:42:57 +02:00
}
2009-01-25 18:56:42 +01:00
$conf -> global -> MAIN_LOGTOHTML = 1 ;
2008-06-17 03:18:48 +02:00
2008-12-08 01:04:11 +01:00
// Define prefix
2009-01-20 00:32:18 +01:00
if ( ! isset ( $dolibarr_main_db_prefix ) || ! $dolibarr_main_db_prefix ) $dolibarr_main_db_prefix = 'llx_' ;
2007-11-09 00:06:00 +01:00
define ( 'MAIN_DB_PREFIX' ,( isset ( $dolibarr_main_db_prefix ) ? $dolibarr_main_db_prefix : '' ));
2008-12-08 01:04:11 +01:00
2010-10-03 02:12:54 +02:00
define ( 'DOL_CLASS_PATH' , 'class/' ); // Filsystem path to class dir
2010-12-19 04:04:06 +01:00
define ( 'DOL_DATA_ROOT' ,( isset ( $dolibarr_main_data_root ) ? $dolibarr_main_data_root : '' ));
2011-04-18 21:27:15 +02:00
if ( ! empty ( $dolibarr_main_document_root_alt ))
{
define ( 'DOL_DOCUMENT_ROOT_ALT' , $dolibarr_main_document_root_alt ); // Filesystem paths to alternate core php (alternate htdocs)
}
2010-10-03 02:12:54 +02:00
define ( 'DOL_MAIN_URL_ROOT' , ( isset ( $dolibarr_main_url_root ) ? $dolibarr_main_url_root : '' )); // URL relative root
$uri = preg_replace ( '/^http(s?):\/\//i' , '' , constant ( 'DOL_MAIN_URL_ROOT' )); // $uri contains url without http*
$suburi = strstr ( $uri , '/' ); // $suburi contains url without domain
if ( $suburi == '/' ) $suburi = '' ; // If $suburi is /, it is now ''
define ( 'DOL_URL_ROOT' , $suburi ); // URL relative root ('', '/dolibarr', ...)
2009-08-26 20:59:13 +02:00
if ( empty ( $conf -> file -> character_set_client )) $conf -> file -> character_set_client = " UTF-8 " ;
if ( empty ( $conf -> db -> character_set )) $conf -> db -> character_set = 'utf8' ;
if ( empty ( $conf -> db -> dolibarr_main_db_collation )) $conf -> db -> dolibarr_main_db_collation = 'utf8_general_ci' ;
if ( empty ( $conf -> db -> dolibarr_main_db_encryption )) $conf -> db -> dolibarr_main_db_encryption = 0 ;
if ( empty ( $conf -> db -> dolibarr_main_db_cryptkey )) $conf -> db -> dolibarr_main_db_cryptkey = '' ;
2008-10-09 16:46:07 +02:00
if ( empty ( $conf -> db -> user )) $conf -> db -> user = '' ;
2008-04-04 02:30:57 +02:00
2010-10-03 02:12:54 +02:00
// Define array of document root directories
$conf -> file -> dol_document_root = array ( DOL_DOCUMENT_ROOT );
if ( ! empty ( $dolibarr_main_document_root_alt ))
{
// dolibarr_main_document_root_alt contains several directories
$values = preg_split ( '/[;,]/' , $dolibarr_main_document_root_alt );
foreach ( $values as $value )
{
$conf -> file -> dol_document_root [] = $value ;
}
}
2009-01-20 00:32:18 +01:00
2008-04-04 02:30:57 +02:00
// Security check
2009-10-21 20:14:00 +02:00
if ( preg_match ( '/install.lock/i' , $_SERVER [ " SCRIPT_FILENAME " ]))
2008-04-04 02:30:57 +02:00
{
2011-07-11 12:53:37 +02:00
print 'Install pages have been disabled for security reason (directory renamed with .lock suffix).' ;
if ( ! empty ( $dolibarr_main_url_root ))
{
print 'Click on following link. ' ;
print '<a href="' . $dolibarr_main_url_root . '/admin/index.php?mainmenu=home&leftmenu=setup' . ( isset ( $_POST [ " login " ]) ? '&username=' . urlencode ( $_POST [ " login " ]) : '' ) . '">' ;
print 'Click here to go to Dolibarr' ;
print '</a>' ;
}
2008-04-04 02:30:57 +02:00
exit ;
}
2011-08-01 01:24:38 +02:00
if ( file_exists ( $lockfile ))
2008-04-04 02:30:57 +02:00
{
2011-07-11 12:53:37 +02:00
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).<br>' ;
if ( ! empty ( $dolibarr_main_url_root ))
{
print 'Click on following link. ' ;
print 'If you always reach this page, you must remove install.lock file manually.<br>' ;
print '<a href="' . $dolibarr_main_url_root . '/admin/index.php?mainmenu=home&leftmenu=setup' . ( isset ( $_POST [ " login " ]) ? '&username=' . urlencode ( $_POST [ " login " ]) : '' ) . '">' ;
print 'Click here to go to Dolibarr' ;
print '</a>' ;
}
else
{
print 'If you always reach this page, you must remove install.lock file manually.<br>' ;
}
2008-04-04 02:30:57 +02:00
exit ;
}
2006-06-17 20:12:46 +02:00
// Forcage du log pour les install et mises a jour
$conf -> syslog -> enabled = 1 ;
2007-05-10 20:25:19 +02:00
$conf -> global -> SYSLOG_LEVEL = constant ( 'LOG_DEBUG' );
2009-01-20 00:32:18 +01:00
if ( ! defined ( 'SYSLOG_FILE' )) // To avoid warning on systems with constant already defined
{
if ( @ is_writable ( '/tmp' )) define ( 'SYSLOG_FILE' , '/tmp/dolibarr_install.log' );
else if ( ! empty ( $_ENV [ " TMP " ]) && @ is_writable ( $_ENV [ " TMP " ])) define ( 'SYSLOG_FILE' , $_ENV [ " TMP " ] . '/dolibarr_install.log' );
else if ( ! empty ( $_ENV [ " TEMP " ]) && @ is_writable ( $_ENV [ " TEMP " ])) define ( 'SYSLOG_FILE' , $_ENV [ " TEMP " ] . '/dolibarr_install.log' );
2009-11-27 22:29:24 +01:00
else if ( @ is_writable ( '../../../../' ) && @ file_exists ( '../../../../startdoliwamp.bat' )) define ( 'SYSLOG_FILE' , '../../../../dolibarr_install.log' ); // For DoliWamp
2009-09-07 15:33:08 +02:00
else if ( @ is_writable ( '../../' )) define ( 'SYSLOG_FILE' , '../../dolibarr_install.log' ); // For others
//print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
2009-01-20 00:32:18 +01:00
}
2009-01-20 00:46:46 +01:00
if ( ! defined ( 'SYSLOG_FILE_NO_ERROR' ))
{
define ( 'SYSLOG_FILE_NO_ERROR' , 1 );
}
2006-06-17 20:12:46 +02:00
2011-03-07 23:35:35 +01:00
// Removed magic_quotes
if ( function_exists ( 'get_magic_quotes_gpc' )) // magic_quotes_* removed in PHP6
2008-01-06 11:56:15 +01:00
{
if ( get_magic_quotes_gpc ())
{
2011-03-07 23:35:35 +01:00
// Forcing parameter setting magic_quotes_gpc and cleaning parameters
// (Otherwise he would have for each position, condition
// Reading stripslashes variable according to state get_magic_quotes_gpc).
// Off mode (recommended, you just do $db->escape when an insert / update.
function stripslashes_deep ( $value )
{
return ( is_array ( $value ) ? array_map ( 'stripslashes_deep' , $value ) : stripslashes ( $value ));
}
2008-01-06 14:04:06 +01:00
$_GET = array_map ( 'stripslashes_deep' , $_GET );
$_POST = array_map ( 'stripslashes_deep' , $_POST );
$_COOKIE = array_map ( 'stripslashes_deep' , $_COOKIE );
2008-01-06 11:56:15 +01:00
$_REQUEST = array_map ( 'stripslashes_deep' , $_REQUEST );
2011-03-07 23:35:35 +01:00
@ set_magic_quotes_runtime ( 0 );
2008-01-06 11:56:15 +01:00
}
2006-05-10 20:21:05 +02:00
}
2006-06-17 02:58:51 +02:00
// Defini objet langs
2008-12-08 01:04:11 +01:00
$langs = new Translate ( '..' , $conf );
2005-11-03 19:00:17 +01:00
$langs -> setDefaultLang ( 'auto' );
2005-11-04 02:28:28 +01:00
$bc [ false ] = ' class="bg1"' ;
$bc [ true ] = ' class="bg2"' ;
2006-06-17 20:12:46 +02:00
2010-01-20 18:54:44 +01:00
/**
* \brief Load conf file ( file must exists )
* \param dolibarr_main_document_root Root directory of Dolibarr bin files
* \return int < 0 if KO , > 0 if OK
*/
2007-10-04 19:07:15 +02:00
function conf ( $dolibarr_main_document_root )
{
2007-12-11 01:00:00 +01:00
global $conf ;
global $dolibarr_main_db_type ;
global $dolibarr_main_db_host ;
2008-03-10 23:38:43 +01:00
global $dolibarr_main_db_port ;
2007-12-11 01:00:00 +01:00
global $dolibarr_main_db_name ;
global $dolibarr_main_db_user ;
global $dolibarr_main_db_pass ;
2008-10-09 16:46:07 +02:00
global $character_set_client ;
2007-12-11 01:00:00 +01:00
2010-04-28 12:02:54 +02:00
$return = include_once ( $dolibarr_main_document_root . " /core/class/conf.class.php " );
2010-01-20 18:54:44 +01:00
if ( ! $return ) return - 1 ;
2007-12-11 01:00:00 +01:00
$conf = new Conf ();
$conf -> db -> type = trim ( $dolibarr_main_db_type );
$conf -> db -> host = trim ( $dolibarr_main_db_host );
2008-03-10 23:38:43 +01:00
$conf -> db -> port = trim ( $dolibarr_main_db_port );
2007-12-11 01:00:00 +01:00
$conf -> db -> name = trim ( $dolibarr_main_db_name );
$conf -> db -> user = trim ( $dolibarr_main_db_user );
$conf -> db -> pass = trim ( $dolibarr_main_db_pass );
2008-10-09 16:46:07 +02:00
2009-01-20 00:46:46 +01:00
if ( empty ( $character_set_client )) $character_set_client = " UTF-8 " ;
2009-05-08 03:11:04 +02:00
$conf -> file -> character_set_client = strtoupper ( $character_set_client );
2009-08-26 20:59:13 +02:00
if ( empty ( $dolibarr_main_db_character_set )) $dolibarr_main_db_character_set = 'latin1' ; // Old installation
$conf -> db -> character_set = $dolibarr_main_db_character_set ;
if ( empty ( $dolibarr_main_db_collation )) $dolibarr_main_db_collation = 'latin1_swedish_ci' ; // Old installation
2007-12-21 20:14:11 +01:00
$conf -> db -> dolibarr_main_db_collation = $dolibarr_main_db_collation ;
2009-07-04 14:52:40 +02:00
if ( empty ( $dolibarr_main_db_encryption )) $dolibarr_main_db_encryption = 0 ;
$conf -> db -> dolibarr_main_db_encryption = $dolibarr_main_db_encryption ;
if ( empty ( $dolibarr_main_db_cryptkey )) $dolibarr_main_db_cryptkey = '' ;
$conf -> db -> dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey ;
2007-12-11 01:00:00 +01:00
2008-12-18 02:06:12 +01:00
// Forcage du log pour les install et mises a jour
$conf -> syslog -> enabled = 1 ;
$conf -> global -> SYSLOG_LEVEL = constant ( 'LOG_DEBUG' );
2009-01-20 00:32:18 +01:00
if ( ! defined ( 'SYSLOG_FILE' )) // To avoid warning on systems with constant already defined
{
if ( @ is_writable ( '/tmp' )) define ( 'SYSLOG_FILE' , '/tmp/dolibarr_install.log' );
else if ( ! empty ( $_ENV [ " TMP " ]) && @ is_writable ( $_ENV [ " TMP " ])) define ( 'SYSLOG_FILE' , $_ENV [ " TMP " ] . '/dolibarr_install.log' );
else if ( ! empty ( $_ENV [ " TEMP " ]) && @ is_writable ( $_ENV [ " TEMP " ])) define ( 'SYSLOG_FILE' , $_ENV [ " TEMP " ] . '/dolibarr_install.log' );
2010-02-04 23:55:39 +01:00
else if ( @ is_writable ( '../../../../' ) && @ file_exists ( '../../../../startdoliwamp.bat' )) define ( 'SYSLOG_FILE' , '../../../../dolibarr_install.log' ); // For DoliWamp
2009-09-07 15:33:08 +02:00
else if ( @ is_writable ( '../../' )) define ( 'SYSLOG_FILE' , '../../dolibarr_install.log' ); // For others
//print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
2009-01-20 00:32:18 +01:00
}
2009-01-20 00:46:46 +01:00
if ( ! defined ( 'SYSLOG_FILE_NO_ERROR' ))
{
define ( 'SYSLOG_FILE_NO_ERROR' , 1 );
}
2009-01-20 00:32:18 +01:00
2007-12-11 01:00:00 +01:00
return 1 ;
2007-07-19 21:30:32 +02:00
}
2007-11-09 00:06:00 +01:00
2010-01-20 18:54:44 +01:00
/**
* Show header of install pages
*
2010-07-22 01:45:08 +02:00
* @ param $soutitre
* @ param $next
2010-11-11 00:54:59 +01:00
* @ param $action Action code ( 'set' or 'upgrade' )
2010-07-22 01:45:08 +02:00
* @ param $param
2010-01-20 18:54:44 +01:00
*/
2009-12-23 16:26:29 +01:00
function pHeader ( $soutitre , $next , $action = 'set' , $param = '' )
2005-11-03 19:00:17 +01:00
{
2007-05-26 01:24:21 +02:00
global $conf ;
2010-01-20 18:54:44 +01:00
global $langs ;
$langs -> load ( " main " );
$langs -> load ( " admin " );
2006-05-08 19:38:36 +02:00
2007-05-26 01:24:21 +02:00
// On force contenu dans format sortie
2009-05-08 03:11:04 +02:00
header ( " Content-type: text/html; charset= " . $conf -> file -> character_set_client );
2006-05-08 19:38:36 +02:00
2010-01-20 18:54:44 +01:00
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . " \n " ;
print '<html>' . " \n " ;
print '<head>' . " \n " ;
print '<meta http-equiv="content-type" content="text/html; charset=' . $conf -> file -> character_set_client . '">' . " \n " ;
print '<link rel="stylesheet" type="text/css" href="./default.css">' . " \n " ;
2011-05-17 10:46:56 +02:00
print '<link rel="stylesheet" type="text/css" href="../includes/jquery/css/smoothness/jquery-ui-latest.custom.css" type="text/css">' . " \n " ;
print '<script type="text/javascript" src="../includes/jquery/js/jquery-latest.min.js"></script>' . " \n " ;
print '<script type="text/javascript" src="../includes/jquery/js/jquery-ui-latest.custom.min.js"></script>' . " \n " ;
2010-01-20 18:54:44 +01:00
print '<title>' . $langs -> trans ( " DolibarrSetup " ) . '</title>' . " \n " ;
print '</head>' . " \n " ;
print '<body>' . " \n " ;
print '<span class="titre">' . $langs -> trans ( " DolibarrSetup " );
if ( $soutitre ) {
print ' - ' . $soutitre ;
}
2007-08-08 02:51:26 +02:00
print '</span>' . " \n " ;
2006-08-20 04:06:48 +02:00
2010-01-20 18:54:44 +01:00
print '<form name="forminstall" action="' . $next . '.php' . ( $param ? '?' . $param : '' ) . '" method="POST">' . " \n " ;
print '<input type="hidden" name="testpost" value="ok">' . " \n " ;
print '<input type="hidden" name="action" value="' . $action . '">' . " \n " ;
2006-08-20 04:06:48 +02:00
2007-08-08 02:51:26 +02:00
print '<table class="main" width="100%"><tr><td>' . " \n " ;
2006-08-20 04:06:48 +02:00
2007-08-08 02:51:26 +02:00
print '<table class="main-inside" width="100%"><tr><td>' . " \n " ;
2005-11-03 19:00:17 +01:00
}
2005-11-04 02:28:28 +01:00
2010-01-20 18:54:44 +01:00
/**
* Output footer of install pages
*
2010-07-28 00:38:28 +02:00
* @ param $nonext
* @ param $setuplang
* @ param $jscheckfunction
2010-01-20 18:54:44 +01:00
*/
function pFooter ( $nonext = 0 , $setuplang = '' , $jscheckfunction = '' )
2005-11-03 19:00:17 +01:00
{
2010-01-20 18:54:44 +01:00
global $conf , $langs ;
2009-01-20 00:32:18 +01:00
2010-01-20 18:54:44 +01:00
$langs -> load ( " main " );
$langs -> load ( " admin " );
2009-01-20 00:32:18 +01:00
2010-01-20 18:54:44 +01:00
print '</td></tr></table>' . " \n " ;
print '</td></tr></table>' . " \n " ;
2009-01-20 00:32:18 +01:00
2010-01-20 18:54:44 +01:00
if ( ! $nonext )
{
2010-03-16 00:54:37 +01:00
print '<div class="nextbutton" id="nextbutton"><input type="submit" value="' . $langs -> trans ( " NextStep " ) . ' ->"' ;
2010-01-20 18:54:44 +01:00
if ( $jscheckfunction ) print ' onClick="return ' . $jscheckfunction . '();"' ;
print '></div>' ;
2010-07-10 01:28:22 +02:00
print '<div style="visibility: hidden;" class="pleasewait" id="pleasewait"><br><blink>' . $langs -> trans ( " NextStepMightLastALongTime " ) . '</blink><br><br>' . $langs -> trans ( " PleaseBePatient " ) . '</div>' ;
2010-01-20 18:54:44 +01:00
}
if ( $setuplang )
{
print '<input type="hidden" name="selectlang" value="' . $setuplang . '">' ;
}
2006-08-20 04:06:48 +02:00
2010-01-20 18:54:44 +01:00
print '</form>' . " \n " ;
2008-12-15 02:04:32 +01:00
2010-01-20 18:54:44 +01:00
// If there is some logs in buffer to show
if ( isset ( $conf -> logbuffer ) && sizeof ( $conf -> logbuffer ))
{
2008-12-15 02:04:32 +01:00
print " \n " ;
2009-01-20 00:32:18 +01:00
print " <!-- Start of log output \n " ;
2010-01-20 18:54:44 +01:00
//print '<div class="hidden">'."\n";
foreach ( $conf -> logbuffer as $logline )
{
print $logline . " <br> \n " ;
}
//print '</div>'."\n";
2009-01-20 00:32:18 +01:00
print " End of log output --> \n " ;
2008-12-15 02:04:32 +01:00
print " \n " ;
2010-01-20 18:54:44 +01:00
}
2009-01-20 00:32:18 +01:00
2010-01-20 18:54:44 +01:00
print '</body>' . " \n " ;
print '</html>' . " \n " ;
2005-11-03 19:00:17 +01:00
}
2005-11-04 02:28:28 +01:00
2010-01-20 18:54:44 +01:00
/**
* Log function for install pages
*
2010-07-22 01:45:08 +02:00
* @ param $message
* @ param $level
2010-01-20 18:54:44 +01:00
*/
2007-10-10 01:28:27 +02:00
function dolibarr_install_syslog ( $message , $level = LOG_DEBUG )
2005-11-03 19:00:17 +01:00
{
2007-05-10 20:25:19 +02:00
if ( ! defined ( 'LOG_DEBUG' )) define ( 'LOG_DEBUG' , 6 );
2009-02-20 23:53:15 +01:00
dol_syslog ( $message , $level );
2006-06-17 02:58:51 +02:00
}
2005-11-03 19:00:17 +01:00
?>