2004-10-19 20:58:50 +02:00
|
|
|
<?php
|
2007-01-05 15:49:13 +01:00
|
|
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2014-02-25 18:25:17 +01:00
|
|
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
2009-04-17 17:43:28 +02:00
|
|
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
|
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
2003-08-28 23:37:29 +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
|
2003-08-28 23:37:29 +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/>.
|
2003-08-28 23:37:29 +02:00
|
|
|
*/
|
|
|
|
|
|
2006-08-06 02:10:48 +02:00
|
|
|
/**
|
2008-12-20 19:37:30 +01:00
|
|
|
* \file htdocs/admin/system/database.php
|
2011-01-10 20:16:21 +01:00
|
|
|
* \brief Page with system information of database
|
2008-12-20 19:37:30 +01:00
|
|
|
*/
|
2004-02-15 01:06:47 +01:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../../main.inc.php';
|
2004-02-15 01:06:47 +01:00
|
|
|
|
2004-09-04 13:19:13 +02:00
|
|
|
$langs->load("admin");
|
2004-09-03 22:59:00 +02:00
|
|
|
|
2011-09-28 16:26:49 +02:00
|
|
|
if (!$user->admin) accessforbidden();
|
2008-12-20 19:37:30 +01:00
|
|
|
|
2006-08-06 02:10:48 +02:00
|
|
|
|
2007-03-28 13:55:15 +02:00
|
|
|
|
|
|
|
|
/*
|
2009-04-17 17:43:28 +02:00
|
|
|
* View
|
2008-12-20 19:37:30 +01:00
|
|
|
*/
|
|
|
|
|
|
2011-11-08 10:18:45 +01:00
|
|
|
$form=new Form($db);
|
2008-12-20 19:37:30 +01:00
|
|
|
|
2003-08-28 23:37:29 +02:00
|
|
|
llxHeader();
|
|
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
print load_fiche_titre($langs->trans("InfoDatabase"), '', 'title_setup');
|
2009-04-17 17:43:28 +02:00
|
|
|
|
|
|
|
|
// Database
|
2017-01-17 20:04:41 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2009-04-17 17:43:28 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
2011-02-07 14:55:53 +01:00
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
2014-08-01 00:53:29 +02:00
|
|
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
2011-02-07 14:55:53 +01:00
|
|
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DatabaseServer").'</td><td>'.$conf->db->host.'</td></tr>'."\n";
|
|
|
|
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DatabasePort").'</td><td>'.(empty($conf->db->port)?$langs->trans("Default"):$conf->db->port).'</td></tr>'."\n";
|
|
|
|
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DatabaseName").'</td><td>'.$conf->db->name.'</td></tr>'."\n";
|
2013-06-07 19:19:11 +02:00
|
|
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DriverType").'</td><td>'.$conf->db->type . ($db->getDriverInfo() ? ' ('.$db->getDriverInfo().')':'').'</td></tr>'."\n";
|
2011-02-07 14:55:53 +01:00
|
|
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("User").'</td><td>'.$conf->db->user.'</td></tr>'."\n";
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $dolibarr_main_db_pass).'</td></tr>'."\n";
|
2011-02-07 14:55:53 +01:00
|
|
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
|
|
|
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
2009-04-17 17:43:28 +02:00
|
|
|
print '</table>';
|
2017-01-17 20:04:41 +01:00
|
|
|
print '</div>';
|
2007-03-28 13:55:15 +02:00
|
|
|
|
2012-09-08 00:52:44 +02:00
|
|
|
// Tables
|
2012-09-09 16:32:03 +02:00
|
|
|
print '<br>';
|
2017-01-17 20:04:41 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2012-09-09 16:32:03 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
|
|
|
|
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
|
|
|
|
print '</table>';
|
2017-01-17 20:04:41 +01:00
|
|
|
print '</div>';
|
2007-03-28 13:55:15 +02:00
|
|
|
|
2014-02-25 18:25:17 +01:00
|
|
|
$listofvars=$db->getServerParametersValues();
|
|
|
|
|
$listofstatus=$db->getServerStatusValues();
|
|
|
|
|
$arraylist=array('listofvars','listofstatus');
|
2003-08-28 23:37:29 +02:00
|
|
|
|
2014-02-25 18:25:17 +01:00
|
|
|
if (! count($listofvars) && ! count($listofstatus))
|
2006-08-06 02:10:48 +02:00
|
|
|
{
|
2008-12-20 19:37:30 +01:00
|
|
|
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
|
2006-08-06 02:10:48 +02:00
|
|
|
}
|
|
|
|
|
else
|
2003-08-28 23:37:29 +02:00
|
|
|
{
|
2014-02-25 18:25:17 +01:00
|
|
|
foreach($arraylist as $listname)
|
2006-08-06 02:10:48 +02:00
|
|
|
{
|
2008-12-20 19:37:30 +01:00
|
|
|
print '<br>';
|
2017-01-17 20:04:41 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2009-04-17 17:43:28 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
2008-12-20 19:37:30 +01:00
|
|
|
print '<tr class="liste_titre">';
|
2012-09-08 00:52:44 +02:00
|
|
|
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
2008-12-20 19:37:30 +01:00
|
|
|
print '<td>'.$langs->trans("Value").'</td>';
|
2011-02-07 14:55:53 +01:00
|
|
|
print '</tr>'."\n";
|
2014-07-08 01:02:30 +02:00
|
|
|
|
2008-12-20 19:37:30 +01:00
|
|
|
// arraytest is an array of test to do
|
|
|
|
|
$arraytest=array();
|
2019-01-27 11:55:16 +01:00
|
|
|
if (preg_match('/mysql/i', $db->type))
|
2008-12-20 19:37:30 +01:00
|
|
|
{
|
|
|
|
|
$arraytest=array(
|
2012-08-10 03:46:17 +02:00
|
|
|
'character_set_database'=>array('var'=>'dolibarr_main_db_character_set','valifempty'=>'utf8'),
|
2016-11-07 01:53:34 +01:00
|
|
|
'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_unicode_ci')
|
2008-12-20 19:37:30 +01:00
|
|
|
);
|
|
|
|
|
}
|
2014-07-08 01:02:30 +02:00
|
|
|
|
2014-02-25 18:25:17 +01:00
|
|
|
$listtouse=array();
|
|
|
|
|
if ($listname == 'listofvars') $listtouse=$listofvars;
|
|
|
|
|
if ($listname == 'listofstatus') $listtouse=$listofstatus;
|
2009-01-15 23:49:06 +01:00
|
|
|
|
2014-02-25 18:25:17 +01:00
|
|
|
foreach($listtouse as $param => $paramval)
|
2008-12-20 19:37:30 +01:00
|
|
|
{
|
2017-04-12 17:44:01 +02:00
|
|
|
print '<tr class="oddeven">';
|
2014-02-25 18:25:17 +01:00
|
|
|
print '<td>';
|
|
|
|
|
print $param;
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
$show=0;$text='';
|
|
|
|
|
foreach($arraytest as $key => $val)
|
2008-12-20 19:37:30 +01:00
|
|
|
{
|
2014-02-25 18:25:17 +01:00
|
|
|
if ($key != $param) continue;
|
|
|
|
|
$val2=${$val['var']};
|
|
|
|
|
$text='Should be in line with value of param <b>'.$val['var'].'</b> thas is <b>'.($val2?$val2:"'' (=".$val['valifempty'].")").'</b>';
|
|
|
|
|
$show=1;
|
2008-12-20 19:37:30 +01:00
|
|
|
}
|
2014-02-25 18:25:17 +01:00
|
|
|
if ($show==0) print $paramval;
|
2019-01-27 11:55:16 +01:00
|
|
|
if ($show==1) print $form->textwithpicto($paramval, $text);
|
|
|
|
|
if ($show==2) print $form->textwithpicto($paramval, $text, 1, 'warning');
|
2014-02-25 18:25:17 +01:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>'."\n";
|
2008-12-20 19:37:30 +01:00
|
|
|
}
|
2011-02-07 14:55:53 +01:00
|
|
|
print '</table>'."\n";
|
2017-01-17 20:04:41 +01:00
|
|
|
print '</div>';
|
2006-08-06 02:10:48 +02:00
|
|
|
}
|
2003-08-28 23:37:29 +02:00
|
|
|
}
|
|
|
|
|
|
2018-07-28 14:29:28 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2014-07-08 01:02:30 +02:00
|
|
|
$db->close();
|