2005-07-09 03:17:40 +02:00
< ? php
2020-10-04 19:09:25 +02:00
/* Copyright ( C ) 2005 - 2020 Laurent Destailleur < eldy @ users . sourceforge . net >
2012-08-02 10:07:55 +02:00
* Copyright ( C ) 2007 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2018-10-27 14:43:12 +02:00
* Copyright ( C ) 2007 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
2024-09-29 02:49:34 +02:00
* Copyright ( C ) 2024 MDW < mdeweerd @ users . noreply . github . com >
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2005-07-09 03:17:40 +02: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
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2005-07-09 03:17:40 +02:00
* ( 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
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2005-07-09 03:17:40 +02:00
*/
/**
2010-02-20 12:40:36 +01:00
* \file htdocs / admin / system / dolibarr . php
2020-10-04 19:09:25 +02:00
* \brief Page to show Dolibarr information
2008-08-07 08:33:35 +02:00
*/
2005-07-09 03:17:40 +02:00
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
2012-08-22 23:24:21 +02:00
require '../../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php' ;
2017-02-22 02:32:35 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
2005-07-09 03:17:40 +02:00
2024-09-18 03:27:25 +02:00
'
@ phan - var - force string $dolibarr_main_document_root_alt
' ;
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*
* @ var string $dolibarr_main_document_root_alt
*/
2018-09-07 14:58:22 +02:00
// Load translation files required by the page
2019-11-13 19:35:02 +01:00
$langs -> loadLangs ( array ( " install " , " other " , " admin " ));
2007-04-24 13:47:57 +02:00
2020-09-16 19:39:50 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
2017-02-22 02:32:35 +01:00
2021-02-26 22:04:03 +01:00
if ( ! $user -> admin ) {
2012-08-02 10:07:55 +02:00
accessforbidden ();
2021-02-26 22:04:03 +01:00
}
2009-02-20 13:29:55 +01:00
2017-02-22 02:32:35 +01:00
$sfurl = '' ;
2019-11-13 19:35:02 +01:00
$version = '0.0' ;
2017-02-22 02:32:35 +01:00
/*
* Actions
*/
2021-02-26 22:04:03 +01:00
if ( $action == 'getlastversion' ) {
2020-10-31 14:32:18 +01:00
$result = getURLContent ( 'https://sourceforge.net/projects/dolibarr/rss' );
//var_dump($result['content']);
2020-11-04 17:45:10 +01:00
if ( function_exists ( 'simplexml_load_string' )) {
2023-12-29 17:55:09 +01:00
if ( LIBXML_VERSION < 20900 ) {
// Avoid load of external entities (security problem).
// Required only if LIBXML_VERSION < 20900
2024-02-21 18:14:29 +01:00
// @phan-suppress-next-line PhanDeprecatedFunctionInternal
2023-12-29 17:55:09 +01:00
libxml_disable_entity_loader ( true );
}
2024-09-18 03:27:25 +02:00
$sfurl = simplexml_load_string ( $result [ 'content' ], 'SimpleXMLElement' , LIBXML_NOCDATA | LIBXML_NONET );
2020-11-04 17:45:10 +01:00
} else {
setEventMessages ( $langs -> trans ( " ErrorPHPDoesNotSupport " , " xml " ), null , 'errors' );
}
2017-02-22 02:32:35 +01:00
}
2009-02-20 13:29:55 +01:00
2017-10-09 22:52:26 +02:00
2008-08-07 08:33:35 +02:00
/*
* View
*/
2008-10-12 13:41:13 +02:00
2019-11-13 19:35:02 +01:00
$form = new Form ( $db );
2009-02-20 13:29:55 +01:00
2021-02-16 11:15:42 +01:00
$help_url = '' ;
2019-11-13 19:35:02 +01:00
$title = $langs -> trans ( " InfoDolibarr " );
2005-07-09 03:17:40 +02:00
2024-06-08 17:03:08 +02:00
llxHeader ( '' , $title , $help_url , '' , 0 , 0 , '' , '' , '' , 'mod-admin page-system_dolibarr' );
2016-11-06 12:16:10 +01:00
2019-01-27 11:55:16 +01:00
print load_fiche_titre ( $title , '' , 'title_setup' );
2005-07-09 03:17:40 +02:00
2009-02-20 13:29:55 +01:00
// Version
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-09-03 11:19:01 +02:00
print '<tr class="liste_titre"><td class="titlefieldcreate">' . $langs -> trans ( " Version " ) . '</td><td></td></tr>' . " \n " ;
2024-01-14 21:48:35 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentVersion " ) . '<br><span class="opacitymedium">(' . $langs -> trans ( " Programs " ) . ')</span></td><td>' . DOL_VERSION ;
2009-08-04 16:36:29 +02:00
// If current version differs from last upgrade
2023-10-24 17:00:13 +02:00
if ( ! getDolGlobalString ( 'MAIN_VERSION_LAST_UPGRADE' )) {
2024-01-11 09:59:52 +01:00
// Compare version with last install database version (upgrades never occurred)
2021-02-26 22:04:03 +01:00
if ( DOL_VERSION != $conf -> global -> MAIN_VERSION_LAST_INSTALL ) {
2024-01-05 04:18:53 +01:00
print ' ' . img_warning ( $langs -> trans ( " RunningUpdateProcessMayBeRequired " , DOL_VERSION , getDolGlobalString ( 'MAIN_VERSION_LAST_INSTALL' )));
2021-02-26 22:04:03 +01:00
}
2020-05-21 09:35:30 +02:00
} else {
2020-10-31 14:32:18 +01:00
// Compare version with last upgrade database version
2021-02-26 22:04:03 +01:00
if ( DOL_VERSION != $conf -> global -> MAIN_VERSION_LAST_UPGRADE ) {
2024-01-05 04:18:53 +01:00
print ' ' . img_warning ( $langs -> trans ( " RunningUpdateProcessMayBeRequired " , DOL_VERSION , getDolGlobalString ( 'MAIN_VERSION_LAST_UPGRADE' )));
2021-02-26 22:04:03 +01:00
}
2009-10-26 02:16:01 +01:00
}
2017-02-22 02:19:50 +01:00
2020-12-03 16:35:42 +01:00
$version = DOL_VERSION ;
2021-02-26 22:04:03 +01:00
if ( preg_match ( '/[a-z]+/i' , $version )) {
$version = 'develop' ; // If version contains text, it is not an official tagged version, so we use the full change log.
}
2021-11-22 02:35:55 +01:00
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/' . $version . '/ChangeLog" target="_blank" rel="noopener noreferrer external">' . $langs -> trans ( " SeeChangeLog " ) . '</a>' ;
2020-12-03 16:35:42 +01:00
$newversion = '' ;
2021-02-26 22:04:03 +01:00
if ( function_exists ( 'curl_init' )) {
$conf -> global -> MAIN_USE_RESPONSE_TIMEOUT = 10 ;
print ' - ' ;
if ( $action == 'getlastversion' ) {
if ( $sfurl ) {
$i = 0 ;
while ( ! empty ( $sfurl -> channel [ 0 ] -> item [ $i ] -> title ) && $i < 10000 ) {
$title = $sfurl -> channel [ 0 ] -> item [ $i ] -> title ;
$reg = array ();
if ( preg_match ( '/([0-9]+\.([0-9\.]+))/' , $title , $reg )) {
$newversion = $reg [ 1 ];
$newversionarray = explode ( '.' , $newversion );
$versionarray = explode ( '.' , $version );
//var_dump($newversionarray);var_dump($versionarray);
if ( versioncompare ( $newversionarray , $versionarray ) > 0 ) {
$version = $newversion ;
}
}
$i ++ ;
}
2020-10-31 14:32:18 +01:00
// Show version
print $langs -> trans ( " LastStableVersion " ) . ' : <b>' . (( $version != '0.0' ) ? $version : $langs -> trans ( " Unknown " )) . '</b>' ;
2020-12-03 16:39:22 +01:00
if ( $version != '0.0' ) {
2021-11-22 02:35:55 +01:00
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/' . $version . '/ChangeLog" target="_blank" rel="noopener noreferrer external">' . $langs -> trans ( " SeeChangeLog " ) . '</a>' ;
2020-12-03 16:39:22 +01:00
}
2021-02-26 22:04:03 +01:00
} else {
2020-10-31 14:32:18 +01:00
print $langs -> trans ( " LastStableVersion " ) . ' : <b>' . $langs -> trans ( " UpdateServerOffline " ) . '</b>' ;
}
} else {
2021-02-21 12:10:07 +01:00
print $langs -> trans ( " LastStableVersion " ) . ' : <a href="' . $_SERVER [ " PHP_SELF " ] . '?action=getlastversion" class="butAction smallpaddingimp">' . $langs -> trans ( " Check " ) . '</a>' ;
2020-10-31 14:32:18 +01:00
}
2017-02-22 02:19:50 +01:00
}
2017-11-30 11:16:28 +01:00
// Now show link to the changelog
2020-12-03 16:35:42 +01:00
//print ' - ';
2017-11-30 11:16:28 +01:00
2019-11-13 19:35:02 +01:00
$version = DOL_VERSION ;
2021-02-26 22:04:03 +01:00
if ( preg_match ( '/[a-z]+/i' , $version )) {
$version = 'develop' ; // If version contains text, it is not an official tagged version, so we use the full change log.
}
2017-11-30 11:16:28 +01:00
2011-02-07 12:48:53 +01:00
print '</td></tr>' . " \n " ;
2024-01-14 21:48:35 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " VersionLastUpgrade " ) . '<br><span class="opacitymedium">(' . $langs -> trans ( " Database " ) . ')</span></td><td>' . getDolGlobalString ( 'MAIN_VERSION_LAST_UPGRADE' ) . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " VersionLastInstall " ) . '<br><span class="opacitymedium">(' . $langs -> trans ( " Database " ) . ')</span></td><td>' . getDolGlobalString ( 'MAIN_VERSION_LAST_INSTALL' ) . '</td></tr>' . " \n " ;
2007-04-24 13:47:57 +02:00
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2007-04-24 13:47:57 +02:00
print '<br>' ;
2009-02-20 13:29:55 +01:00
// Session
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-09-03 11:19:01 +02:00
print '<tr class="liste_titre"><td class="titlefieldcreate">' . $langs -> trans ( " Session " ) . '</td><td></td></tr>' . " \n " ;
2022-10-28 12:34:49 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionSavePath " ) . '</td><td>' . session_save_path () . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionName " ) . '</td><td>' . session_name () . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionId " ) . '</td><td>' . session_id () . '</td></tr>' . " \n " ;
2024-01-14 21:48:35 +01:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " CurrentSessionTimeOut " );
print '</td>' ;
2022-10-28 12:34:49 +02:00
print '<td>' ;
print ini_get ( 'session.gc_maxlifetime' ) . ' ' . $langs -> trans ( " seconds " );
2018-11-11 14:36:35 +01:00
print '<!-- session.gc_maxlifetime = ' . ini_get ( " session.gc_maxlifetime " ) . ' -->' . " \n " ;
print '<!-- session.gc_probability = ' . ini_get ( " session.gc_probability " ) . ' -->' . " \n " ;
print '<!-- session.gc_divisor = ' . ini_get ( " session.gc_divisor " ) . ' -->' . " \n " ;
2024-01-14 21:48:35 +01:00
print $form -> textwithpicto ( '' , $langs -> trans ( " Parameter " ) . ' <b>php.ini</b>: <b>session.gc_maxlifetime</b><br>' . $langs -> trans ( " SessionExplanation " , ini_get ( " session.gc_probability " ), ini_get ( " session.gc_divisor " )));
2009-02-20 13:29:55 +01:00
print " </td></tr> \n " ;
2022-10-28 12:34:49 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentTheme " ) . '</td><td>' . $conf -> theme . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentMenuHandler " ) . '</td><td>' ;
2013-04-03 15:20:56 +02:00
print $conf -> standard_menu ;
2011-02-17 00:54:02 +01:00
print '</td></tr>' . " \n " ;
2022-10-28 12:34:49 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Screen " ) . '</td><td>' ;
2014-07-27 14:13:25 +02:00
print $_SESSION [ 'dol_screenwidth' ] . ' x ' . $_SESSION [ 'dol_screenheight' ];
print '</td></tr>' . " \n " ;
2022-10-28 12:39:37 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Session " ) . '</td><td class="wordbreak">' ;
2019-11-13 19:35:02 +01:00
$i = 0 ;
2021-02-26 22:04:03 +01:00
foreach ( $_SESSION as $key => $val ) {
if ( $i > 0 ) {
print ', ' ;
}
if ( is_array ( $val )) {
print $key . ' => array(...)' ;
} else {
print $key . ' => ' . dol_escape_htmltag ( $val );
}
2014-07-27 14:13:25 +02:00
$i ++ ;
}
print '</td></tr>' . " \n " ;
2009-02-20 13:29:55 +01:00
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2009-02-20 13:29:55 +01:00
print '<br>' ;
2010-01-04 21:10:10 +01:00
// Shmop
2024-01-05 03:41:22 +01:00
if ( getDolGlobalInt ( 'MAIN_OPTIMIZE_SPEED' ) & 0x02 ) {
2019-11-13 19:35:02 +01:00
$shmoparray = dol_listshmop ();
2010-05-29 00:15:56 +02:00
2020-10-31 14:32:18 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2010-01-12 13:21:29 +01:00
print '<tr class="liste_titre">' ;
2021-02-02 09:44:51 +01:00
print '<td class="titlefieldcreate">' . $langs -> trans ( " LanguageFilesCachedIntoShmopSharedMemory " ) . '</td>' ;
2010-01-12 13:21:29 +01:00
print '<td>' . $langs -> trans ( " NbOfEntries " ) . '</td>' ;
2019-01-21 22:36:14 +01:00
print '<td class="right">' . $langs -> trans ( " Address " ) . '</td>' ;
2010-01-12 13:21:29 +01:00
print '</tr>' . " \n " ;
2010-01-04 21:10:10 +01:00
2021-02-26 22:04:03 +01:00
foreach ( $shmoparray as $key => $val ) {
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $key . '</td>' ;
2011-09-14 23:50:18 +02:00
print '<td>' . count ( $val ) . '</td>' ;
2019-01-21 22:36:14 +01:00
print '<td class="right">' . dol_getshmopaddress ( $key ) . '</td>' ;
2011-02-07 12:48:53 +01:00
print '</tr>' . " \n " ;
2010-01-04 21:10:10 +01:00
}
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2010-01-04 21:10:10 +01:00
print '<br>' ;
}
2009-02-20 13:29:55 +01:00
// Localisation
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2024-09-03 11:19:01 +02:00
print '<tr class="liste_titre"><td class="titlefieldcreate">' . $langs -> trans ( " LocalisationDolibarrParameters " ) . '</td><td></td></tr>' . " \n " ;
2019-01-27 11:55:16 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " LanguageBrowserParameter " , " HTTP_ACCEPT_LANGUAGE " ) . '</td><td>' . $_SERVER [ " HTTP_ACCEPT_LANGUAGE " ] . '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentUserLanguage " ) . '</td><td>' . $langs -> getDefaultLang () . '</td></tr>' . " \n " ;
2008-12-06 12:28:40 +01:00
// Thousands
2019-11-13 19:35:02 +01:00
$thousand = $langs -> transnoentitiesnoconv ( " SeparatorThousand " );
2021-02-26 22:04:03 +01:00
if ( $thousand == 'SeparatorThousand' ) {
$thousand = ' ' ; // ' ' does not work on trans method
}
if ( $thousand == 'None' ) {
$thousand = '' ;
}
2019-11-13 19:35:02 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentValueSeparatorThousand " ) . '</td><td>' . ( $thousand == ' ' ? $langs -> transnoentitiesnoconv ( " Space " ) : $thousand ) . '</td></tr>' . " \n " ;
2008-08-17 23:13:21 +02:00
// Decimals
2019-11-13 19:35:02 +01:00
$dec = $langs -> transnoentitiesnoconv ( " SeparatorDecimal " );
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentValueSeparatorDecimal " ) . '</td><td>' . $dec . '</td></tr>' . " \n " ;
2009-02-20 13:29:55 +01:00
// Show results of functions to see if everything works
2024-10-06 13:03:43 +02:00
print '<tr class="oddeven"><td> => price2num(1233.56+1)</td><td>' . price2num ( 1233.56 + 1 , 2 ) . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td> => price2num(' . " '1 " . $thousand . " 234 " . $dec . " 56')</td><td> " . price2num ( " 1 " . $thousand . " 234 " . $dec . " 56 " , 2 ) . " </td></tr> \n " ;
2021-02-26 22:04:03 +01:00
if (( $thousand != ',' && $thousand != '.' ) || ( $thousand != ' ' )) {
2024-10-06 13:03:43 +02:00
print '<tr class="oddeven"><td> => price2num(' . " '1 234.56')</td><td> " . price2num ( " 1 234.56 " , 2 ) . " </td> " ;
2008-12-06 12:28:40 +01:00
print " </tr> \n " ;
}
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td> => price(1234.56)</td><td>' . price ( 1234.56 ) . '</td></tr>' . " \n " ;
2021-02-02 00:19:41 +01:00
// Timezones
// Database timezone
2021-02-26 22:04:03 +01:00
if ( $conf -> db -> type == 'mysql' || $conf -> db -> type == 'mysqli' ) {
2021-02-02 00:19:41 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " MySQLTimeZone " ) . ' (database)</td><td>' ; // Timezone server base
$sql = " SHOW VARIABLES where variable_name = 'system_time_zone' " ;
$resql = $db -> query ( $sql );
2021-02-26 22:04:03 +01:00
if ( $resql ) {
2021-02-02 00:19:41 +01:00
$obj = $db -> fetch_object ( $resql );
print $form -> textwithtooltip ( $obj -> Value , $langs -> trans ( 'TZHasNoEffect' ), 2 , 1 , img_info ( '' ));
}
print '</td></tr>' . " \n " ;
}
2019-11-13 19:35:02 +01:00
$txt = $langs -> trans ( " OSTZ " ) . ' (variable system TZ): ' . ( ! empty ( $_ENV [ " TZ " ]) ? $_ENV [ " TZ " ] : $langs -> trans ( " NotDefined " )) . '<br>' . " \n " ;
2020-12-30 22:01:26 +01:00
$txt .= $langs -> trans ( " PHPTZ " ) . ' (date_default_timezone_get() / php.ini date.timezone): ' . ( getServerTimeZoneString () . " / " . ( ini_get ( " date.timezone " ) ? ini_get ( " date.timezone " ) : $langs -> trans ( " NotDefined " ))) . " <br> \n " ; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
2024-01-05 04:18:53 +01:00
$txt .= $langs -> trans ( " Dolibarr constant MAIN_SERVER_TZ " ) . ': ' . getDolGlobalString ( 'MAIN_SERVER_TZ' , $langs -> trans ( " NotDefined " ));
2019-11-13 19:35:02 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentTimeZone " ) . '</td><td>' ; // Timezone server PHP
$a = getServerTimeZoneInt ( 'now' );
$b = getServerTimeZoneInt ( 'winter' );
$c = getServerTimeZoneInt ( 'summer' );
2020-11-21 16:49:54 +01:00
$daylight = round ( $c - $b );
2012-05-15 00:48:59 +02:00
//print $a." ".$b." ".$c." ".$daylight;
2019-11-13 19:35:02 +01:00
$val = ( $a >= 0 ? '+' : '' ) . $a ;
$val .= ' (' . ( $a == 'unknown' ? 'unknown' : ( $a >= 0 ? '+' : '' ) . ( $a * 3600 )) . ')' ;
$val .= ' ' . getServerTimeZoneString ();
2024-09-29 02:49:34 +02:00
$val .= ' ' . $langs -> trans ( " DaylingSavingTime " ) . ': ' . (( is_null ( $b ) || is_null ( $c )) ? 'unknown' : ( $a == $c ? yn (( int ) $daylight ) : yn ( 0 ) . ( $daylight ? ' (' . $langs -> trans ( 'YesInSummer' ) . ')' : '' )));
2019-01-27 11:55:16 +01:00
print $form -> textwithtooltip ( $val , $txt , 2 , 1 , img_info ( '' ));
2019-11-13 19:35:02 +01:00
print '</td></tr>' . " \n " ; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
2021-02-02 00:19:41 +01:00
print '<tr class="oddeven"><td> => ' . $langs -> trans ( " CurrentHour " ) . '</td><td>' . dol_print_date ( dol_now ( 'gmt' ), 'dayhour' , 'tzserver' ) . '</td></tr>' . " \n " ;
2019-01-27 11:55:16 +01:00
print '<tr class="oddeven"><td> => dol_print_date(0,"dayhourtext")</td><td>' . dol_print_date ( 0 , " dayhourtext " ) . '</td>' ;
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,false)</td><td>' . dol_get_first_day ( 1970 , 1 , false ) . ' (=> dol_print_date() or idate() of this value = ' . dol_print_date ( dol_get_first_day ( 1970 , 1 , false ), 'dayhour' ) . ')</td>' ;
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,true)</td><td>' . dol_get_first_day ( 1970 , 1 , true ) . ' (=> dol_print_date() or idate() of this value = ' . dol_print_date ( dol_get_first_day ( 1970 , 1 , true ), 'dayhour' ) . ')</td>' ;
2011-09-14 23:50:18 +02:00
// Client
2019-11-13 19:35:02 +01:00
$tz = ( int ) $_SESSION [ 'dol_tz' ] + ( int ) $_SESSION [ 'dol_dst' ];
print '<tr class="oddeven"><td>' . $langs -> trans ( " ClientTZ " ) . '</td><td>' . ( $tz ? ( $tz >= 0 ? '+' : '' ) . $tz : '' ) . ' (' . ( $tz >= 0 ? '+' : '' ) . ( $tz * 60 * 60 ) . ')' ;
2012-05-15 01:41:12 +02:00
print ' ' . $_SESSION [ 'dol_tz_string' ];
2012-02-05 15:13:31 +01:00
print ' ' . $langs -> trans ( " DaylingSavingTime " ) . ': ' ;
2021-02-26 22:04:03 +01:00
if ( $_SESSION [ 'dol_dst' ] > 0 ) {
print yn ( 1 );
} else {
print yn ( 0 );
}
if ( ! empty ( $_SESSION [ 'dol_dst_first' ])) {
print ' (' . dol_print_date ( dol_stringtotime ( $_SESSION [ 'dol_dst_first' ]), 'dayhour' , 'gmt' ) . ' - ' . dol_print_date ( dol_stringtotime ( $_SESSION [ 'dol_dst_second' ]), 'dayhour' , 'gmt' ) . ')' ;
}
2011-11-01 04:57:45 +01:00
print '</td></tr>' . " \n " ;
2012-02-05 15:13:31 +01:00
print '</td></tr>' . " \n " ;
2021-02-02 00:19:41 +01:00
print '<tr class="oddeven"><td> => ' . $langs -> trans ( " ClientHour " ) . '</td><td>' . dol_print_date ( dol_now ( 'gmt' ), 'dayhour' , 'tzuser' ) . '</td></tr>' . " \n " ;
2009-12-14 20:34:10 +01:00
2019-11-13 19:35:02 +01:00
$filesystemencoding = ini_get ( " unicode.filesystem_encoding " ); // Disponible avec PHP 6.0
2017-11-15 13:15:08 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " File encoding " ) . ' (php.ini unicode.filesystem_encoding)</td><td>' . $filesystemencoding . '</td></tr>' . " \n " ;
2009-12-14 20:34:10 +01:00
2019-11-13 19:35:02 +01:00
$tmp = ini_get ( " unicode.filesystem_encoding " ); // Disponible avec PHP 6.0
2021-02-26 22:04:03 +01:00
if ( empty ( $tmp ) && ! empty ( $_SERVER [ " WINDIR " ])) {
$tmp = 'iso-8859-1' ; // By default for windows
}
if ( empty ( $tmp )) {
$tmp = 'utf-8' ; // By default for other
}
2023-10-24 17:00:13 +02:00
if ( getDolGlobalString ( 'MAIN_FILESYSTEM_ENCODING' )) {
2024-01-05 04:18:53 +01:00
$tmp = getDolGlobalString ( 'MAIN_FILESYSTEM_ENCODING' );
2021-02-26 22:04:03 +01:00
}
2019-11-13 19:35:02 +01:00
print '<tr class="oddeven"><td> => ' . $langs -> trans ( " File encoding " ) . '</td><td>' . $tmp . '</td></tr>' . " \n " ; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
2009-12-14 20:34:10 +01:00
2005-07-09 03:17:40 +02:00
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2005-07-09 03:17:40 +02:00
print '<br>' ;
2012-09-21 00:13:20 +02:00
2012-09-21 08:50:23 +02:00
// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
2019-11-13 19:35:02 +01:00
$configfileparameters = array (
2021-07-05 18:16:52 +02:00
'dolibarr_main_prod' => 'Production mode (Hide all error messages)' ,
2021-07-05 18:19:02 +02:00
'dolibarr_main_instance_unique_id' => $langs -> trans ( " InstanceUniqueID " ),
2021-07-05 18:16:52 +02:00
'separator0' => '' ,
'dolibarr_main_url_root' => $langs -> trans ( " URLRoot " ),
'?dolibarr_main_url_root_alt' => $langs -> trans ( " URLRoot " ) . ' (alt)' ,
2024-09-18 03:27:25 +02:00
'dolibarr_main_document_root' => $langs -> trans ( " DocumentRootServer " ),
2021-07-05 18:16:52 +02:00
'?dolibarr_main_document_root_alt' => $langs -> trans ( " DocumentRootServer " ) . ' (alt)' ,
'dolibarr_main_data_root' => $langs -> trans ( " DataRootServer " ),
'separator1' => '' ,
'dolibarr_main_db_host' => $langs -> trans ( " DatabaseServer " ),
'dolibarr_main_db_port' => $langs -> trans ( " DatabasePort " ),
'dolibarr_main_db_name' => $langs -> trans ( " DatabaseName " ),
'dolibarr_main_db_type' => $langs -> trans ( " DriverType " ),
'dolibarr_main_db_user' => $langs -> trans ( " DatabaseUser " ),
'dolibarr_main_db_pass' => $langs -> trans ( " DatabasePassword " ),
'dolibarr_main_db_character_set' => $langs -> trans ( " DBStoringCharset " ),
'dolibarr_main_db_collation' => $langs -> trans ( " DBSortingCollation " ),
'?dolibarr_main_db_prefix' => $langs -> trans ( " DatabasePrefix " ),
2021-07-09 19:34:17 +02:00
'dolibarr_main_db_readonly' => $langs -> trans ( " ReadOnlyMode " ),
2021-07-05 18:16:52 +02:00
'separator2' => '' ,
'dolibarr_main_authentication' => $langs -> trans ( " AuthenticationMode " ),
2024-09-18 03:27:25 +02:00
'?multicompany_transverse_mode' => $langs -> trans ( " MultiCompanyMode " ),
'separator' => '' ,
2021-07-05 18:16:52 +02:00
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute' ,
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host' ,
'?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port' ,
'?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version' ,
'?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn' ,
'?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login' ,
'?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass' ,
'?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug' ,
'separator3' => '' ,
'?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH' ,
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH' ,
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH' ,
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH' ,
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH' ,
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH' ,
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH' ,
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP' ,
'?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR' ,
'?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY' ,
'?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI' ,
'?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF' ,
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD' ,
'separator4' => '' ,
'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups' ,
'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only' ,
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page' ,
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli' ,
2022-07-13 01:01:44 +02:00
'?dolibarr_mailing_limit_sendbyday' => 'Limit nb of email sent per day' ,
2021-07-05 18:16:52 +02:00
'?dolibarr_strict_mode' => 'Strict mode is on/off' ,
'?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
2012-09-21 08:50:23 +02:00
);
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2012-09-21 00:13:20 +02:00
print '<tr class="liste_titre">' ;
2021-02-02 09:44:51 +01:00
print '<td class="titlefieldcreate">' . $langs -> trans ( " Parameters " ) . ' ' ;
2012-09-21 08:50:23 +02:00
print $langs -> trans ( " ConfigurationFile " ) . ' (' . $conffiletoshowshort . ')' ;
print '</td>' ;
2024-09-03 11:19:01 +02:00
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
print '<td></td>' ;
2012-09-21 08:50:23 +02:00
print '</tr>' . " \n " ;
2024-09-18 03:27:25 +02:00
$lastkeyshown = null ;
2021-02-26 22:04:03 +01:00
foreach ( $configfileparameters as $key => $value ) {
2019-11-13 19:35:02 +01:00
$ignore = 0 ;
2012-09-21 08:50:23 +02:00
2021-02-26 22:04:03 +01:00
if ( empty ( $ignore )) {
2019-01-27 11:55:16 +01:00
$newkey = preg_replace ( '/^\?/' , '' , $key );
2012-09-21 08:50:23 +02:00
2021-02-26 22:04:03 +01:00
if ( preg_match ( '/^\?/' , $key ) && empty ( ${$newkey} )) {
2022-08-28 13:38:02 +02:00
if ( $newkey != 'multicompany_transverse_mode' || ! isModEnabled ( 'multicompany' )) {
2020-10-31 14:32:18 +01:00
continue ; // We discard parameters starting with ?
2021-02-26 22:04:03 +01:00
}
}
if ( strpos ( $newkey , 'separator' ) !== false && $lastkeyshown == 'separator' ) {
continue ;
2017-02-15 18:30:27 +01:00
}
2012-09-21 08:50:23 +02:00
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven">' ;
2021-02-26 22:04:03 +01:00
if ( strpos ( $newkey , 'separator' ) !== false ) {
2012-09-21 08:50:23 +02:00
print '<td colspan="3"> </td>' ;
2020-05-21 09:35:30 +02:00
} else {
2012-09-21 08:50:23 +02:00
// Label
print " <td> " . $value . '</td>' ;
// Key
print '<td>' . $newkey . '</td>' ;
// Value
print " <td> " ;
2020-10-04 19:09:25 +02:00
if ( in_array ( $newkey , array ( 'dolibarr_main_db_pass' , 'dolibarr_main_auth_ldap_admin_pass' ))) {
2020-09-20 21:17:27 +02:00
if ( empty ( $dolibarr_main_prod )) {
print '<!-- ' . ${$newkey} . ' -->' ;
2021-07-05 18:14:52 +02:00
print showValueWithClipboardCPButton ( ${$newkey} , 0 , '********' );
} else {
print '**********' ;
2020-09-20 21:17:27 +02:00
}
2021-02-26 22:04:03 +01:00
} elseif ( $newkey == 'dolibarr_main_url_root' && preg_match ( '/__auto__/' , ${$newkey} )) {
print ${$newkey} . ' => ' . constant ( 'DOL_MAIN_URL_ROOT' );
} elseif ( $newkey == 'dolibarr_main_document_root_alt' ) {
2022-09-27 14:32:50 +02:00
$tmparray = explode ( ',' , $dolibarr_main_document_root_alt );
2019-11-13 19:35:02 +01:00
$i = 0 ;
2021-02-26 22:04:03 +01:00
foreach ( $tmparray as $value2 ) {
if ( $i > 0 ) {
print ', ' ;
}
2014-08-07 13:02:13 +02:00
print $value2 ;
2021-02-26 22:04:03 +01:00
if ( ! is_readable ( $value2 )) {
2014-08-13 15:07:22 +02:00
$langs -> load ( " errors " );
2019-01-27 11:55:16 +01:00
print ' ' . img_warning ( $langs -> trans ( " ErrorCantReadDir " , $value2 ));
2014-08-13 15:07:22 +02:00
}
2014-08-07 13:02:13 +02:00
++ $i ;
}
2020-09-14 00:03:49 +02:00
} elseif ( $newkey == 'dolibarr_main_instance_unique_id' ) {
2020-10-31 14:32:18 +01:00
//print $conf->file->instance_unique_id;
2021-07-05 18:14:52 +02:00
global $dolibarr_main_cookie_cryptkey , $dolibarr_main_instance_unique_id ;
$valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey ; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
if ( empty ( $dolibarr_main_prod )) {
2023-09-10 19:29:49 +02:00
print '<!-- ' . $dolibarr_main_instance_unique_id . ' (this will not be visible if $dolibarr_main_prod = 1 -->' ;
2021-07-05 18:14:52 +02:00
print showValueWithClipboardCPButton ( $valuetoshow , 0 , '********' );
2023-09-10 19:29:49 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " ThisValueCanBeReadBecauseInstanceIsNotInProductionMode " ) . '</span>' ;
2021-07-05 18:14:52 +02:00
} else {
print '**********' ;
2023-09-10 19:29:49 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " SeeConfFile " ) . '</span>' ;
2021-07-05 18:14:52 +02:00
}
2020-10-31 14:32:18 +01:00
if ( empty ( $valuetoshow )) {
print img_warning ( " EditConfigFileToAddEntry " , 'dolibarr_main_instance_unique_id' );
}
2022-04-19 22:26:27 +02:00
print '</td></tr>' ;
print '<tr class="oddeven"><td></td><td> => ' . $langs -> trans ( " HashForPing " ) . '</td><td>' . md5 ( 'dolibarr' . $valuetoshow ) . '</td></tr>' . " \n " ;
2020-09-14 00:03:49 +02:00
} elseif ( $newkey == 'dolibarr_main_prod' ) {
print ${$newkey} ;
$valuetoshow = ${$newkey} ;
if ( empty ( $valuetoshow )) {
2020-09-19 12:50:47 +02:00
print img_warning ( $langs -> trans ( 'SwitchThisForABetterSecurity' , 1 ));
}
} elseif ( $newkey == 'dolibarr_nocsrfcheck' ) {
print ${$newkey} ;
$valuetoshow = ${$newkey} ;
if ( ! empty ( $valuetoshow )) {
print img_warning ( $langs -> trans ( 'SwitchThisForABetterSecurity' , 0 ));
2020-09-14 00:03:49 +02:00
}
2021-07-09 19:34:17 +02:00
} elseif ( $newkey == 'dolibarr_main_db_readonly' ) {
print ${$newkey} ;
$valuetoshow = ${$newkey} ;
if ( ! empty ( $valuetoshow )) {
print img_warning ( $langs -> trans ( 'ReadOnlyMode' , 1 ));
}
2020-05-21 09:35:30 +02:00
} else {
2023-12-04 11:41:14 +01:00
print ( empty ( ${$newkey} ) ? '' : ${$newkey} );
2019-04-07 15:44:17 +02:00
}
2021-02-26 22:04:03 +01:00
if ( $newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT ) {
print ' (currently overwritten by autodetected value: ' . DOL_MAIN_URL_ROOT . ')' ;
}
2012-09-21 08:50:23 +02:00
print " </td> " ;
}
print " </tr> \n " ;
2019-11-13 19:35:02 +01:00
$lastkeyshown = $newkey ;
2012-09-21 08:50:23 +02:00
}
}
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2012-09-21 08:50:23 +02:00
print '<br>' ;
// Parameters in database
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2012-09-21 08:50:23 +02:00
print '<table class="noborder">' ;
print '<tr class="liste_titre">' ;
2016-11-06 12:16:10 +01:00
print '<td class="titlefield">' . $langs -> trans ( " Parameters " ) . ' ' . $langs -> trans ( " Database " ) . '</td>' ;
2024-09-03 11:19:01 +02:00
print '<td></td>' ;
2022-08-28 13:38:02 +02:00
if ( ! isModEnabled ( 'multicompany' ) || ! $user -> entity ) {
2021-02-26 22:04:03 +01:00
print '<td class="center width="80px"">' . $langs -> trans ( " Entity " ) . '</td>' ; // If superadmin or multicompany disabled
}
2012-09-21 08:50:23 +02:00
print " </tr> \n " ;
$sql = " SELECT " ;
2019-11-13 19:35:02 +01:00
$sql .= " rowid " ;
$sql .= " , " . $db -> decrypt ( 'name' ) . " as name " ;
$sql .= " , " . $db -> decrypt ( 'value' ) . " as value " ;
$sql .= " , type " ;
$sql .= " , note " ;
$sql .= " , entity " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " const " ;
2022-08-28 13:38:02 +02:00
if ( ! isModEnabled ( 'multicompany' )) {
2012-09-21 08:50:23 +02:00
// If no multicompany mode, admins can see global and their constantes
2019-11-13 19:35:02 +01:00
$sql .= " WHERE entity IN (0, " . $conf -> entity . " ) " ;
2020-05-21 09:35:30 +02:00
} else {
2012-09-21 08:50:23 +02:00
// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
2021-02-26 22:04:03 +01:00
if ( $user -> entity ) {
2021-03-22 11:30:18 +01:00
$sql .= " WHERE entity IN ( " . $db -> sanitize ( $user -> entity . " , " . $conf -> entity ) . " ) " ;
2021-02-26 22:04:03 +01:00
}
2012-09-21 08:50:23 +02:00
}
2019-11-13 19:35:02 +01:00
$sql .= " ORDER BY entity, name ASC " ;
2012-09-21 08:50:23 +02:00
$resql = $db -> query ( $sql );
2021-02-26 22:04:03 +01:00
if ( $resql ) {
2012-09-21 08:50:23 +02:00
$num = $db -> num_rows ( $resql );
$i = 0 ;
2021-02-26 22:04:03 +01:00
while ( $i < $num ) {
2012-09-21 08:50:23 +02:00
$obj = $db -> fetch_object ( $resql );
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven">' ;
2021-09-09 05:11:56 +02:00
print '<td class="tdoverflowmax600" title="' . dol_escape_htmltag ( $obj -> name ) . '">' . dol_escape_htmltag ( $obj -> name ) . '</td>' . " \n " ;
2020-09-20 21:17:27 +02:00
print '<td class="tdoverflowmax300">' ;
2020-10-05 12:13:06 +02:00
if ( isASecretKey ( $obj -> name )) {
2020-09-20 21:17:27 +02:00
if ( empty ( $dolibarr_main_prod )) {
print '<!-- ' . $obj -> value . ' -->' ;
}
print '**********' ;
} else {
print dol_escape_htmltag ( $obj -> value );
}
print '</td>' . " \n " ;
2022-08-28 13:38:02 +02:00
if ( ! isModEnabled ( 'multicompany' ) || ! $user -> entity ) {
2021-02-26 22:04:03 +01:00
print '<td class="center" width="80px">' . $obj -> entity . '</td>' . " \n " ; // If superadmin or multicompany disabled
}
2012-09-21 08:50:23 +02:00
print " </tr> \n " ;
$i ++ ;
}
}
print '</table>' ;
2017-01-17 20:04:41 +01:00
print '</div>' ;
2012-09-21 00:13:20 +02:00
2018-07-28 14:29:28 +02:00
// End of page
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-02-06 00:07:48 +01:00
$db -> close ();