home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / main.php < prev    next >
Encoding:
PHP Script  |  2004-01-27  |  24.6 KB  |  663 lines

  1. <?php
  2. /* $Id: main.php,v 2.8.2.1 2004/01/27 18:14:51 lem9 Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. /**
  6.  * Don't display the page heading
  7.  */
  8. define('PMA_DISPLAY_HEADING', 0);
  9.  
  10. /**
  11.  * Gets some core libraries and displays a top message if required
  12.  */
  13. require_once('./libraries/grab_globals.lib.php');
  14. require_once('./libraries/common.lib.php');
  15. // Puts the language to use in a cookie that will expire in 30 days
  16. if (!isset($pma_uri_parts)) {
  17.     $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
  18.     $cookie_path   = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
  19.     $is_https      = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
  20. }
  21. setcookie('lang', $lang, time() + 60*60*24*30, $cookie_path, '', $is_https);
  22. // Defines the "item" image depending on text direction
  23. $item_img = 'images/item_' . $text_dir . '.png';
  24. // Handles some variables that may have been sent by the calling script
  25. if (isset($db)) {
  26.     unset($db);
  27. }
  28. if (isset($table)) {
  29.     unset($table);
  30. }
  31. $show_query = '1';
  32. require_once('./header.inc.php');
  33. if (isset($message)) {
  34.     PMA_showMessage($message);
  35. }
  36. else if (isset($reload) && $reload) {
  37.     // Reloads the navigation frame via JavaScript if required
  38.     echo "\n";
  39.     ?>
  40. <script type="text/javascript" language="javascript1.2">
  41. <!--
  42. window.parent.frames['nav'].location.replace('./left.php?<?php echo PMA_generate_common_url('', '', '&');?>&hash=' + <?php echo (($cfg['QueryFrame'] && $cfg['QueryFrameJS']) ? 'window.parent.frames[\'queryframe\'].document.hashform.hash.value' : "'" . md5($cfg['PmaAbsoluteUri']) . "'"); ?>););
  43. //-->
  44. </script>
  45.     <?php
  46. }
  47. echo "\n";
  48.  
  49.  
  50. /**
  51.  * Displays the welcome message and the server informations
  52.  */
  53. ?>
  54. <h1><?php echo sprintf($strWelcome, ' phpMyAdmin ' . PMA_VERSION); ?></h1>
  55.  
  56. <?php
  57. // Don't display server info if $server == 0 (no server selected)
  58. // loic1: modified in order to have a valid words order whatever is the
  59. //        language used
  60. if ($server > 0) {
  61.     // robbat2: Use the verbose name of the server instead of the hostname
  62.     //          if a value is set
  63.     if(!empty($cfg['Server']['verbose'])) {
  64.         $server_info = $cfg['Server']['verbose'];
  65.     } else {
  66.         $server_info = $cfg['Server']['host'];
  67.     }
  68.     $server_info            .= (empty($cfg['Server']['port']) ? '' : ':' . $cfg['Server']['port']);
  69.     // loic1: skip this because it's not a so good idea to display sockets
  70.     //        used to everybody
  71.     // if (!empty($cfg['Server']['socket']) && PMA_PHP_INT_VERSION >= 30010) {
  72.     //     $server_info .= ':' . $cfg['Server']['socket'];
  73.     // }
  74.     $local_query             = 'SELECT VERSION() as version, USER() as user';
  75.     $res                     = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, '');
  76.     $mysql_cur_user_and_host = PMA_mysql_result($res, 0, 'user');
  77.     $mysql_cur_user          = substr($mysql_cur_user_and_host, 0, strrpos($mysql_cur_user_and_host, '@'));
  78.  
  79.     $full_string     = str_replace('%pma_s1%', PMA_mysql_result($res, 0, 'version'), $strMySQLServerProcess);
  80.     $full_string     = str_replace('%pma_s2%', $server_info, $full_string);
  81.     $full_string     = str_replace('%pma_s3%', $mysql_cur_user_and_host, $full_string);
  82.  
  83.     echo '<p><b>' . $full_string . '</b></p><br />' . "\n";
  84. } // end if
  85.  
  86.  
  87. /**
  88.  * Reload mysql (flush privileges)
  89.  */
  90. if (($server > 0) && isset($mode) && ($mode == 'reload')) {
  91.     $result = PMA_mysql_query('FLUSH PRIVILEGES'); // Debug: or PMA_mysqlDie('', 'FLUSH PRIVILEGES', FALSE, 'main.php?' . PMA_generate_common_url());
  92.     echo '<p><b>';
  93.     if ($result != 0) {
  94.       echo $strMySQLReloaded;
  95.     } else {
  96.       echo $strReloadFailed;
  97.     }
  98.     echo '</b></p>' . "\n\n";
  99. }
  100.  
  101.  
  102. /**
  103.  * Displays the MySQL servers choice form
  104.  */
  105. if ($server == 0 || count($cfg['Servers']) > 1) {
  106.     ?>
  107. <!-- MySQL servers choice form -->
  108. <table>
  109. <tr>
  110.     <th><?php echo $strServerChoice; ?></th>
  111. </tr>
  112. <tr>
  113.     <td>
  114.         <form method="post" action="index.php" target="_parent">
  115.             <select name="server">
  116.     <?php
  117.     echo "\n";
  118.     foreach($cfg['Servers'] AS $key => $val) {
  119.         if (!empty($val['host'])) {
  120.             echo '                <option value="' . $key . '"';
  121.             if (!empty($server) && ($server == $key)) {
  122.                 echo ' selected="selected"';
  123.             }
  124.             echo '>';
  125.             if (!empty($val['verbose'])) {
  126.                 echo $val['verbose'];
  127.             } else {
  128.                 echo $val['host'];
  129.                 if (!empty($val['port'])) {
  130.                     echo ':' . $val['port'];
  131.                 }
  132.             }
  133.             // loic1: if 'only_db' is an array and there is more than one
  134.             //        value, displaying such informations may not be a so good
  135.             //        idea
  136.             if (!empty($val['only_db'])) {
  137.                 echo ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']);
  138.             }
  139.             if (!empty($val['user']) && ($val['auth_type'] == 'config')) {
  140.                 echo '  (' . $val['user'] . ')';
  141.             }
  142.             echo ' </option>' . "\n";
  143.         } // end if (!empty($val['host']))
  144.     } // end while
  145.     ?>
  146.             </select>
  147.             <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
  148.             <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
  149.             <input type="submit" value="<?php echo $strGo; ?>" />
  150.         </form>
  151.     </td>
  152. </tr>
  153. </table>
  154. <br />
  155.     <?php
  156. } // end of the servers choice form
  157. ?>
  158.  
  159. <!-- MySQL and phpMyAdmin related links -->
  160. <table>
  161. <tr>
  162.  
  163. <?php
  164. /**
  165.  * Displays the mysql server related links
  166.  */
  167. $is_superuser        = FALSE;
  168. if ($server > 0) {
  169.     // Get user's global privileges ($dbh and $userlink are links to MySQL
  170.     // defined in the "common.lib.php" library)
  171.     // Note: if no controluser is defined, $dbh contains $userlink
  172.  
  173.     $is_create_priv  = FALSE;
  174.     $is_process_priv = TRUE;
  175.     $is_reload_priv  = FALSE;
  176.  
  177. // We were checking privileges with 'USE mysql' but users with the global
  178. // priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
  179. // (even if they cannot see the tables)
  180.     $is_superuser    = @PMA_mysql_query('SELECT COUNT(*) FROM mysql.user', $userlink);
  181.     if ($dbh) {
  182.         $local_query = 'SELECT Create_priv, Process_priv, Reload_priv FROM mysql.user WHERE User = \'' . PMA_sqlAddslashes($mysql_cur_user) . '\'';
  183.         $rs_usr      = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
  184.         if ($rs_usr) {
  185.             while ($result_usr = PMA_mysql_fetch_array($rs_usr)) {
  186.                 if (!$is_create_priv) {
  187.                     $is_create_priv  = ($result_usr['Create_priv'] == 'Y');
  188.                 }
  189.                 /* 02-12-09 rabus: Every user has access to the process list -
  190.                                    at least to its own :-)
  191.                 if (!$is_process_priv) {
  192.                     $is_process_priv = ($result_usr['Process_priv'] == 'Y');
  193.                 }
  194.                 */
  195.                 if (!$is_reload_priv) {
  196.                     $is_reload_priv  = ($result_usr['Reload_priv'] == 'Y');
  197.                 }
  198.             } // end while
  199.             mysql_free_result($rs_usr);
  200.         } // end if
  201.     } // end if
  202.     // If the user has Create priv on a inexistant db, show him in the dialog
  203.     // the first inexistant db name that we find, in most cases it's probably
  204.     // the one he just dropped :)
  205.     if (!$is_create_priv) {
  206.         $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = \'Y\' AND User = \'' . PMA_sqlAddslashes($mysql_cur_user) . '\'';
  207.         $rs_usr      = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
  208.         if ($rs_usr) {
  209.             $re0     = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards
  210.             $re1     = '(^|[^\])(\\\)+';       // escaped wildcards
  211.             while ($row = PMA_mysql_fetch_array($rs_usr)) {
  212.                 if (ereg($re0 . '(%|_)', $row['Db'])
  213.                     || (!PMA_mysql_select_db(ereg_replace($re1 . '(%|_)', '\\1\\3', $row['Db']), $userlink) && @mysql_errno() != 1044)) {
  214.                     $db_to_create   = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $row['Db']));
  215.                     $db_to_create   = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
  216.                     $is_create_priv = TRUE;
  217.                     break;
  218.                 } // end if
  219.             } // end while
  220.             mysql_free_result($rs_usr);
  221.         } // end if
  222.         else {
  223.             // Finally, let's try to get the user's privileges by using SHOW
  224.             // GRANTS...
  225.             // Maybe we'll find a little CREATE priv there :)
  226.             $local_query = 'SHOW GRANTS FOR ' . $mysql_cur_user_and_host;
  227.             $rs_usr      = PMA_mysql_query($local_query, $dbh);
  228.             if (!$rs_usr) {
  229.                 // OK, now we'd have to guess the user's hostname, but we
  230.                 // only try out the 'username'@'%' case.
  231.                 $local_query = 'SHOW GRANTS FOR ' . $mysql_cur_user;
  232.                 $rs_usr      = PMA_mysql_query($local_query, $dbh);
  233.             }
  234.             if ($rs_usr) {
  235.                 $re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards
  236.                 $re1 = '(^|[^\])(\\\)+'; // escaped wildcards
  237.                 while ($row = PMA_mysql_fetch_row($rs_usr)) {
  238.                     $show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4,(strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4));
  239.                     $show_grants_str    = substr($row[0],6,(strpos($row[0],' ON ')-6));
  240.                     if (($show_grants_str == 'ALL') || ($show_grants_str == 'ALL PRIVILEGES') || ($show_grants_str == 'CREATE') || strpos($show_grants_str, 'CREATE')) {
  241.                         if ($show_grants_dbname == '*') {
  242.                             $is_create_priv = TRUE;
  243.                             $db_to_create   = '';
  244.                             break;
  245.                         } // end if
  246.                         else if (ereg($re0 . '%|_', $show_grants_dbname) || !PMA_mysql_select_db($show_grants_dbname, $userlink) && @mysql_errno() != 1044) {
  247.                             $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
  248.                             $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
  249.                             // and remove backquotes
  250.                             $db_to_create = str_replace('`','',$db_to_create);
  251.                             $is_create_priv     = TRUE;
  252.                             break;
  253.                         } // end elseif
  254.                     } // end if
  255.                 } // end while
  256.                 unset($show_grants_dbname, $show_grants_str);
  257.                 mysql_free_result($rs_usr);
  258.             } // end if
  259.         } // end elseif
  260.     } // end if
  261.     else {
  262.         $db_to_create = '';
  263.     } // end else
  264.  
  265.     if (!$cfg['SuggestDBName']) {
  266.         $db_to_create = '';
  267.     }
  268.  
  269.     $common_url_query =  PMA_generate_common_url();
  270.  
  271.     if ($is_superuser) {
  272.         $cfg['ShowMysqlInfo']   = TRUE;
  273.         $cfg['ShowMysqlVars']   = TRUE;
  274.         $cfg['ShowChgPassword'] = TRUE;
  275.     }
  276.     if ($cfg['Server']['auth_type'] == 'config') {
  277.         $cfg['ShowChgPassword'] = FALSE;
  278.     }
  279.  
  280.     // loic1: Displays the MySQL column only if at least one feature has to be
  281.     //        displayed
  282.     if ($is_superuser || $is_create_priv || $is_process_priv || $is_reload_priv
  283.         || $cfg['ShowMysqlInfo'] || $cfg['ShowMysqlVars'] || $cfg['ShowChgPassword']
  284.         || $cfg['Server']['auth_type'] != 'config') {
  285.         ?>
  286.     <!-- MySQL server related links -->
  287.     <td valign="top" align="<?php echo $cell_align_left; ?>">
  288.         <table>
  289.         <tr>
  290.             <th colspan="2">  MySQL</th>
  291.         </tr>
  292.         <?php
  293.         // The user is allowed to create a db
  294.         if ($is_create_priv) {
  295.             echo "\n"
  296.                . '        <!-- db creation form -->' . "\n"
  297.                . '        <tr>' . "\n"
  298.                . '            <td valign="baseline"><img src="' . $item_img . '" width="7" height="7" alt="item" /></td>' . "\n"
  299.                . '            <td>' . "\n"
  300.                . '                <form method="post" action="db_create.php">' . "\n"
  301.                . '                    ' . $strCreateNewDatabase . ' ' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE') . "\n"
  302.                . '<br />' . "\n"
  303.                . PMA_generate_common_hidden_inputs(5)
  304.                . '                    <input type="hidden" name="reload" value="1" />' . "\n"
  305.                . '                    <input type="text" name="db" value="' . $db_to_create . '" maxlength="64" class="textfield" />' . "\n";
  306.  
  307.             if (PMA_MYSQL_INT_VERSION >= 40101) {
  308.                 require_once('./libraries/mysql_charsets.lib.php');
  309.                 echo '                    <select name="db_charset">' . "\n"
  310.                    . '                        <option value="">' . $strCharset . '</option>' . "\n"
  311.                    . '                        <option value=""></option>' . "\n";
  312.                 for ($i = 0; isset($mysql_charsets[$i]); $i++) {
  313.                     echo '                        <option value="' . htmlspecialchars($mysql_charsets[$i]) . '">' . htmlspecialchars($mysql_charsets[$i]) . '</option>' . "\n";
  314.                 }
  315.                 echo '                    </select>' . "\n";
  316.             }
  317.             echo '                    <input type="submit" value="' . $strCreate . '" />' . "\n"
  318.                . '                </form>' . "\n"
  319.                . '            </td>' . "\n"
  320.                . '        </tr>' . "\n";
  321.         } else {
  322.             echo "\n";
  323.             ?>
  324.         <!-- db creation no privileges message -->
  325.         <tr>
  326.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  327.             <td>
  328.                 <?php echo $strCreateNewDatabase . ': ' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE'); ?><br />
  329.                 <?php echo '<i>' . $strNoPrivileges .'</i>'; ?><br />
  330.             </td>
  331.         </tr>
  332.             <?php
  333.         } // end create db form or message
  334.         echo "\n";
  335.  
  336.         // Server related links
  337.         ?>
  338.         <!-- server-related links -->
  339.         <?php
  340.         if ($cfg['ShowMysqlInfo']) {
  341.             echo "\n";
  342.             ?>
  343.         <tr>
  344.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  345.             <td>
  346.                 <a href="./server_status.php?<?php echo $common_url_query; ?>">
  347.                     <?php echo $strMySQLShowStatus . "\n"; ?>
  348.                 </a>
  349.             </td>
  350.         </tr>
  351.             <?php
  352.         } // end if
  353.         if ($cfg['ShowMysqlVars']) {
  354.             echo "\n";
  355.             ?>
  356.         <tr>
  357.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  358.             <td>
  359.                 <a href="./server_variables.php?<?php echo $common_url_query; ?>">
  360.                 <?php echo $strMySQLShowVars;?></a> 
  361.                 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'SHOW_VARIABLES') . "\n"; ?>
  362.             </td>
  363.         </tr>
  364.             <?php
  365.         }
  366.  
  367.         echo "\n";
  368.         ?>
  369.         <tr>
  370.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  371.             <td>
  372.                 <a href="./server_processlist.php?<?php echo $common_url_query; ?>">
  373.                     <?php echo $strMySQLShowProcess; ?></a> 
  374.                 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'SHOW_PROCESSLIST') . "\n"; ?>
  375.             </td>
  376.         </tr>
  377.         <?php
  378.  
  379.         if (PMA_MYSQL_INT_VERSION >= 40100) {
  380.             echo "\n";
  381.             ?>
  382.         <tr>
  383.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  384.             <td>
  385.                 <a href="./server_collations.php?<?php echo $common_url_query; ?>">
  386.                     <?php echo $strCharsetsAndCollations; ?></a> 
  387.             </td>
  388.         </tr>
  389.             <?php
  390.         }
  391.  
  392.         if ($is_reload_priv) {
  393.             echo "\n";
  394.             ?>
  395.         <tr>
  396.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  397.             <td>
  398.                 <a href="main.php?<?php echo $common_url_query; ?>&mode=reload">
  399.                     <?php echo $strReloadMySQL; ?></a> 
  400.                 <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH') . "\n"; ?>
  401.             </td>
  402.         </tr>
  403.             <?php
  404.         }
  405.  
  406.         if ($is_superuser) {
  407.             echo "\n";
  408.             ?>
  409.         <tr>
  410.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  411.             <td>
  412.                 <a href="server_privileges.php?<?php echo $common_url_query; ?>">
  413.                     <?php echo $strPrivileges; ?></a> 
  414.             </td>
  415.         </tr>
  416.             <?php
  417.         }
  418.         ?>
  419.         <tr>
  420.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  421.             <td>
  422.                 <a href="./server_databases.php?<?php echo $common_url_query; ?>">
  423.                     <?php echo $strDatabases; ?></a>
  424.             </td>
  425.         </tr>
  426.         <tr>
  427.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  428.             <td>
  429.                 <a href="./server_export.php?<?php echo $common_url_query; ?>">
  430.                     <?php echo $strExport; ?></a>
  431.             </td>
  432.         </tr>
  433.         <?php
  434.  
  435.         // Change password (needs another message)
  436.         if ($cfg['ShowChgPassword']) {
  437.             echo "\n";
  438.             ?>
  439.         <tr>
  440.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  441.             <td>
  442.                 <a href="user_password.php?<?php echo $common_url_query; ?>">
  443.                     <?php echo ($strChangePassword); ?></a>
  444.             </td>
  445.         </tr>
  446.             <?php
  447.         } // end if
  448.  
  449.         // Logout for advanced authentication
  450.         if ($cfg['Server']['auth_type'] != 'config') {
  451.             $http_logout = ($cfg['Server']['auth_type'] == 'http')
  452.                          ? "\n" . '                <a href="./Documentation.html#login_bug" target="documentation">(*)</a>'
  453.                          : '';
  454.             echo "\n";
  455.             ?>
  456.         <tr>
  457.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  458.             <td>
  459.                 <a href="index.php?<?php echo $common_url_query; ?>&old_usr=<?php echo urlencode($PHP_AUTH_USER); ?>" target="_parent">
  460.                     <b><?php echo $strLogout; ?></b></a> <?php echo $http_logout . "\n"; ?>
  461.             </td>
  462.         </tr>
  463.             <?php
  464.         } // end if
  465.         echo "\n";
  466.         ?>
  467.         </table>
  468.     </td>
  469.  
  470.     <td>    </td>
  471.         <?php
  472.     } // end if
  473. } // end of if ($server > 0)
  474. echo "\n";
  475.  
  476.  
  477. /**
  478.  * Displays the phpMyAdmin related links
  479.  */
  480. ?>
  481.  
  482.     <!-- phpMyAdmin related links -->
  483.     <td valign="top" align="<?php echo $cell_align_left; ?>">
  484.         <table>
  485.         <tr>
  486.             <th colspan="2">  phpMyAdmin</th>
  487.         </tr>
  488.  
  489. <?php
  490. // Displays language selection combo
  491. if (empty($cfg['Lang'])) {
  492.     ?>
  493.         <!-- Language Selection -->
  494.         <tr>
  495.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  496.             <td nowrap="nowrap">
  497.                 <form method="post" action="index.php" target="_parent">
  498.                     <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
  499.                     <input type="hidden" name="server" value="<?php echo $server; ?>" />
  500.                     Language <a href="./translators.html" target="documentation">(*)</a>:
  501.                     <select name="lang" dir="ltr" onchange="this.form.submit();">
  502.     <?php
  503.     echo "\n";
  504.  
  505.     /**
  506.      * Sorts available languages by their true names
  507.      *
  508.      * @param   array   the array to be sorted
  509.      * @param   mixed   a required parameter
  510.      *
  511.      * @return  the sorted array
  512.      *
  513.      * @access  private
  514.      */
  515.     function PMA_cmp(&$a, $b)
  516.     {
  517.         return (strcmp($a[1], $b[1]));
  518.     } // end of the 'PMA_cmp()' function
  519.  
  520.     uasort($available_languages, 'PMA_cmp');
  521.     foreach($available_languages AS $id => $tmplang) {
  522.         $lang_name = ucfirst(substr(strstr($tmplang[0], '|'), 1));
  523.         if ($lang == $id) {
  524.             $selected = ' selected="selected"';
  525.         } else {
  526.             $selected = '';
  527.         }
  528.         echo '                        ';
  529.         echo '<option value="' . $id . '"' . $selected . '>' . $lang_name . ' (' . $id . ')</option>' . "\n";
  530.     }
  531.     ?>
  532.                     </select>
  533.                     <noscript><input type="submit" value="Go" /></noscript>
  534.                 </form>
  535.             </td>
  536.         </tr>
  537.     <?php
  538. }
  539.  
  540. if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
  541.     && $allow_recoding) {
  542.     echo "\n";
  543.     ?>
  544.         <!-- Charset Selection -->
  545.         <tr>
  546.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  547.             <td nowrap="nowrap">
  548.                 <form method="post" action="index.php" target="_parent">
  549.                     <input type="hidden" name="server" value="<?php echo $server; ?>" />
  550.                     <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
  551.                     <?php echo $strMySQLCharset;?>:
  552.                     <select name="convcharset" dir="ltr" onchange="this.form.submit();">
  553.     <?php
  554.     echo "\n";
  555.     foreach($cfg['AvailableCharsets'] AS $id => $tmpcharset) {
  556.         if ($convcharset == $tmpcharset) {
  557.             $selected = ' selected="selected"';
  558.         } else {
  559.             $selected = '';
  560.         }
  561.         echo '                        '
  562.            . '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
  563.     }
  564.     ?>
  565.                     </select>
  566.                     <noscript><input type="submit" value="Go" /></noscript>
  567.                 </form>
  568.             </td>
  569.         </tr>
  570.     <?php
  571. }
  572. echo "\n";
  573. ?>
  574.  
  575.         <!-- Documentation -->
  576.         <tr>
  577.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  578.             <td>
  579.                 <a href="Documentation.html" target="documentation"><b><?php echo $strPmaDocumentation; ?></b></a>
  580.             </td>
  581.         </tr>
  582.  
  583. <?php
  584. if ($is_superuser || $cfg['ShowPhpInfo']) {
  585.     ?>
  586.         <!-- PHP Information -->
  587.         <tr>
  588.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  589.             <td>
  590.                 <a href="phpinfo.php?<?php echo PMA_generate_common_url(); ?>" target="_blank"><?php echo $strShowPHPInfo; ?></a>
  591.             </td>
  592.         </tr>
  593.     <?php
  594. }
  595. echo "\n";
  596. ?>
  597.  
  598.         <!-- phpMyAdmin related urls -->
  599.         <tr>
  600.             <td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
  601.             <td>
  602.                 <a href="http://www.phpMyAdmin.net/" target="_blank"><?php echo $strHomepageOfficial; ?></a><br />
  603.                       [<a href="ChangeLog" target="_blank">ChangeLog</a>]
  604.                    [<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmyadmin/phpMyAdmin/" target="_blank">CVS</a>]
  605.                    [<a href="http://sourceforge.net/mail/?group_id=23067" target="_blank">Lists</a>]
  606.             </td>
  607.         </tr>
  608.         </table>
  609.     </td>
  610.  
  611. </tr>
  612. </table>
  613.  
  614.  
  615. <?php
  616. /**
  617.  * Displays the "empty $cfg['PmaAbsoluteUri'] warning"
  618.  */
  619. if ($display_pmaAbsoluteUri_warning) {
  620.     echo '<p class="warning">' . $strPmaUriError . '</p>' . "\n";
  621. }
  622.  
  623. /**
  624.  * Warning if using the default MySQL privileged account
  625.  */
  626. if ($server != 0
  627.     && $cfg['Server']['user'] == 'root'
  628.     && $cfg['Server']['password'] == '') {
  629.     echo '<p class="warning">' . $strInsecureMySQL . '</p>' . "\n";
  630. }
  631.  
  632. /**
  633.  * Warning for PHP 4.2.3
  634.  */
  635.  
  636. if (PMA_PHP_INT_VERSION == 40203 && @extension_loaded('mbstring')) {
  637.     echo '<p class="warning">' . $strPHP40203 . '</p>' . "\n";
  638. }
  639.  
  640. /**
  641.  * Warning for old PHP version
  642.  */
  643.  
  644. if (PMA_PHP_INT_VERSION < 40100) {
  645.     echo '<p class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.0') . '</p>' . "\n";
  646. }
  647.  
  648. /**
  649.  * Warning for old MySQL version
  650.  */
  651.  
  652. // not yet defined before the server choice
  653. if (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION < 32332) {
  654.     echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</p>' . "\n";
  655. }
  656.  
  657. /**
  658.  * Displays the footer
  659.  */
  660. echo "\n";
  661. require_once('./footer.inc.php');
  662. ?>
  663.