Minor improvements (#711)

This commit is contained in:
Roman Kelesidis 2023-05-23 15:10:58 +07:00 committed by GitHub
commit 8a5bac558f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View file

@ -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();
/**

View file

@ -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 '
</div><!--/body_container-->
';
if (DBG_USER && SQL_DEBUG && !(isset($_GET['pane']) && $_GET['pane'] == 'left')) {
if ($show_dbg_info && SQL_DEBUG) {
require INC_DIR . '/page_footer_dev.php';
}

View file

@ -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();
}

View file

@ -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);
}
}