diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 57037c84..24f857e5 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1136,6 +1136,7 @@ function clear_user_cache($uid, $passkey = '') \Nexus\Database\NexusDB::cache_del("direct_permissions:$uid"); if ($passkey) { \Nexus\Database\NexusDB::cache_del('user_passkey_'.$passkey.'_content');//announce.php + \Nexus\Database\NexusDB::cache_del('user_passkey_'.$passkey.'_rss');//torrentrss.php } $userInfo = \App\Models\User::query()->find($uid, \App\Models\User::$commonFields); if ($userInfo) { diff --git a/public/torrentrss.php b/public/torrentrss.php index dd276b34..a95b84af 100644 --- a/public/torrentrss.php +++ b/public/torrentrss.php @@ -11,7 +11,7 @@ if ($cacheData && nexus_env('APP_ENV') != 'local') { header ("Content-type: text/xml"); die($cacheData); } -dbconn(); +dbconn(doLogin: false); function hex_esc($matches) { return sprintf("%02x", ord($matches[0])); } @@ -19,8 +19,10 @@ $dllink = false; $where = ""; if ($passkey){ - $res = sql_query("SELECT id, enabled, parked, passkey FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1"); - $user = mysql_fetch_array($res); + $user = \Nexus\Database\NexusDB::remember('user_passkey_'.$passkey.'_rss', 3600, function () use ($passkey) { + $res = sql_query("SELECT id, enabled, parked, passkey FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1"); + return mysql_fetch_array($res); + }); if (!$user) die("invalid passkey"); elseif ($user['enabled'] == 'no' || $user['parked'] == 'yes')