clear icon cache after modify

This commit is contained in:
xiaomlove
2023-02-06 14:25:05 +08:00
parent 23ea393ffe
commit 59b7a2916e
12 changed files with 35 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ require '../include/bittorrent_announce.php';
require ROOT_PATH . 'include/core.php';
do_log(nexus_json_encode($_SERVER));
//1. BLOCK ACCESS WITH WEB BROWSERS AND CHEATS!
$agent = $_SERVER["HTTP_USER_AGENT"];
$agent = $_SERVER["HTTP_USER_AGENT"] ?? '';
block_browser();
dbconn_announce();
//check authkey
@@ -32,7 +32,7 @@ foreach (array("passkey","info_hash","peer_id","port","downloaded","uploaded","l
if (!isset($x)) err("Missing key: $x");
foreach (array("info_hash","peer_id") as $x)
if (strlen($GLOBALS[$x]) != 20) err("Invalid $x (" . strlen($GLOBALS[$x]) . " - " . rawurlencode($GLOBALS[$x]) . ")");
if (strlen($passkey) != 32) err("Invalid passkey (" . strlen($passkey) . " - $passkey)");
if (isset($passkey) && strlen($passkey) != 32) err("Invalid passkey (" . strlen($passkey) . " - $passkey)");
//4. GET IP AND CHECK PORT
$ip = getip(); // avoid to get the spoof ip from some agent

View File

@@ -109,7 +109,10 @@ if (filesize($fn) == 0) {
}
$approvalNotAllowed = $row['approval_status'] != \App\Models\Torrent::APPROVAL_STATUS_ALLOW && get_setting('torrent.approval_status_none_visible') == 'no';
$allowOwnerDownload = $row['owner'] == $CURUSER['id'] && \App\Models\Snatch::query()->where('torrentid', $id)->count() == 0;
if ((($row['banned'] == 'yes' || ($approvalNotAllowed && !$allowOwnerDownload)) && !user_can('seebanned')) || !can_access_torrent($row)) {
$canSeedBanned = user_can('seebanned');
$canAccessTorrent = can_access_torrent($row);
if ((($row['banned'] == 'yes' || ($approvalNotAllowed && !$allowOwnerDownload)) && !$canSeedBanned) || !$canAccessTorrent) {
do_log("[DENY_DOWNLOAD], user: {$CURUSER['id']}, approvalNotAllowed: $approvalNotAllowed, allowOwnerDownload: $allowOwnerDownload, canSeedBanned: $canSeedBanned, canAccessTorrent: $canAccessTorrent", 'error');
denyDownload();
}

View File

@@ -41,8 +41,8 @@ $locationInfo = get_ip_location_from_geoip($ip);
$thisLoginLog = \App\Models\LoginLog::query()->create([
'ip' => $ip,
'uid' => $row['id'],
'country' => $locationInfo['country_en'],
'city' => $locationInfo['city_en'],
'country' => $locationInfo['country_en'] ?? '',
'city' => $locationInfo['city_en'] ?? '',
'client' => 'Web',
]);
$lastLoginLog = \App\Models\LoginLog::query()->where('uid', $row['id'])->orderBy('id', 'desc')->first();