3 // vim: expandtab sw=4 ts=4 sts=4:
6 * Don't display the page heading
8 if (!defined('PMA_DISPLAY_HEADING')) {
9 define('PMA_DISPLAY_HEADING', 0);
13 * Gets some core libraries and displays a top message if required
15 require_once('./libraries/common.lib.php');
17 // Handles some variables that may have been sent by the calling script
25 require_once('./libraries/header.inc.php');
27 // Any message to display?
28 if ( ! empty( $message ) ) {
29 PMA_showMessage( $message );
33 $common_url_query = PMA_generate_common_url( '', '' );
35 // this div is required for containing divs can be 50%
36 echo '<div id="maincontainer">' . "\n";
39 * Displays the mysql server related links
43 require_once('./libraries/check_user_privileges.lib.php');
44 // why this? a non-priv user should be able to change his
45 // password if the configuration permits
46 //$cfg['ShowChgPassword'] = $is_superuser = PMA_isSuperuser();
47 $is_superuser = PMA_isSuperuser();
49 if ($cfg['Server']['auth_type'] == 'config') {
50 $cfg['ShowChgPassword'] = FALSE;
55 <div id
="mysqlmaininformation">
58 // robbat2: Use the verbose name of the server instead of the hostname
61 if (!empty($cfg['Server']['verbose'])) {
62 $server_info .= $cfg['Server']['verbose'];
65 $server_info .= PMA_DBI_get_host_info();
67 if (!empty($cfg['Server']['verbose'])) {
70 // loic1: skip this because it's not a so good idea to display sockets
72 // if (!empty($cfg['Server']['socket']) && PMA_PHP_INT_VERSION >= 30010) {
73 // $server_info .= ':' . $cfg['Server']['socket'];
75 $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
77 echo '<h1 xml:lang="en" dir="ltr">MySQL - ' . PMA_MYSQL_STR_VERSION
80 // Case when no server selected
81 echo '<h1 xml:lang="en" dir="ltr">MySQL</h1>' . "\n";
85 * Displays the MySQL servers choice form
87 if (!$cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 ||
$server == 0 && count($cfg['Servers']) == 1)) {
88 include('./libraries/select_server.lib.php');
89 PMA_select_server(TRUE, FALSE);
95 PMA_printListItem( $strProtocolVersion . ': ' . PMA_DBI_get_proto_info(),
97 PMA_printListItem( $strServer . ': ' . $server_info, 'li_server_info' );
98 PMA_printListItem( $strUser . ': ' . htmlspecialchars( $mysql_cur_user_and_host ),
101 if ( $cfg['AllowAnywhereRecoding'] && $allow_recoding && PMA_MYSQL_INT_VERSION
< 40100) {
102 echo '<li id="li_select_mysql_charset">';
104 <form method
="post" action
="index.php" target
="_parent">
105 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
106 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
107 <?php
echo $strMySQLCharset;?
>:
108 <select name
="convcharset" xml
:lang
="en" dir
="ltr"
109 onchange
="this.form.submit();">
111 foreach ($cfg['AvailableCharsets'] as $tmpcharset) {
112 if ($convcharset == $tmpcharset) {
113 $selected = ' selected="selected"';
118 . '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
122 <noscript
><input type
="submit" value
="<?php echo $strGo;?>" /></noscript
>
126 } elseif ( PMA_MYSQL_INT_VERSION
>= 40100 ) {
127 echo ' <li id="li_select_mysql_charset">';
128 echo ' ' . $strMySQLCharset . ': '
129 . ' <strong xml:lang="en" dir="ltr">'
130 . ' ' . $mysql_charsets_descriptions[$mysql_charset_map[strtolower($charset)]] . "\n"
131 . ' (' . $mysql_charset_map[strtolower($charset)] . ')' . "\n"
132 . ' </strong>' . "\n"
134 . ' <li id="li_select_mysql_collation">';
135 echo ' <form method="post" action="index.php" target="_parent">' . "\n"
136 . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
137 . ' <label for="select_collation_connection">' . "\n"
138 . ' ' . $strMySQLConnectionCollation . ': ' . "\n"
140 . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION
, 'collation_connection', 'select_collation_connection', $collation_connection, TRUE, 4, TRUE)
141 . ' <noscript><input type="submit" value="' . $strGo . '" /></noscript>' . "\n"
142 // put the doc link in the form so that it appears on the same line
143 . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n"
148 if ($cfg['ShowCreateDb']) {
149 echo '<li id="li_create_database">';
150 require('./libraries/display_create_database.lib.php');
154 PMA_printListItem( $strMySQLShowStatus, 'li_mysql_status',
155 './server_status.php?' . $common_url_query );
156 PMA_printListItem( $strMySQLShowVars, 'li_mysql_variables',
157 './server_variables.php?' . $common_url_query, 'show-variables' );
158 PMA_printListItem( $strProcesses, 'li_mysql_processes',
159 './server_processlist.php?' . $common_url_query, 'show-processlist' );
161 if (PMA_MYSQL_INT_VERSION
>= 40100) {
162 PMA_printListItem( $strCharsetsAndCollations, 'li_mysql_collations',
163 './server_collations.php?' . $common_url_query );
166 PMA_printListItem( $strStorageEngines, 'li_mysql_engines',
167 './server_engines.php?' . $common_url_query );
169 if ($is_reload_priv) {
170 PMA_printListItem( $strReloadPrivileges, 'li_flush_privileges',
171 './server_privileges.php?flush_privileges=1&' . $common_url_query, 'flush' );
175 PMA_printListItem( $strPrivileges, 'li_mysql_privilegs',
176 './server_privileges.php?' . $common_url_query );
179 $binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', null, PMA_DBI_QUERY_STORE
);
181 if (PMA_DBI_num_rows($binlogs) > 0) {
182 PMA_printListItem( $strBinaryLog, 'li_mysql_binlogs',
183 './server_binlog.php?' . $common_url_query );
185 PMA_DBI_free_result($binlogs);
189 PMA_printListItem( $strDatabases, 'li_mysql_databases',
190 './server_databases.php?' . $common_url_query );
191 PMA_printListItem( $strExport, 'li_export',
192 './server_export.php?' . $common_url_query );
193 PMA_printListItem( $strImport, 'li_import',
194 './server_import.php?' . $common_url_query );
196 // Change password (TODO ? needs another message)
197 if ($cfg['ShowChgPassword']) {
198 PMA_printListItem( $strChangePassword, 'li_change_password',
199 './user_password.php?' . $common_url_query );
202 // Logout for advanced authentication
203 if ($cfg['Server']['auth_type'] != 'config') {
204 $http_logout = ($cfg['Server']['auth_type'] == 'http')
205 ?
'<a href="./Documentation.html#login_bug" target="documentation">'
206 . ($cfg['ReplaceHelpImg'] ?
'<img class="icon" src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" alt="Info" />' : '(*)') . '</a>'
208 PMA_printListItem( '<strong>' . $strLogout . '</strong> ' . $http_logout,
210 './index.php?' . $common_url_query . '&old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent');
214 } // end of if ($server > 0)
217 <div id
="pmamaininformation">
220 echo '<h1 xml:lang="en" dir="ltr">phpMyAdmin - ' . PMA_VERSION
. '</h1>'
226 PMA_printListItem( $strMysqlClientVersion . ': ' . PMA_DBI_get_client_info(),
227 'li_mysql_client_version' );
228 PMA_printListItem( $strUsedPhpExtensions . ': ' . $GLOBALS['cfg']['Server']['extension'],
229 'li_used_php_extension' );
232 // Displays language selection combo
233 if (empty($cfg['Lang'])) {
234 echo '<li id="li_select_lang">';
235 require_once('./libraries/display_select_lang.lib.php');
236 PMA_select_language();
241 if ( isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
242 && $server != 0 && $allow_recoding && PMA_MYSQL_INT_VERSION
< 40100) {
243 echo '<li id="li_select_charset">';
245 <form method
="post" action
="index.php" target
="_parent">
246 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
247 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
248 <?php
echo $strMySQLCharset;?
>:
249 <select name
="convcharset" xml
:lang
="en" dir
="ltr"
250 onchange
="this.form.submit();">
252 foreach ($cfg['AvailableCharsets'] AS $id => $tmpcharset) {
253 if ($convcharset == $tmpcharset) {
254 $selected = ' selected="selected"';
259 . '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
263 <noscript
><input type
="submit" value
="<?php echo $strGo;?>" /></noscript
>
269 // added by Michael Keck <mail_at_michaelkeck_dot_de>
270 // ThemeManager if available
272 if ( $GLOBALS['cfg']['ThemeManager'] ) {
273 echo '<li id="li_select_theme">';
274 echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
277 PMA_printListItem( $strPmaDocumentation, 'li_pma_docs', 'Documentation.html' );
279 if ( $cfg['ShowPhpInfo'] ) {
280 PMA_printListItem( $strShowPHPInfo, 'li_phpinfo', './phpinfo.php?' . $common_url_query );
283 // does not work if no target specified, don't know why
284 PMA_printListItem( $strHomepageOfficial, 'li_pma_homepage', 'http://www.phpMyAdmin.net/', null, '_blank' );
286 <li
><bdo xml
:lang
="en" dir
="ltr">
287 [<a href
="changelog.php" target
="_blank">ChangeLog
</a
>]
288 [<a href
="http://phpmyadmin.cvs.sourceforge.net/phpmyadmin/"
289 target
="_blank">CVS
</a
>]
290 [<a href
="http://sourceforge.net/mail/?group_id=23067"
291 target
="_blank">Lists
</a
>]
298 * BUG: MSIE needs two <br /> here, otherwise it will not extend the outer div to the
299 * full height of the inner divs
302 <br
class="clearfloat" />
303 <br
class="clearfloat" />
307 if ( ! empty( $GLOBALS['PMA_errors'] ) && is_array( $GLOBALS['PMA_errors'] ) ) {
308 foreach ( $GLOBALS['PMA_errors'] as $error ) {
309 echo '<div class="error">' . $error . '</div>' . "\n";
314 * Removed the "empty $cfg['PmaAbsoluteUri']" warning on 2005-08-23
315 * See https://sourceforge.net/tracker/index.php?func=detail&aid=1257134&group_id=23067&atid=377411
319 * Warning if using the default MySQL privileged account
320 * modified: 2004-05-05 mkkeck
323 && $cfg['Server']['user'] == 'root'
324 && $cfg['Server']['password'] == '') {
325 echo '<div class="warning">' . $strInsecureMySQL . '</div>' . "\n";
329 * Warning for PHP 4.2.3
330 * modified: 2004-05-05 mkkeck
333 if (PMA_PHP_INT_VERSION
== 40203 && @extension_loaded
('mbstring')) {
334 echo '<div class="warning">' . $strPHP40203 . '</div>' . "\n";
338 * Nijel: As we try to hadle charsets by ourself, mbstring overloads just
339 * break it, see bug 1063821.
342 if (@extension_loaded
('mbstring') && @ini_get
('mbstring.func_overload') > 1) {
343 echo '<div class="warning">' . $strMbOverloadWarning . '</div>' . "\n";
347 * Nijel: mbstring is used for handling multibyte inside parser, so it is good
348 * to tell user something might be broken without it, see bug #1063149.
350 if ($GLOBALS['using_mb_charset'] && !@extension_loaded
('mbstring')) {
351 echo '<div class="warning">' . $strMbExtensionMissing . '</div>' . "\n";
355 * Warning for old PHP version
356 * modified: 2004-05-05 mkkeck
359 if (PMA_PHP_INT_VERSION
< 40100) {
360 echo '<div class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.0') . '</div>' . "\n";
364 * Warning for old MySQL version
365 * modified: 2004-05-05 mkkeck
367 // not yet defined before the server choice
368 if (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION
< 32332) {
369 echo '<div class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</div>' . "\n";
373 * prints list item for main page
375 * @param string $name displayed text
376 * @param string $id id, used for css styles
377 * @param string $url make item as link with $url as target
378 * @param string $mysql_help_page display a link to MySQL's manual
379 * @param string $target special target for $url
381 function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null)
383 echo '<li id="' . $id . '">';
385 echo '<a href="' . $url . '"';
386 if (null !== $target) {
387 echo ' target="' . $target . '"';
397 if (null !== $mysql_help_page) {
398 echo PMA_showMySQLDocu('', $mysql_help_page);
404 * Displays the footer
406 require_once('./libraries/footer.inc.php');