index.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Front controller for setup script
  5. *
  6. * @package PhpMyAdmin-Setup
  7. * @license https://www.gnu.org/licenses/gpl.html GNU GPL 2.0
  8. */
  9. use PhpMyAdmin\Core;
  10. /**
  11. * Core libraries.
  12. */
  13. require './lib/common.inc.php';
  14. if (@file_exists(CONFIG_FILE) && ! $cfg['DBG']['demo']) {
  15. Core::fatalError(__('Configuration already exists, setup is disabled!'));
  16. }
  17. $page = Core::isValid($_GET['page'], 'scalar') ? $_GET['page'] : null;
  18. $page = preg_replace('/[^a-z]/', '', $page);
  19. if ($page === '') {
  20. $page = 'index';
  21. }
  22. if (!@file_exists("./setup/frames/$page.inc.php")) {
  23. // it will happen only when entering URL by hand, we don't care for these cases
  24. Core::fatalError(__('Wrong GET file attribute value'));
  25. }
  26. // Handle done action info
  27. $action_done = Core::isValid($_GET['action_done'], 'scalar') ? $_GET['action_done'] : null;
  28. $action_done = preg_replace('/[^a-z_]/', '', $action_done);
  29. Core::noCacheHeader();
  30. ?>
  31. <!DOCTYPE HTML>
  32. <html xmlns="http://www.w3.org/1999/xhtml">
  33. <head>
  34. <meta charset="utf-8" />
  35. <title>phpMyAdmin setup</title>
  36. <link href="../favicon.ico" rel="icon" type="image/x-icon" />
  37. <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />
  38. <link href="styles.css" rel="stylesheet" type="text/css" />
  39. <script type="text/javascript" src="../js/vendor/jquery/jquery.min.js"></script>
  40. <script type="text/javascript" src="../js/vendor/jquery/jquery-ui.min.js">
  41. </script>
  42. <script type="text/javascript" src="ajax.js"></script>
  43. <script type="text/javascript" src="../js/config.js"></script>
  44. <script type="text/javascript" src="scripts.js"></script>
  45. <script type="text/javascript" src="../js/messages.php"></script>
  46. </head>
  47. <body>
  48. <h1><span class="blue">php</span><span class="orange">MyAdmin</span> setup</h1>
  49. <div id="menu">
  50. <?php
  51. require './setup/frames/menu.inc.php';
  52. ?>
  53. </div>
  54. <div id="page">
  55. <?php
  56. require "./setup/frames/$page.inc.php";
  57. ?>
  58. </div>
  59. </body>
  60. </html>