Translated using Weblate (Polish)
[phpmyadmin.git] / schema_export.php
blobd09d08c022e1b90ce5fbf10d8486fb49a2668ca1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
9 * Gets some core libraries
11 require_once 'libraries/common.inc.php';
12 require 'libraries/StorageEngine.class.php';
14 /**
15 * Validate vulnerable POST parameters
17 if (! PMA_isValid($_POST['pdf_page_number'], 'numeric')) {
18 die('Attack stopped');
21 /**
22 * get all variables needed for exporting relational schema
23 * in $cfgRelation
25 $cfgRelation = PMA_getRelationsParam();
27 require_once 'libraries/transformations.lib.php';
28 require_once 'libraries/Index.class.php';
29 require_once 'libraries/schema/Export_Relation_Schema.class.php';
31 /**
32 * get all the export options and verify
33 * call and include the appropriate Schema Class depending on $export_type
34 * default is PDF
37 $post_params = array(
38 'all_tables_same_width',
39 'chpage',
40 'db',
41 'do',
42 'export_type',
43 'orientation',
44 'paper',
45 'names',
46 'pdf_page_number',
47 'show_color',
48 'show_grid',
49 'show_keys',
50 'show_table_dimension',
51 'with_doc'
53 foreach ($post_params as $one_post_param) {
54 if (isset($_POST[$one_post_param])) {
55 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
59 if (! isset($export_type) || ! preg_match('/^[a-zA-Z]+$/', $export_type)) {
60 $export_type = 'pdf';
62 PMA_DBI_select_db($db);
64 $path = PMA_securePath(ucfirst($export_type));
65 if (!file_exists('libraries/schema/' . $path . '_Relation_Schema.class.php')) {
66 PMA_Export_Relation_Schema::dieSchema(
67 $_POST['chpage'],
68 $export_type,
69 __('File doesn\'t exist')
72 require "libraries/schema/".$path.'_Relation_Schema.class.php';
73 $obj_schema = eval("new PMA_".$path."_Relation_Schema();");