Define headers which to trust in configuration, thanks for help with this to Christia...
[phpmyadmin/crack.git] / pmd_save_pos.php
blob6a71e31e2d75a7f1ee750df2aad6a1c529fc2773
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 include_once 'pmd_session.php';
6 require_once './libraries/relation.lib.php';
7 PMA_getRelationsParam();
9 $alltab_rs = PMA_query_as_cu('SHOW TABLES FROM '.PMA_backquote($cfg['Server']['pmadb']),FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav();
11 $seen_pmd_table = false;
12 while ($tab_name = @PMA_DBI_fetch_row($alltab_rs)) {
13 if (stristr($tab_name[0],$GLOBALS['cfgRelation']['designer_coords'])) {
14 $seen_pmd_table = true;
15 break;
19 if ( ! $seen_pmd_table) {
20 PMD_err_sav();
23 foreach ($t_x as $key => $value) {
24 list($DB,$TAB) = explode(".", $key);
25 PMA_query_as_cu("DELETE FROM ".$GLOBALS['cfgRelation']['designer_coords']."
26 WHERE `db_name`='$DB' AND `table_name` = '$TAB'",FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav();
27 PMA_query_as_cu("INSERT INTO ".$GLOBALS['cfgRelation']['designer_coords']."
28 (db_name, table_name, x, y, v, h)
29 VALUES ('$DB','$TAB','$t_x[$key]','$t_y[$key]','$t_v[$key]','$t_h[$key]')",FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav();
31 //----------------------------------------------------------------------------
33 function PMD_err_sav() {
34 global $die_save_pos; // if this file included
35 if (! empty($die_save_pos)) {
36 die('<root act="save_pos" return="Problem on table ' . $GLOBALS['cfgRelation']['designer_coords'] . '"></root>');
40 if(! empty($die_save_pos)) {
42 <root act='save_pos' return='Saved!'></root>
43 <?