mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
Minor fixes (#686)
This commit is contained in:
parent
4ff334bb45
commit
ca4bc04902
4 changed files with 10 additions and 20 deletions
|
@ -76,7 +76,7 @@ if (file_exists(__DIR__ . '/library/config.local.php')) {
|
||||||
* Progressive error reporting
|
* Progressive error reporting
|
||||||
*/
|
*/
|
||||||
define('DBG_USER', (isset($_COOKIE[COOKIE_DBG])));
|
define('DBG_USER', (isset($_COOKIE[COOKIE_DBG])));
|
||||||
\TorrentPier\Dev::debug_init();
|
\TorrentPier\Dev::initDebug();
|
||||||
|
|
||||||
$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://';
|
$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://';
|
||||||
$server_port = in_array((int)$bb_cfg['server_port'], array(80, 443), true) ? '' : ':' . $bb_cfg['server_port'];
|
$server_port = in_array((int)$bb_cfg['server_port'], array(80, 443), true) ? '' : ':' . $bb_cfg['server_port'];
|
||||||
|
|
20
src/Ajax.php
20
src/Ajax.php
|
@ -98,41 +98,31 @@ class Ajax
|
||||||
|
|
||||||
// Auth check
|
// Auth check
|
||||||
switch ($action_params[0]) {
|
switch ($action_params[0]) {
|
||||||
// GUEST
|
case 'guest': // GUEST
|
||||||
case 'guest':
|
|
||||||
break;
|
break;
|
||||||
|
case 'user': // USER
|
||||||
// USER
|
|
||||||
case 'user':
|
|
||||||
if (IS_GUEST) {
|
if (IS_GUEST) {
|
||||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'mod': // MOD
|
||||||
// MOD
|
|
||||||
case 'mod':
|
|
||||||
if (!IS_AM) {
|
if (!IS_AM) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
case 'admin': // ADMIN
|
||||||
// ADMIN
|
|
||||||
case 'admin':
|
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
case 'super_admin': // SUPER_ADMIN
|
||||||
// SUPER_ADMIN
|
|
||||||
case 'super_admin':
|
|
||||||
if (!IS_SUPER_ADMIN) {
|
if (!IS_SUPER_ADMIN) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']);
|
$this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']);
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
trigger_error("invalid auth type for $action", E_USER_ERROR);
|
trigger_error("invalid auth type for $action", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Dev
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function debug_init(): void
|
public static function initDebug(): void
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
global $bb_cfg;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class Dev
|
||||||
$log = '';
|
$log = '';
|
||||||
|
|
||||||
foreach ($DBS->srv as $srv_name => $db_obj) {
|
foreach ($DBS->srv as $srv_name => $db_obj) {
|
||||||
$log .= !empty($db_obj) ? self::get_sql_log_html($db_obj, "$srv_name [MySQL]") : '';
|
$log .= !empty($db_obj) ? self::get_sql_log_html($db_obj, "database: $srv_name [{$db_obj->engine}]") : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($CACHES->obj as $cache_name => $cache_obj) {
|
foreach ($CACHES->obj as $cache_name => $cache_obj) {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
namespace TorrentPier\Legacy;
|
namespace TorrentPier\Legacy;
|
||||||
|
|
||||||
use mysqli_result;
|
use mysqli_result;
|
||||||
use TorrentPier\Common\Http;
|
|
||||||
use TorrentPier\Dev;
|
use TorrentPier\Dev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,6 +25,7 @@ class SqlDb
|
||||||
public $db_server = '';
|
public $db_server = '';
|
||||||
public $selected_db;
|
public $selected_db;
|
||||||
public $inited = false;
|
public $inited = false;
|
||||||
|
public string $engine = 'MySQL';
|
||||||
|
|
||||||
public $locked = false;
|
public $locked = false;
|
||||||
public $locks = [];
|
public $locks = [];
|
||||||
|
@ -993,7 +993,7 @@ class SqlDb
|
||||||
<table width="98%" cellpadding="0" cellspacing="0" class="bodyline row2 bCenter" style="border-bottom: 0;">
|
<table width="98%" cellpadding="0" cellspacing="0" class="bodyline row2 bCenter" style="border-bottom: 0;">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="height: 22px; cursor: pointer;" align="left"> ' . $dbg['src'] . ' [' . sprintf('%.4f', $dbg['time']) . ' s] <i>' . $dbg['info'] . '</i></th>
|
<th style="height: 22px; cursor: pointer;" align="left"> ' . $dbg['src'] . ' [' . sprintf('%.4f', $dbg['time']) . ' s] <i>' . $dbg['info'] . '</i></th>
|
||||||
<th class="copyElement" data-clipboard-target="#' . $htid . '" style="height: 22px; cursor: pointer;" align="right" title="' . $lang['COPY_TO_CLIPBOARD'] . '">' . "$this->db_server.$this->selected_db" . ' :: Query #' . ($this->num_queries + 1) . ' </th>
|
<th class="copyElement" data-clipboard-target="#' . $htid . '" style="height: 22px; cursor: pointer;" align="right" title="' . $lang['COPY_TO_CLIPBOARD'] . '">' . "[$this->engine] $this->db_server.$this->selected_db" . ' :: Query #' . ($this->num_queries + 1) . ' </th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="2">' . $this->explain_hold . '</td></tr>
|
<tr><td colspan="2">' . $this->explain_hold . '</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue