*/ require_once './libraries/relation.lib.php'; // free the session file, for the other frames to be loaded session_write_close(); // Gets the host name if (empty($HTTP_HOST)) { if (PMA_getenv('HTTP_HOST')) { $HTTP_HOST = PMA_getenv('HTTP_HOST'); } else { $HTTP_HOST = ''; } } // purge querywindow history $cfgRelation = PMA_getRelationsParam(); if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) { PMA_purgeHistory($GLOBALS['cfg']['Server']['user']); } unset($cfgRelation); /** * pass variables to child pages */ $drops = array('lang', 'server', 'convcharset', 'collation_connection', 'db', 'table'); foreach ($drops as $each_drop) { if (array_key_exists($each_drop, $_GET)) { unset($_GET[$each_drop]); } } unset($drops, $each_drop); if (!strlen($GLOBALS['db'])) { $main_target = $GLOBALS['cfg']['DefaultTabServer']; } elseif (!strlen($GLOBALS['table'])) {
/** * Set a SQL history entry * * @param string $db the name of the db * @param string $table the name of the table * @param string $username the username * @param string $sqlquery the sql query * * @return void * * @access public */ function PMA_setHistory($db, $table, $username, $sqlquery) { $maxCharactersInDisplayedSQL = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; // Prevent to run this automatically on Footer class destroying in testsuite if (defined('TESTSUITE') || mb_strlen($sqlquery) > $maxCharactersInDisplayedSQL) { return; } $cfgRelation = PMA_getRelationsParam(); if (!isset($_SESSION['sql_history'])) { $_SESSION['sql_history'] = array(); } $_SESSION['sql_history'][] = array('db' => $db, 'table' => $table, 'sqlquery' => $sqlquery); if (count($_SESSION['sql_history']) > $GLOBALS['cfg']['QueryHistoryMax']) { // history should not exceed a maximum count array_shift($_SESSION['sql_history']); } if (!$cfgRelation['historywork'] || !$GLOBALS['cfg']['QueryHistoryDB']) { return; } PMA_queryAsControlUser('INSERT INTO ' . PMA_Util::backquote($cfgRelation['db']) . '.' . PMA_Util::backquote($cfgRelation['history']) . ' (`username`, `db`, `table`, `timevalue`, `sqlquery`) VALUES (\'' . PMA_Util::sqlAddSlashes($username) . '\', \'' . PMA_Util::sqlAddSlashes($db) . '\', \'' . PMA_Util::sqlAddSlashes($table) . '\', NOW(), \'' . PMA_Util::sqlAddSlashes($sqlquery) . '\')'); PMA_purgeHistory($username); }
/** * Defines the frameset */ // loic1: If left light mode -> urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db = urldecode($lightm_db); $db = $lightm_db; unset($lightm_db); } $url_query = PMA_generate_common_url(isset($db) ? $db : ''); header('Content-Type: text/html; charset=' . $GLOBALS['charset']); require_once './libraries/relation.lib.php'; $cfgRelation = PMA_getRelationsParam(); if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) { PMA_purgeHistory($cfg['Server']['user']); } $phpmain_hash = md5($cfg['PmaAbsoluteUri']); $phpmain_hash_js = time(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?> " lang="<?php echo $available_languages[$lang][2]; ?> " dir="<?php echo $text_dir; ?>