Convert active check to variable.
We need to disable tracker for calling PMA_getRelationsParam. Well there should be rather way to skip all queries done by control user, but this information is not passed down to the DBI layer where tracker catches the SQL queries.
This commit is contained in:
@@ -23,6 +23,11 @@ require_once './libraries/relation.lib.php';
|
||||
*/
|
||||
class PMA_Tracker
|
||||
{
|
||||
/**
|
||||
* Whether tracking is ready.
|
||||
*/
|
||||
static protected $enabled = false;
|
||||
|
||||
/**
|
||||
* Defines the internal PMA table which contains tracking data.
|
||||
*
|
||||
@@ -92,6 +97,17 @@ class PMA_Tracker
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually enables tracking. This needs to be done after all
|
||||
* underlaying code is initialized.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
*/
|
||||
static public function enable()
|
||||
{
|
||||
self::$enabled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the on/off value of the Tracker module, starts initialization.
|
||||
@@ -102,8 +118,12 @@ class PMA_Tracker
|
||||
*/
|
||||
static public function isActive()
|
||||
{
|
||||
if (!defined('PHPMYADMIN_INIT_DONE')) return false;
|
||||
if (!self::$enabled) return false;
|
||||
/* We need to avoid attempt to track any queries from PMA_getRelationsParam */
|
||||
self::$enabled = false;
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
/* Restore original state */
|
||||
self::$enabled = true;
|
||||
if (!$cfgRelation['trackingwork']) return false;
|
||||
|
||||
self::init();
|
||||
@@ -190,8 +210,12 @@ class PMA_Tracker
|
||||
*/
|
||||
static public function isTracked($dbname, $tablename)
|
||||
{
|
||||
if (!defined('PHPMYADMIN_INIT_DONE')) return false;
|
||||
if (!self::$enabled) return false;
|
||||
/* We need to avoid attempt to track any queries from PMA_getRelationsParam */
|
||||
self::$enabled = false;
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
/* Restore original state */
|
||||
self::$enabled = true;
|
||||
if (!$cfgRelation['trackingwork']) return false;
|
||||
|
||||
$sql_query =
|
||||
|
@@ -985,8 +985,8 @@ $_SESSION['PMA_Config']->set('blowfish_secret', '');
|
||||
$_SESSION['PMA_Config']->set('Servers', '');
|
||||
$_SESSION['PMA_Config']->set('default_server', '');
|
||||
|
||||
/* Flag that we have loaded all core libraries and set up the connections */
|
||||
define('PHPMYADMIN_INIT_DONE', '42');
|
||||
/* Tell tracker that it can actually work */
|
||||
PMA_Tracker::enable();
|
||||
|
||||
if (!empty($__redirect) && in_array($__redirect, $goto_whitelist)) {
|
||||
/**
|
||||
|
Reference in New Issue
Block a user