schema_export.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Schema export handler
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * Gets some core libraries
  10. */
  11. require_once 'libraries/common.inc.php';
  12. require 'libraries/StorageEngine.class.php';
  13. /**
  14. * Validate vulnerable POST parameters
  15. */
  16. if (! PMA_isValid($_POST['pdf_page_number'], 'numeric')) {
  17. die('Attack stopped');
  18. }
  19. /**
  20. * get all variables needed for exporting relational schema
  21. * in $cfgRelation
  22. */
  23. $cfgRelation = PMA_getRelationsParam();
  24. require_once 'libraries/transformations.lib.php';
  25. require_once 'libraries/Index.class.php';
  26. require_once 'libraries/schema/User_Schema.class.php';
  27. /**
  28. * get all the export options and verify
  29. * call and include the appropriate Schema Class depending on $export_type
  30. * default is PDF
  31. */
  32. $post_params = array(
  33. 'all_tables_same_width',
  34. 'chpage',
  35. 'db',
  36. 'do',
  37. 'export_type',
  38. 'orientation',
  39. 'paper',
  40. 'names',
  41. 'pdf_page_number',
  42. 'show_color',
  43. 'show_grid',
  44. 'show_keys',
  45. 'show_table_dimension',
  46. 'with_doc'
  47. );
  48. foreach ($post_params as $one_post_param) {
  49. if (isset($_POST[$one_post_param])) {
  50. $GLOBALS[$one_post_param] = $_POST[$one_post_param];
  51. }
  52. }
  53. $user_schema = new PMA_User_Schema();
  54. /**
  55. * This function will process the user defined pages
  56. * and tables which will be exported as Relational schema
  57. * you can set the table positions on the paper via scratchboard
  58. * for table positions, put the x,y co-ordinates
  59. *
  60. * @param string $do It tells what the Schema is supposed to do
  61. * create and select a page, generate schema etc
  62. */
  63. if (isset($_REQUEST['do'])) {
  64. $user_schema->setAction($_REQUEST['do']);
  65. $user_schema->processUserChoice();
  66. }