From cc2d695d8b6b2109aa63dfb35d41f4954a0b5a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Oct 2006 10:25:01 +0000 Subject: [PATCH] Add support for hiding server information. --- ChangeLog | 2 ++ Documentation.html | 6 ++++++ libraries/config.default.php | 1 + main.php | 29 +++++++++++++++++++---------- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8e463e01..68e4d07b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ $HeadURL$ * Documentation.html: Fix HTML errors. * libraries/sqlparser.data.php, libraries/sqlparser.lib.php: Add support for ON DUPLICATE KEY (bug #1576226). + * Documentation.html, main.php, libraries/config.default.php: Add support + for hiding server information. 2006-10-16 Michal Čihař * left.php, navigation.php, scripts/setup.php, js/querywindow.js, diff --git a/Documentation.html b/Documentation.html index ca7476bbd..908630a90 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1203,6 +1203,12 @@ ALTER TABLE `pma_column_comments` Note that statistics requires at least MySQL 3.23.3 and that, at this date, MySQL doesn't return such information for Berkeley DB tables. +
$cfg['ShowServerInfo'] boolean
+
Defines whether to display detailed server information on main page. + You can additionally hide more information by using + $cfg['Servers'][$i]['verbose']. +
+
$cfg['ShowPhpInfo'] boolean
$cfg['ShowChgPassword'] boolean
$cfg['ShowCreateDb'] boolean diff --git a/libraries/config.default.php b/libraries/config.default.php index b08a0063b..9d5617328 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -175,6 +175,7 @@ $cfg['ShowStats'] = TRUE; // allow to display statistics and space // the pages about database details and table // properties $cfg['ShowPhpInfo'] = FALSE; // show php info link +$cfg['ShowServerInfo'] = TRUE; // show MySQL server information $cfg['ShowChgPassword'] = FALSE; // show change password link $cfg['ShowCreateDb'] = TRUE; // show create database form $cfg['SuggestDBName'] = TRUE; // suggest a new DB name if possible (false = keep empty) diff --git a/main.php b/main.php index e415df0ce..240b4dc3c 100644 --- a/main.php +++ b/main.php @@ -59,12 +59,16 @@ if ($server > 0) { // if a value is set $server_info = ''; if (!empty($cfg['Server']['verbose'])) { - $server_info .= $cfg['Server']['verbose']; - $server_info .= ' ('; + $server_info .= htmlspecialchars($cfg['Server']['verbose']); + if ($GLOBALS['cfg']['ShowServerInfo']) { + $server_info .= ' ('; + } + } + if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) { + $server_info .= PMA_DBI_get_host_info(); } - $server_info .= PMA_DBI_get_host_info(); - if (!empty($cfg['Server']['verbose'])) { + if (!empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) { $server_info .= ')'; } // loic1: skip this because it's not a so good idea to display sockets @@ -89,12 +93,17 @@ if ($server > 0) { if ($server > 0) { echo '
    ' . "\n"; - PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_info'); - PMA_printListItem($strProtocolVersion . ': ' . PMA_DBI_get_proto_info(), - 'li_mysql_proto'); - PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info'); - PMA_printListItem($strUser . ': ' . htmlspecialchars($mysql_cur_user_and_host), - 'li_user_info'); + if ($GLOBALS['cfg']['ShowServerInfo']) { + PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_info'); + PMA_printListItem($strProtocolVersion . ': ' . PMA_DBI_get_proto_info(), + 'li_mysql_proto'); + PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info'); + PMA_printListItem($strUser . ': ' . htmlspecialchars($mysql_cur_user_and_host), + 'li_user_info'); + } else { + PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_info'); + PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info'); + } if ($cfg['AllowAnywhereRecoding'] && $allow_recoding && PMA_MYSQL_INT_VERSION < 40100) { echo '
  • ';