diff --git a/common.php b/common.php index c14fbe7df..2b8d4d708 100644 --- a/common.php +++ b/common.php @@ -76,7 +76,7 @@ if (file_exists(BB_PATH . '/library/config.local.php')) { /** * Progressive error reporting */ -define('DBG_USER', (isset($_COOKIE[COOKIE_DBG]))); +define('DBG_USER', isset($_COOKIE[COOKIE_DBG])); \TorrentPier\Dev::initDebug(); /** diff --git a/library/includes/page_footer.php b/library/includes/page_footer.php index b6aad75ab..687efe939 100644 --- a/library/includes/page_footer.php +++ b/library/includes/page_footer.php @@ -25,7 +25,7 @@ if (!empty($template)) { $template->pparse('page_footer'); } -$show_dbg_info = (DBG_USER && IS_ADMIN && !(isset($_GET['pane']) && $_GET['pane'] == 'left')); +$show_dbg_info = (DBG_USER && !(isset($_GET['pane']) && $_GET['pane'] == 'left')); if (!$bb_cfg['gzip_compress']) { flush(); @@ -74,7 +74,7 @@ echo ' '; -if (DBG_USER && SQL_DEBUG && !(isset($_GET['pane']) && $_GET['pane'] == 'left')) { +if ($show_dbg_info && SQL_DEBUG) { require INC_DIR . '/page_footer_dev.php'; } diff --git a/src/Ajax.php b/src/Ajax.php index d9633e5dd..295a419a3 100644 --- a/src/Ajax.php +++ b/src/Ajax.php @@ -165,7 +165,7 @@ class Ajax { $this->response['action'] = $this->action; - if (DBG_USER && SQL_DEBUG && !empty($_COOKIE['sql_log'])) { + if (Dev::sql_dbg_enabled()) { $this->response['sql_log'] = Dev::get_sql_log(); } diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index 036c89093..2df3235c8 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -478,7 +478,7 @@ class User if ($c_sdata_curr !== $c_sdata_resv) { bb_setcookie(COOKIE_DATA, $c_sdata_curr, COOKIE_PERSIST, true); } - if (isset($bb_cfg['dbg_users'][$this->data['user_id']]) && !isset($_COOKIE[COOKIE_DBG])) { + if (isset($bb_cfg['dbg_users'][$this->data['user_id']]) && !DBG_USER) { bb_setcookie(COOKIE_DBG, 1, COOKIE_SESSION); } }