mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -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
|
||||
*/
|
||||
define('DBG_USER', (isset($_COOKIE[COOKIE_DBG])));
|
||||
\TorrentPier\Dev::debug_init();
|
||||
\TorrentPier\Dev::initDebug();
|
||||
|
||||
$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'];
|
||||
|
|
20
src/Ajax.php
20
src/Ajax.php
|
@ -98,41 +98,31 @@ class Ajax
|
|||
|
||||
// Auth check
|
||||
switch ($action_params[0]) {
|
||||
// GUEST
|
||||
case 'guest':
|
||||
case 'guest': // GUEST
|
||||
break;
|
||||
|
||||
// USER
|
||||
case 'user':
|
||||
case 'user': // USER
|
||||
if (IS_GUEST) {
|
||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
||||
}
|
||||
break;
|
||||
|
||||
// MOD
|
||||
case 'mod':
|
||||
case 'mod': // MOD
|
||||
if (!IS_AM) {
|
||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
||||
}
|
||||
$this->check_admin_session();
|
||||
break;
|
||||
|
||||
// ADMIN
|
||||
case 'admin':
|
||||
case 'admin': // ADMIN
|
||||
if (!IS_ADMIN) {
|
||||
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
||||
}
|
||||
$this->check_admin_session();
|
||||
break;
|
||||
|
||||
// SUPER_ADMIN
|
||||
case 'super_admin':
|
||||
case 'super_admin': // SUPER_ADMIN
|
||||
if (!IS_SUPER_ADMIN) {
|
||||
$this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']);
|
||||
}
|
||||
$this->check_admin_session();
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error("invalid auth type for $action", E_USER_ERROR);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class Dev
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function debug_init(): void
|
||||
public static function initDebug(): void
|
||||
{
|
||||
global $bb_cfg;
|
||||
|
||||
|
@ -88,7 +88,7 @@ class Dev
|
|||
$log = '';
|
||||
|
||||
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) {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
namespace TorrentPier\Legacy;
|
||||
|
||||
use mysqli_result;
|
||||
use TorrentPier\Common\Http;
|
||||
use TorrentPier\Dev;
|
||||
|
||||
/**
|
||||
|
@ -26,6 +25,7 @@ class SqlDb
|
|||
public $db_server = '';
|
||||
public $selected_db;
|
||||
public $inited = false;
|
||||
public string $engine = 'MySQL';
|
||||
|
||||
public $locked = false;
|
||||
public $locks = [];
|
||||
|
@ -993,7 +993,7 @@ class SqlDb
|
|||
<table width="98%" cellpadding="0" cellspacing="0" class="bodyline row2 bCenter" style="border-bottom: 0;">
|
||||
<tr>
|
||||
<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><td colspan="2">' . $this->explain_hold . '</td></tr>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue