2005-07-09 03:17:40 +02:00
< ? php
2017-11-30 11:16:28 +01:00
/* Copyright ( C ) 2005 - 2017 Laurent Destailleur < eldy @ users . sourceforge . net >
2012-08-02 10:07:55 +02:00
* Copyright ( C ) 2007 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2012-12-30 15:13:49 +01:00
* Copyright ( C ) 2007 - 2012 Regis Houssin < regis . houssin @ capnetworks . com >
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
2011-08-01 00:21:57 +02:00
* along with this program . If not , see < http :// 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
* \brief Page to show Dolibarr informations
2008-08-07 08:33:35 +02:00
*/
2005-07-09 03:17:40 +02:00
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
2007-04-24 13:47:57 +02:00
$langs -> load ( " admin " );
$langs -> load ( " install " );
2008-08-17 21:45:08 +02:00
$langs -> load ( " other " );
2007-04-24 13:47:57 +02:00
2017-02-22 02:32:35 +01:00
$action = GETPOST ( 'action' , 'alpha' );
2012-08-02 10:07:55 +02:00
if ( ! $user -> admin )
accessforbidden ();
2009-02-20 13:29:55 +01:00
2017-02-22 02:32:35 +01:00
$sfurl = '' ;
$version = '0.0' ;
/*
* Actions
*/
if ( $action == 'getlastversion' )
{
2018-02-16 22:00:34 +01:00
$result = getURLContent ( 'https://sourceforge.net/projects/dolibarr/rss' );
2017-02-22 02:32:35 +01:00
//var_dump($result['content']);
$sfurl = simplexml_load_string ( $result [ 'content' ]);
}
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
$form = new Form ( $db );
2009-02-20 13:29:55 +01:00
2016-11-06 12:16:10 +01:00
$title = $langs -> trans ( " InfoDolibarr " );
2005-07-09 03:17:40 +02:00
2016-11-06 12:16:10 +01:00
llxHeader ( '' , $title );
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">' ;
2005-07-09 03:17:40 +02:00
print '<table class="noborder" width="100%">' ;
2016-11-06 12:16:10 +01:00
print '<tr class="liste_titre"><td class="titlefield">' . $langs -> trans ( " Version " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentVersion " ) . ' (' . $langs -> trans ( " Programs " ) . ')</td><td>' . DOL_VERSION ;
2009-08-04 16:36:29 +02:00
// If current version differs from last upgrade
2009-10-26 02:16:01 +01:00
if ( empty ( $conf -> global -> MAIN_VERSION_LAST_UPGRADE ))
{
2017-02-22 02:19:50 +01:00
// Compare version with last install database version (upgrades never occured)
if ( DOL_VERSION != $conf -> global -> MAIN_VERSION_LAST_INSTALL ) print ' ' . img_warning ( $langs -> trans ( " RunningUpdateProcessMayBeRequired " , DOL_VERSION , $conf -> global -> MAIN_VERSION_LAST_INSTALL ));
2009-10-26 02:16:01 +01:00
}
else
{
2017-02-22 02:19:50 +01:00
// Compare version with last upgrade database version
if ( DOL_VERSION != $conf -> global -> MAIN_VERSION_LAST_UPGRADE ) print ' ' . img_warning ( $langs -> trans ( " RunningUpdateProcessMayBeRequired " , DOL_VERSION , $conf -> global -> MAIN_VERSION_LAST_UPGRADE ));
2009-10-26 02:16:01 +01:00
}
2017-02-22 02:19:50 +01:00
if ( function_exists ( 'curl_init' ))
{
$conf -> global -> MAIN_USE_RESPONSE_TIMEOUT = 10 ;
print ' - ' ;
if ( $action == 'getlastversion' )
{
if ( $sfurl )
{
while ( ! empty ( $sfurl -> channel [ 0 ] -> item [ $i ] -> title ) && $i < 10000 )
{
$title = $sfurl -> channel [ 0 ] -> item [ $i ] -> title ;
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 ++ ;
}
// Show version
2017-10-09 22:52:26 +02:00
print $langs -> trans ( " LastStableVersion " ) . ' : <b>' . (( $version != '0.0' ) ? $version : $langs -> trans ( " Unknown " )) . '</b>' ;
2017-02-22 02:19:50 +01:00
}
else
{
2017-10-09 22:52:26 +02:00
print $langs -> trans ( " LastStableVersion " ) . ' : <b>' . $langs -> trans ( " UpdateServerOffline " ) . '</b>' ;
2017-02-22 02:19:50 +01:00
}
}
else
{
2018-03-07 09:41:27 +01:00
print $langs -> trans ( " LastStableVersion " ) . ' : <a href="' . $_SERVER [ " PHP_SELF " ] . '?action=getlastversion" class="butAction">' . $langs -> trans ( " Check " ) . '</a>' ;
2017-02-22 02:19:50 +01:00
}
}
2017-11-30 11:16:28 +01:00
// Now show link to the changelog
2017-10-09 22:52:26 +02:00
print ' - ' ;
2017-11-30 11:16:28 +01:00
$version = DOL_VERSION ;
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.
print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/' . $version . '/ChangeLog" target="_blank">' . $langs -> trans ( " SeeChangeLog " ) . '</a>' ;
2011-02-07 12:48:53 +01:00
print '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " VersionLastUpgrade " ) . ' (' . $langs -> trans ( " Database " ) . ')</td><td>' . $conf -> global -> MAIN_VERSION_LAST_UPGRADE . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " VersionLastInstall " ) . '</td><td>' . $conf -> global -> 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">' ;
2009-02-20 13:29:55 +01:00
print '<table class="noborder" width="100%">' ;
2016-11-06 12:16:10 +01:00
print '<tr class="liste_titre"><td class="titlefield">' . $langs -> trans ( " Session " ) . '</td><td colspan="2">' . $langs -> trans ( " Value " ) . '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionSavePath " ) . '</td><td colspan="2">' . session_save_path () . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionName " ) . '</td><td colspan="2">' . session_name () . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " SessionId " ) . '</td><td colspan="2">' . session_id () . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentSessionTimeOut " ) . '</td><td>' . ini_get ( 'session.gc_maxlifetime' ) . ' ' . $langs -> trans ( " seconds " );
2009-02-20 13:29:55 +01:00
print '</td><td align="right">' ;
2016-03-25 15:24:57 +01:00
print $form -> textwithpicto ( '' , $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 " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentTheme " ) . '</td><td colspan="2">' . $conf -> theme . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentMenuHandler " ) . '</td><td colspan="2">' ;
2013-04-03 15:20:56 +02:00
print $conf -> standard_menu ;
2011-02-17 00:54:02 +01:00
print '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Screen " ) . '</td><td colspan="2">' ;
2014-07-27 14:13:25 +02:00
print $_SESSION [ 'dol_screenwidth' ] . ' x ' . $_SESSION [ 'dol_screenheight' ];
print '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Session " ) . '</td><td colspan="2">' ;
2014-07-27 14:13:25 +02:00
$i = 0 ;
foreach ( $_SESSION as $key => $val )
{
if ( $i > 0 ) print ', ' ;
2018-09-20 19:20:15 +02:00
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
2010-05-29 00:15:56 +02:00
if ( isset ( $conf -> global -> MAIN_OPTIMIZE_SPEED ) && ( $conf -> global -> MAIN_OPTIMIZE_SPEED & 0x02 ))
2010-01-04 21:10:10 +01:00
{
2010-05-29 00:15:56 +02:00
$shmoparray = dol_listshmop ();
2017-01-17 20:04:41 +01:00
print '<div class="div-table-responsive-no-min">' ;
2010-01-04 21:10:10 +01:00
print '<table class="noborder" width="100%">' ;
2010-01-12 13:21:29 +01:00
print '<tr class="liste_titre">' ;
2016-11-06 12:16:10 +01:00
print '<td class="titlefield">' . $langs -> trans ( " LanguageFilesCachedIntoShmopSharedMemory " ) . '</td>' ;
2010-01-12 13:21:29 +01:00
print '<td>' . $langs -> trans ( " NbOfEntries " ) . '</td>' ;
print '<td align="right">' . $langs -> trans ( " Address " ) . '</td>' ;
print '</tr>' . " \n " ;
2010-01-04 21:10:10 +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>' ;
2010-01-12 13:21:29 +01:00
print '<td align="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">' ;
2005-07-09 03:17:40 +02:00
print '<table class="noborder" width="100%">' ;
2016-11-06 12:16:10 +01:00
print '<tr class="liste_titre"><td class="titlefield">' . $langs -> trans ( " LocalisationDolibarrParameters " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' . " \n " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " LanguageBrowserParameter " , " HTTP_ACCEPT_LANGUAGE " ) . '</td><td>' . $_SERVER [ " HTTP_ACCEPT_LANGUAGE " ] . '</td></tr>' . " \n " ;
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentUserLanguage " ) . '</td><td>' . $langs -> getDefaultLang () . '</td></tr>' . " \n " ;
2008-12-06 12:28:40 +01:00
// Thousands
2013-03-24 03:12:40 +01:00
$thousand = $langs -> transnoentitiesnoconv ( " SeparatorThousand " );
2008-12-06 12:28:40 +01:00
if ( $thousand == 'SeparatorThousand' ) $thousand = ' ' ; // ' ' does not work on trans method
2010-02-23 21:30:55 +01:00
if ( $thousand == 'None' ) $thousand = '' ;
2017-04-12 17:44:01 +02: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
2013-03-24 03:12:40 +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
2017-04-12 17:44:01 +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 " ;
2008-12-06 12:48:34 +01:00
if (( $thousand != ',' && $thousand != '.' ) || ( $thousand != ' ' ))
2008-12-06 12:28:40 +01:00
{
2017-04-12 17:44:01 +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 " ;
2008-08-17 23:13:21 +02:00
// Timezone
2012-08-02 10:07:55 +02:00
$txt = $langs -> trans ( " OSTZ " ) . ' (variable system TZ): ' . ( ! empty ( $_ENV [ " TZ " ]) ? $_ENV [ " TZ " ] : $langs -> trans ( " NotDefined " )) . '<br>' . " \n " ;
2013-07-05 12:04:55 +02:00
$txt .= $langs -> trans ( " PHPTZ " ) . ' (php.ini date.timezone): ' . ( 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
2014-03-21 18:05:08 +01:00
$txt .= $langs -> trans ( " Dolibarr constant MAIN_SERVER_TZ " ) . ': ' . ( empty ( $conf -> global -> MAIN_SERVER_TZ ) ? $langs -> trans ( " NotDefined " ) : $conf -> global -> MAIN_SERVER_TZ );
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " CurrentTimeZone " ) . '</td><td>' ; // Timezone server PHP
2012-05-14 16:46:48 +02:00
$a = getServerTimeZoneInt ( 'now' );
$b = getServerTimeZoneInt ( 'winter' );
$c = getServerTimeZoneInt ( 'summer' );
2012-05-15 00:48:59 +02:00
$daylight = ( is_numeric ( $c ) && is_numeric ( $b )) ? round ( $c - $b ) : 'unknown' ;
//print $a." ".$b." ".$c." ".$daylight;
2012-05-14 16:46:48 +02:00
$val = ( $a >= 0 ? '+' : '' ) . $a ;
2015-03-14 14:55:41 +01:00
$val .= ' (' . ( $a == 'unknown' ? 'unknown' : ( $a >= 0 ? '+' : '' ) . ( $a * 3600 )) . ')' ;
2012-05-15 01:41:12 +02:00
$val .= ' ' . getServerTimeZoneString ();
2012-12-08 17:14:51 +01:00
$val .= ' ' . $langs -> trans ( " DaylingSavingTime " ) . ': ' . ( $daylight === 'unknown' ? 'unknown' : ( $a == $c ? yn ( $daylight ) : yn ( 0 ) . ( $daylight ? ' (' . $langs -> trans ( 'YesInSummer' ) . ')' : '' )));
2016-03-25 15:24:57 +01:00
print $form -> textwithtooltip ( $val , $txt , 2 , 1 , img_info ( '' ));
2012-02-05 15:13:31 +01:00
print '</td></tr>' . " \n " ; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td> => ' . $langs -> trans ( " CurrentHour " ) . '</td><td>' . dol_print_date ( dol_now (), 'dayhour' , 'tzserver' ) . '</td></tr>' . " \n " ;
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>' ;
2014-07-04 11:58:41 +02:00
// Database timezone
if ( $conf -> db -> type == 'mysql' || $conf -> db -> type == 'mysqli' )
{
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " MySQLTimeZone " ) . ' (database)</td><td>' ; // Timezone server base
2014-07-04 11:58:41 +02:00
$sql = " SHOW VARIABLES where variable_name = 'system_time_zone' " ;
$resql = $db -> query ( $sql );
if ( $resql )
{
$obj = $db -> fetch_object ( $resql );
2016-03-25 15:24:57 +01:00
print $form -> textwithtooltip ( $obj -> Value , $langs -> trans ( 'TZHasNoEffect' ), 2 , 1 , img_info ( '' ));
2014-07-04 11:58:41 +02:00
}
print '</td></tr>' . " \n " ;
}
2011-09-14 23:50:18 +02:00
// Client
2012-02-05 15:13:31 +01:00
$tz = ( int ) $_SESSION [ 'dol_tz' ] + ( int ) $_SESSION [ 'dol_dst' ];
2017-04-12 17:44:01 +02:00
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 " ) . ': ' ;
if ( $_SESSION [ 'dol_dst' ] > 0 ) print yn ( 1 );
2011-11-01 04:57:45 +01:00
else print yn ( 0 );
2011-12-12 01:50:29 +01:00
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 " ;
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven"><td> => ' . $langs -> trans ( " ClientHour " ) . '</td><td>' . dol_print_date ( dol_now (), 'dayhour' , 'tzuser' ) . '</td></tr>' . " \n " ;
2009-12-14 20:34:10 +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
$tmp = ini_get ( " unicode.filesystem_encoding " ); // Disponible avec PHP 6.0
if ( empty ( $tmp ) && ! empty ( $_SERVER [ " WINDIR " ])) $tmp = 'iso-8859-1' ; // By default for windows
if ( empty ( $tmp )) $tmp = 'utf-8' ; // By default for other
if ( ! empty ( $conf -> global -> MAIN_FILESYSTEM_ENCODING )) $tmp = $conf -> global -> MAIN_FILESYSTEM_ENCODING ;
2017-04-12 17:44:01 +02: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)
$configfileparameters = array (
'dolibarr_main_url_root' => $langs -> trans ( " URLRoot " ),
2013-01-18 11:05:18 +01:00
'?dolibarr_main_url_root_alt' => $langs -> trans ( " URLRoot " ) . ' (alt)' ,
2012-09-21 08:50:23 +02:00
'dolibarr_main_document_root' => $langs -> trans ( " DocumentRootServer " ),
2013-01-18 11:05:18 +01:00
'?dolibarr_main_document_root_alt' => $langs -> trans ( " DocumentRootServer " ) . ' (alt)' ,
2012-09-21 08:50:23 +02:00
'dolibarr_main_data_root' => $langs -> trans ( " DataRootServer " ),
2013-01-18 11:05:18 +01:00
'separator1' => '' ,
2012-09-21 08:50:23 +02:00
'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 ( " Prefix " ),
2013-01-18 11:05:18 +01:00
'separator2' => '' ,
2012-09-21 08:50:23 +02:00
'dolibarr_main_authentication' => $langs -> trans ( " AuthenticationMode " ),
2017-02-15 18:30:27 +01:00
'?multicompany_transverse_mode' => $langs -> trans ( " MultiCompanyMode " ),
2012-09-21 08:50:23 +02:00
'separator' => '' ,
'?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' ,
2013-01-18 11:05:18 +01:00
'separator3' => '' ,
2012-09-21 08:50:23 +02:00
'?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH' ,
2012-12-19 13:06:45 +01:00
'?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH' ,
2015-03-02 01:38:40 +01:00
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH' ,
2012-09-21 08:50:23 +02:00
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH' ,
2015-03-02 01:38:40 +01:00
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH' ,
2012-09-21 08:50:23 +02:00
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH' ,
'?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_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_js_JQUERY_FLOT' => 'dolibarr_js_JQUERY_FLOT' ,
'?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF' ,
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD' ,
2013-01-18 11:05:18 +01:00
'separator4' => '' ,
'dolibarr_main_prod' => 'Production mode (Hide all error messages)' ,
2018-03-07 09:41:27 +01:00
'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups' ,
'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only' ,
2012-09-21 08:50:23 +02:00
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page' ,
2016-12-16 13:46:39 +01:00
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli' ,
2018-03-07 09:41:27 +01: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">' ;
2012-09-21 08:50:23 +02:00
print '<table class="noborder" width="100%">' ;
2012-09-21 00:13:20 +02:00
print '<tr class="liste_titre">' ;
2016-11-06 12:16:10 +01:00
print '<td class="titlefield">' . $langs -> trans ( " Parameters " ) . ' ' ;
2012-09-21 08:50:23 +02:00
print $langs -> trans ( " ConfigurationFile " ) . ' (' . $conffiletoshowshort . ')' ;
print '</td>' ;
print '<td>' . $langs -> trans ( " Parameter " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Value " ) . '</td>' ;
print '</tr>' . " \n " ;
foreach ( $configfileparameters as $key => $value )
{
$ignore = 0 ;
if ( empty ( $ignore ))
{
$newkey = preg_replace ( '/^\?/' , '' , $key );
2017-10-09 22:52:26 +02:00
if ( preg_match ( '/^\?/' , $key ) && empty ( ${$newkey} ))
2017-02-15 18:30:27 +01:00
{
if ( $newkey != 'multicompany_transverse_mode' || empty ( $conf -> multicompany -> enabled ))
continue ; // We discard parameters starting with ?
}
2013-01-18 11:05:18 +01:00
if ( strpos ( $newkey , 'separator' ) !== false && $lastkeyshown == 'separator' ) continue ;
2012-09-21 08:50:23 +02:00
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven">' ;
2013-01-18 11:05:18 +01:00
if ( strpos ( $newkey , 'separator' ) !== false )
2012-09-21 08:50:23 +02:00
{
print '<td colspan="3"> </td>' ;
}
else
{
// Label
print " <td> " . $value . '</td>' ;
// Key
print '<td>' . $newkey . '</td>' ;
// Value
print " <td> " ;
if ( $newkey == 'dolibarr_main_db_pass' ) print preg_replace ( '/./i' , '*' , ${$newkey} );
else if ( $newkey == 'dolibarr_main_url_root' && preg_match ( '/__auto__/' , ${$newkey} )) print ${$newkey} . ' => ' . constant ( 'DOL_MAIN_URL_ROOT' );
2014-08-07 13:02:13 +02:00
else if ( $newkey == 'dolibarr_main_document_root_alt' )
{
$tmparray = explode ( ',' , ${$newkey} );
$i = 0 ;
foreach ( $tmparray as $value2 )
{
if ( $i > 0 ) print ', ' ;
print $value2 ;
2015-03-02 01:38:40 +01:00
if ( ! is_readable ( $value2 ))
2014-08-13 15:07:22 +02:00
{
$langs -> load ( " errors " );
print ' ' . img_warning ( $langs -> trans ( " ErrorCantReadDir " , $value2 ));
}
2014-08-07 13:02:13 +02:00
++ $i ;
}
}
2012-09-21 08:50:23 +02:00
else print ${$newkey} ;
2018-01-21 15:32:10 +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 " ;
$lastkeyshown = $newkey ;
}
}
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>' ;
2012-09-21 08:50:23 +02:00
print '<td>' . $langs -> trans ( " Value " ) . '</td>' ;
2016-11-06 12:16:10 +01:00
if ( empty ( $conf -> multicompany -> enabled ) || ! $user -> entity ) 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 " ;
$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 " ;
if ( empty ( $conf -> multicompany -> enabled ))
{
// If no multicompany mode, admins can see global and their constantes
$sql .= " WHERE entity IN (0, " . $conf -> entity . " ) " ;
}
else
{
// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
if ( $user -> entity ) $sql .= " WHERE entity IN ( " . $user -> entity . " , " . $conf -> entity . " ) " ;
}
$sql .= " ORDER BY entity, name ASC " ;
$resql = $db -> query ( $sql );
if ( $resql )
{
$num = $db -> num_rows ( $resql );
$i = 0 ;
while ( $i < $num )
{
$obj = $db -> fetch_object ( $resql );
2017-04-12 17:44:01 +02:00
print '<tr class="oddeven">' ;
2018-03-07 09:41:27 +01:00
print '<td class="tdoverflowmax300">' . $obj -> name . '</td>' . " \n " ;
print '<td class="tdoverflowmax300">' . dol_escape_htmltag ( $obj -> value ) . '</td>' . " \n " ;
2016-11-06 12:16:10 +01:00
if ( empty ( $conf -> multicompany -> enabled ) || ! $user -> entity ) print '<td align="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
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-02-06 00:07:48 +01:00
$db -> close ();