import.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Core script for import, this is just the glue around all other stuff
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /* Enable LOAD DATA LOCAL INFILE for LDI plugin */
  9. if (isset($_POST['format']) && $_POST['format'] == 'ldi') {
  10. define('PMA_ENABLE_LDI', 1);
  11. }
  12. /**
  13. * Get the variables sent or posted to this script and a core script
  14. */
  15. require_once 'libraries/common.inc.php';
  16. //require_once 'libraries/display_import_functions.lib.php';
  17. if (isset($_REQUEST['show_as_php'])) {
  18. $GLOBALS['show_as_php'] = $_REQUEST['show_as_php'];
  19. }
  20. /**
  21. * Sets globals from $_POST
  22. */
  23. $post_params = array(
  24. 'action_bookmark',
  25. 'allow_interrupt',
  26. 'bkm_label',
  27. 'bookmark_variable',
  28. 'charset_of_file',
  29. 'format',
  30. 'id_bookmark',
  31. 'import_type',
  32. 'is_js_confirmed',
  33. 'MAX_FILE_SIZE',
  34. 'message_to_show',
  35. 'noplugin',
  36. 'skip_queries',
  37. 'local_import_file'
  38. );
  39. // TODO: adapt full list of allowed parameters, as in export.php
  40. foreach ($post_params as $one_post_param) {
  41. if (isset($_POST[$one_post_param])) {
  42. $GLOBALS[$one_post_param] = $_POST[$one_post_param];
  43. }
  44. }
  45. // reset import messages for ajax request
  46. $_SESSION['Import_message']['message'] = null;
  47. $_SESSION['Import_message']['go_back_url'] = null;
  48. // default values
  49. $GLOBALS['reload'] = false;
  50. // Use to identify curren cycle is executing
  51. // a multiquery statement or stored routine
  52. if (!isset($_SESSION['is_multi_query'])) {
  53. $_SESSION['is_multi_query'] = false;
  54. }
  55. // Are we just executing plain query or sql file?
  56. // (eg. non import, but query box/window run)
  57. if (! empty($sql_query)) {
  58. // run SQL query
  59. $import_text = $sql_query;
  60. $import_type = 'query';
  61. $format = 'sql';
  62. // refresh navigation and main panels
  63. if (preg_match('/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
  64. $GLOBALS['reload'] = true;
  65. }
  66. // refresh navigation panel only
  67. if (preg_match('/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
  68. $ajax_reload['reload'] = true;
  69. }
  70. // do a dynamic reload if table is RENAMED
  71. // (by sending the instruction to the AJAX response handler)
  72. if (preg_match('/^RENAME\s+TABLE\s+(.*?)\s+TO\s+(.*?)($|;|\s)/i', $sql_query, $rename_table_names)) {
  73. $ajax_reload['table_name'] = PMA_Util::unQuote($rename_table_names[2]);
  74. $ajax_reload['reload'] = true;
  75. }
  76. $sql_query = '';
  77. } elseif (! empty($sql_localfile)) {
  78. // run SQL file on server
  79. $local_import_file = $sql_localfile;
  80. $import_type = 'queryfile';
  81. $format = 'sql';
  82. unset($sql_localfile);
  83. } elseif (! empty($sql_file)) {
  84. // run uploaded SQL file
  85. $import_file = $sql_file;
  86. $import_type = 'queryfile';
  87. $format = 'sql';
  88. unset($sql_file);
  89. } elseif (! empty($id_bookmark)) {
  90. // run bookmark
  91. $import_type = 'query';
  92. $format = 'sql';
  93. }
  94. // If we didn't get any parameters, either user called this directly, or
  95. // upload limit has been reached, let's assume the second possibility.
  96. ;
  97. if ($_POST == array() && $_GET == array()) {
  98. $message = PMA_Message::error(
  99. __('You probably tried to upload a file that is too large. Please refer to %sdocumentation%s for a workaround for this limit.')
  100. );
  101. $message->addParam('[doc@faq1-16]');
  102. $message->addParam('[/doc]');
  103. // so we can obtain the message
  104. $_SESSION['Import_message']['message'] = $message->getDisplay();
  105. $_SESSION['Import_message']['go_back_url'] = $goto;
  106. $message->display();
  107. exit; // the footer is displayed automatically
  108. }
  109. /**
  110. * Sets globals from $_POST patterns, for import plugins
  111. * We only need to load the selected plugin
  112. */
  113. if (! in_array(
  114. $format,
  115. array(
  116. 'csv',
  117. 'ldi',
  118. 'mediawiki',
  119. 'ods',
  120. 'shp',
  121. 'sql',
  122. 'xml'
  123. )
  124. )
  125. ) {
  126. // this should not happen for a normal user
  127. // but only during an attack
  128. PMA_fatalError('Incorrect format parameter');
  129. }
  130. $post_patterns = array(
  131. '/^force_file_/',
  132. '/^'. $format . '_/'
  133. );
  134. foreach (array_keys($_POST) as $post_key) {
  135. foreach ($post_patterns as $one_post_pattern) {
  136. if (preg_match($one_post_pattern, $post_key)) {
  137. $GLOBALS[$post_key] = $_POST[$post_key];
  138. }
  139. }
  140. }
  141. // Check needed parameters
  142. PMA_Util::checkParameters(array('import_type', 'format'));
  143. // We don't want anything special in format
  144. $format = PMA_securePath($format);
  145. // Import functions
  146. require_once 'libraries/import.lib.php';
  147. // Create error and goto url
  148. if ($import_type == 'table') {
  149. $err_url = 'tbl_import.php?' . PMA_generate_common_url($db, $table);
  150. $_SESSION['Import_message']['go_back_url'] = $err_url;
  151. $goto = 'tbl_import.php';
  152. } elseif ($import_type == 'database') {
  153. $err_url = 'db_import.php?' . PMA_generate_common_url($db);
  154. $_SESSION['Import_message']['go_back_url'] = $err_url;
  155. $goto = 'db_import.php';
  156. } elseif ($import_type == 'server') {
  157. $err_url = 'server_import.php?' . PMA_generate_common_url();
  158. $_SESSION['Import_message']['go_back_url'] = $err_url;
  159. $goto = 'server_import.php';
  160. } else {
  161. if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
  162. if (strlen($table) && strlen($db)) {
  163. $goto = 'tbl_structure.php';
  164. } elseif (strlen($db)) {
  165. $goto = 'db_structure.php';
  166. } else {
  167. $goto = 'server_sql.php';
  168. }
  169. }
  170. if (strlen($table) && strlen($db)) {
  171. $common = PMA_generate_common_url($db, $table);
  172. } elseif (strlen($db)) {
  173. $common = PMA_generate_common_url($db);
  174. } else {
  175. $common = PMA_generate_common_url();
  176. }
  177. $err_url = $goto . '?' . $common
  178. . (preg_match('@^tbl_[a-z]*\.php$@', $goto)
  179. ? '&amp;table=' . htmlspecialchars($table)
  180. : '');
  181. $_SESSION['Import_message']['go_back_url'] = $err_url;
  182. }
  183. if (strlen($db)) {
  184. PMA_DBI_select_db($db);
  185. }
  186. @set_time_limit($cfg['ExecTimeLimit']);
  187. if (! empty($cfg['MemoryLimit'])) {
  188. @ini_set('memory_limit', $cfg['MemoryLimit']);
  189. }
  190. $timestamp = time();
  191. if (isset($allow_interrupt)) {
  192. $maximum_time = ini_get('max_execution_time');
  193. } else {
  194. $maximum_time = 0;
  195. }
  196. // set default values
  197. $timeout_passed = false;
  198. $error = false;
  199. $read_multiply = 1;
  200. $finished = false;
  201. $offset = 0;
  202. $max_sql_len = 0;
  203. $file_to_unlink = '';
  204. $sql_query = '';
  205. $sql_query_disabled = false;
  206. $go_sql = false;
  207. $executed_queries = 0;
  208. $run_query = true;
  209. $charset_conversion = false;
  210. $reset_charset = false;
  211. $bookmark_created = false;
  212. // Bookmark Support: get a query back from bookmark if required
  213. if (! empty($id_bookmark)) {
  214. $id_bookmark = (int)$id_bookmark;
  215. include_once 'libraries/bookmark.lib.php';
  216. switch ($action_bookmark) {
  217. case 0: // bookmarked query that have to be run
  218. $import_text = PMA_Bookmark_get(
  219. $db,
  220. $id_bookmark,
  221. 'id',
  222. isset($action_bookmark_all)
  223. );
  224. if (isset($bookmark_variable) && ! empty($bookmark_variable)) {
  225. $import_text = preg_replace(
  226. '|/\*(.*)\[VARIABLE\](.*)\*/|imsU',
  227. '${1}' . PMA_Util::sqlAddSlashes($bookmark_variable) . '${2}',
  228. $import_text
  229. );
  230. }
  231. // refresh navigation and main panels
  232. if (preg_match('/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $import_text)) {
  233. $GLOBALS['reload'] = true;
  234. }
  235. // refresh navigation panel only
  236. if (preg_match('/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $import_text)) {
  237. $ajax_reload['reload'] = true;
  238. }
  239. break;
  240. case 1: // bookmarked query that have to be displayed
  241. $import_text = PMA_Bookmark_get($db, $id_bookmark);
  242. if ($GLOBALS['is_ajax_request'] == true) {
  243. $message = PMA_Message::success(__('Showing bookmark'));
  244. $response = PMA_Response::getInstance();
  245. $response->isSuccess($message->isSuccess());
  246. $response->addJSON('message', $message);
  247. $response->addJSON('sql_query', $import_text);
  248. $response->addJSON('action_bookmark', $action_bookmark);
  249. exit;
  250. } else {
  251. $run_query = false;
  252. }
  253. break;
  254. case 2: // bookmarked query that have to be deleted
  255. $import_text = PMA_Bookmark_get($db, $id_bookmark);
  256. PMA_Bookmark_delete($db, $id_bookmark);
  257. if ($GLOBALS['is_ajax_request'] == true) {
  258. $message = PMA_Message::success(__('The bookmark has been deleted.'));
  259. $response = PMA_Response::getInstance();
  260. $response->isSuccess($message->isSuccess());
  261. $response->addJSON('message', $message);
  262. $response->addJSON('action_bookmark', $action_bookmark);
  263. $response->addJSON('id_bookmark', $id_bookmark);
  264. exit;
  265. } else {
  266. $run_query = false;
  267. $error = true; // this is kind of hack to skip processing the query
  268. }
  269. break;
  270. }
  271. } // end bookmarks reading
  272. // Do no run query if we show PHP code
  273. if (isset($GLOBALS['show_as_php'])) {
  274. $run_query = false;
  275. $go_sql = true;
  276. }
  277. // We can not read all at once, otherwise we can run out of memory
  278. $memory_limit = trim(@ini_get('memory_limit'));
  279. // 2 MB as default
  280. if (empty($memory_limit)) {
  281. $memory_limit = 2 * 1024 * 1024;
  282. }
  283. // In case no memory limit we work on 10MB chunks
  284. if ($memory_limit == -1) {
  285. $memory_limit = 10 * 1024 * 1024;
  286. }
  287. // Calculate value of the limit
  288. if (strtolower(substr($memory_limit, -1)) == 'm') {
  289. $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
  290. } elseif (strtolower(substr($memory_limit, -1)) == 'k') {
  291. $memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
  292. } elseif (strtolower(substr($memory_limit, -1)) == 'g') {
  293. $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
  294. } else {
  295. $memory_limit = (int)$memory_limit;
  296. }
  297. // Just to be sure, there might be lot of memory needed for uncompression
  298. $read_limit = $memory_limit / 8;
  299. // handle filenames
  300. if (isset($_FILES['import_file'])) {
  301. $import_file = $_FILES['import_file']['tmp_name'];
  302. }
  303. if (! empty($local_import_file) && ! empty($cfg['UploadDir'])) {
  304. // sanitize $local_import_file as it comes from a POST
  305. $local_import_file = PMA_securePath($local_import_file);
  306. $import_file = PMA_Util::userDir($cfg['UploadDir'])
  307. . $local_import_file;
  308. /*
  309. * Do not allow symlinks to avoid security issues
  310. * (user can create symlink to file he can not access,
  311. * but phpMyAdmin can).
  312. */
  313. if (is_link($import_file)) {
  314. $import_file = 'none';
  315. }
  316. } elseif (empty($import_file) || ! is_uploaded_file($import_file)) {
  317. $import_file = 'none';
  318. }
  319. // Do we have file to import?
  320. if ($import_file != 'none' && ! $error) {
  321. // work around open_basedir and other limitations
  322. $open_basedir = @ini_get('open_basedir');
  323. // If we are on a server with open_basedir, we must move the file
  324. // before opening it. The doc explains how to create the "./tmp"
  325. // directory
  326. if (! empty($open_basedir)) {
  327. $tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : 'tmp/');
  328. if (is_writable($tmp_subdir)) {
  329. $import_file_new = $tmp_subdir . basename($import_file) . uniqid();
  330. if (move_uploaded_file($import_file, $import_file_new)) {
  331. $import_file = $import_file_new;
  332. $file_to_unlink = $import_file_new;
  333. }
  334. $size = filesize($import_file);
  335. }
  336. }
  337. /**
  338. * Handle file compression
  339. * @todo duplicate code exists in File.class.php
  340. */
  341. $compression = PMA_detectCompression($import_file);
  342. if ($compression === false) {
  343. $message = PMA_Message::error(__('File could not be read'));
  344. $error = true;
  345. } else {
  346. switch ($compression) {
  347. case 'application/bzip2':
  348. if ($cfg['BZipDump'] && @function_exists('bzopen')) {
  349. $import_handle = @bzopen($import_file, 'r');
  350. } else {
  351. $message = PMA_Message::error(
  352. __('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
  353. );
  354. $message->addParam($compression);
  355. $error = true;
  356. }
  357. break;
  358. case 'application/gzip':
  359. if ($cfg['GZipDump'] && @function_exists('gzopen')) {
  360. $import_handle = @gzopen($import_file, 'r');
  361. } else {
  362. $message = PMA_Message::error(
  363. __('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
  364. );
  365. $message->addParam($compression);
  366. $error = true;
  367. }
  368. break;
  369. case 'application/zip':
  370. if ($cfg['ZipDump'] && @function_exists('zip_open')) {
  371. /**
  372. * Load interface for zip extension.
  373. */
  374. include_once 'libraries/zip_extension.lib.php';
  375. $result = PMA_getZipContents($import_file);
  376. if (! empty($result['error'])) {
  377. $message = PMA_Message::rawError($result['error']);
  378. $error = true;
  379. } else {
  380. $import_text = $result['data'];
  381. }
  382. } else {
  383. $message = PMA_Message::error(
  384. __('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
  385. );
  386. $message->addParam($compression);
  387. $error = true;
  388. }
  389. break;
  390. case 'none':
  391. $import_handle = @fopen($import_file, 'r');
  392. break;
  393. default:
  394. $message = PMA_Message::error(
  395. __('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
  396. );
  397. $message->addParam($compression);
  398. $error = true;
  399. break;
  400. }
  401. }
  402. // use isset() because zip compression type does not use a handle
  403. if (! $error && isset($import_handle) && $import_handle === false) {
  404. $message = PMA_Message::error(__('File could not be read'));
  405. $error = true;
  406. }
  407. } elseif (! $error) {
  408. if (! isset($import_text) || empty($import_text)) {
  409. $message = PMA_Message::error(
  410. __('No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].')
  411. );
  412. $error = true;
  413. }
  414. }
  415. // so we can obtain the message
  416. //$_SESSION['Import_message'] = $message->getDisplay();
  417. // Convert the file's charset if necessary
  418. if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file)) {
  419. if ($charset_of_file != 'utf-8') {
  420. $charset_conversion = true;
  421. }
  422. } elseif (isset($charset_of_file) && $charset_of_file != 'utf8') {
  423. if (PMA_DRIZZLE) {
  424. // Drizzle doesn't support other character sets,
  425. // so we can't fallback to SET NAMES - throw an error
  426. $error = true;
  427. $message = PMA_Message::error(
  428. __('Cannot convert file\'s character set without character set conversion library')
  429. );
  430. } else {
  431. PMA_DBI_query('SET NAMES \'' . $charset_of_file . '\'');
  432. // We can not show query in this case, it is in different charset
  433. $sql_query_disabled = true;
  434. $reset_charset = true;
  435. }
  436. }
  437. // Something to skip?
  438. if (! $error && isset($skip)) {
  439. $skip = intval($skip);
  440. $original_skip = $skip;
  441. while ($skip > 0 && ! $finished) {
  442. PMA_importGetNextChunk($skip < $read_limit ? $skip : $read_limit);
  443. // Disable read progresivity, otherwise we eat all memory!
  444. $read_multiply = 1;
  445. $skip -= $read_limit;
  446. }
  447. unset($skip);
  448. }
  449. // This array contain the data like numberof valid sql queries in the statement
  450. // and complete valid sql statement (which affected for rows)
  451. $sql_data = array('valid_sql' => array(), 'valid_queries' => 0);
  452. if (! $error) {
  453. // Check for file existance
  454. include_once "libraries/plugin_interface.lib.php";
  455. $import_plugin = PMA_getPlugin(
  456. "import",
  457. $format,
  458. 'libraries/plugins/import/',
  459. $import_type
  460. );
  461. if ($import_plugin == null) {
  462. $error = true;
  463. $message = PMA_Message::error(
  464. __('Could not load import plugins, please check your installation!')
  465. );
  466. } else {
  467. // Do the real import
  468. $import_plugin->doImport($sql_data);
  469. }
  470. }
  471. if (! $error && false !== $import_handle && null !== $import_handle) {
  472. fclose($import_handle);
  473. }
  474. // Cleanup temporary file
  475. if ($file_to_unlink != '') {
  476. unlink($file_to_unlink);
  477. }
  478. // Reset charset back, if we did some changes
  479. if ($reset_charset) {
  480. PMA_DBI_query('SET CHARACTER SET utf8');
  481. PMA_DBI_query(
  482. 'SET SESSION collation_connection =\'' . $collation_connection . '\''
  483. );
  484. }
  485. // Show correct message
  486. if (! empty($id_bookmark) && $action_bookmark == 2) {
  487. $message = PMA_Message::success(__('The bookmark has been deleted.'));
  488. $display_query = $import_text;
  489. $error = false; // unset error marker, it was used just to skip processing
  490. } elseif (! empty($id_bookmark) && $action_bookmark == 1) {
  491. $message = PMA_Message::notice(__('Showing bookmark'));
  492. } elseif ($bookmark_created) {
  493. $special_message = '[br]' . sprintf(
  494. __('Bookmark %s created'),
  495. htmlspecialchars($bkm_label)
  496. );
  497. } elseif ($finished && ! $error) {
  498. if ($import_type == 'query') {
  499. $message = PMA_Message::success();
  500. } else {
  501. if ($import_notice) {
  502. $message = PMA_Message::success(
  503. '<em>' . __('Import has been successfully finished, %d queries executed.') . '</em>'
  504. );
  505. $message->addParam($executed_queries);
  506. $message->addString($import_notice);
  507. if (isset($local_import_file)) {
  508. $message->addString('(' . $local_import_file . ')');
  509. } else {
  510. $message->addString('(' . $_FILES['import_file']['name'] . ')');
  511. }
  512. } else {
  513. $message = PMA_Message::success(
  514. __('Import has been successfully finished, %d queries executed.')
  515. );
  516. $message->addParam($executed_queries);
  517. if (isset($local_import_file)) {
  518. $message->addString('(' . $local_import_file . ')');
  519. } else {
  520. $message->addString('(' . $_FILES['import_file']['name'] . ')');
  521. }
  522. }
  523. }
  524. }
  525. // Did we hit timeout? Tell it user.
  526. if ($timeout_passed) {
  527. $message = PMA_Message::error(
  528. __('Script timeout passed, if you want to finish import, please resubmit same file and import will resume.')
  529. );
  530. if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) {
  531. $message->addString(
  532. __('However on last run no data has been parsed, this usually means phpMyAdmin won\'t be able to finish this import unless you increase php time limits.')
  533. );
  534. }
  535. }
  536. // if there is any message, copy it into $_SESSION as well,
  537. // so we can obtain it by AJAX call
  538. if (isset($message)) {
  539. $_SESSION['Import_message']['message'] = $message->getDisplay();
  540. }
  541. // Parse and analyze the query, for correct db and table name
  542. // in case of a query typed in the query window
  543. // (but if the query is too large, in case of an imported file, the parser
  544. // can choke on it so avoid parsing)
  545. if (strlen($sql_query) <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
  546. include_once 'libraries/parse_analyze.lib.php';
  547. }
  548. // There was an error?
  549. if (isset($my_die)) {
  550. foreach ($my_die AS $key => $die) {
  551. PMA_Util::mysqlDie(
  552. $die['error'], $die['sql'], '', $err_url, $error
  553. );
  554. }
  555. }
  556. // we want to see the results of the last query that returned at least a row
  557. if (! empty($last_query_with_results)) {
  558. // but we want to show intermediate results too
  559. $disp_query = $sql_query;
  560. $disp_message = __('Your SQL query has been executed successfully');
  561. $sql_query = $last_query_with_results;
  562. $go_sql = true;
  563. }
  564. if ($go_sql) {
  565. include 'sql.php';
  566. } else if ($result) {
  567. $response = PMA_Response::getInstance();
  568. $response->isSuccess(true);
  569. $response->addJSON('message', PMA_Message::success($msg));
  570. $response->addJSON('sql_query', PMA_Util::getMessage($msg, $sql_query, 'success'));
  571. } else if ($result == false) {
  572. $response = PMA_Response::getInstance();
  573. $response->isSuccess(false);
  574. $response->addJSON('message', PMA_Message::error($msg));
  575. } else {
  576. $active_page = $goto;
  577. include '' . $goto;
  578. }
  579. ?>