mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
refactor isSeedBox judgement
This commit is contained in:
@@ -78,9 +78,8 @@ function peasant_to_user($down_floor_gb, $down_roof_gb, $minratio){
|
||||
while ($arr = mysql_fetch_assoc($res))
|
||||
{
|
||||
$locale = get_user_locale($arr['id']);
|
||||
$subject = nexus_trans("cleanup.msg_low_ratio_warning_removed", [], $locale);
|
||||
$msg = nexus_trans("cleanup.msg_your_ratio_warning_removed", [], $locale);
|
||||
|
||||
$subject = sqlesc(nexus_trans("cleanup.msg_low_ratio_warning_removed", [], $locale));
|
||||
$msg = sqlesc(nexus_trans("cleanup.msg_your_ratio_warning_removed", [], $locale));
|
||||
writecomment($arr['id'],"Leech Warning removed by System.");
|
||||
sql_query("UPDATE users SET class = 1, leechwarn = 'no', leechwarnuntil = null WHERE id = {$arr['id']}") or sqlerr(__FILE__, __LINE__);
|
||||
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES(0, {$arr['id']}, $dt, $subject, $msg)") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-05-08');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-05-11');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -2812,7 +2812,7 @@ if ($msgalert)
|
||||
|
||||
//seed box approval
|
||||
if (get_user_class() >= \App\Models\User::CLASS_ADMINISTRATOR && get_setting('seed_box.enabled') == 'yes') {
|
||||
$cacheKey = 'SEED_BOX_RECORD_APPROVAL_NONE';
|
||||
$cacheKey = \App\Repositories\SeedBoxRepository::APPROVAL_COUNT_CACHE_KEY;
|
||||
$toApprovalCounts = $Cache->get_value($cacheKey);
|
||||
if ($toApprovalCounts === false) {
|
||||
$toApprovalCounts = get_row_count('seed_box_records', 'where status = 0');
|
||||
|
||||
@@ -915,6 +915,15 @@ function isIPSeedBoxFromASN($ip, $exceptionWhenYes = false): bool
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @param $ip
|
||||
* @param $uid
|
||||
* @param $withoutCache
|
||||
* @param $exceptionWhenYes
|
||||
* @return bool
|
||||
* @throws \App\Exceptions\SeedBoxYesException
|
||||
*/
|
||||
function isIPSeedBox($ip, $uid, $withoutCache = false, $exceptionWhenYes = false): bool
|
||||
{
|
||||
$key = "nexus_is_ip_seed_box:ip:$ip:uid:$uid";
|
||||
|
||||
Reference in New Issue
Block a user