diff --git a/app/Repositories/HitAndRunRepository.php b/app/Repositories/HitAndRunRepository.php index 607a9a5d..2a325b52 100644 --- a/app/Repositories/HitAndRunRepository.php +++ b/app/Repositories/HitAndRunRepository.php @@ -95,18 +95,21 @@ class HitAndRunRepository extends BaseRepository $diffInSection = HitAndRun::diffInSection(); $browseMode = Setting::get('main.browsecat'); $setting = HitAndRun::getConfig('*', $browseMode); - $setting['diff_in_section'] = $diffInSection; - $setting['search_box_id'] = $browseMode; - $this->doCronjobUpdateStatus($setting, $uid, $torrentId, $ignoreTime); - $this->checkAndDisableUser($setting); - + if ($setting['mode'] != HitAndRun::MODE_DISABLED) { + $setting['diff_in_section'] = $diffInSection; + $setting['search_box_id'] = $browseMode; + $this->doCronjobUpdateStatus($setting, $uid, $torrentId, $ignoreTime); + $this->checkAndDisableUser($setting); + } $specialMode = Setting::get('main.specialcat'); if ($diffInSection && $browseMode != $specialMode) { $setting = HitAndRun::getConfig('*', $specialMode); - $setting['diff_in_section'] = $diffInSection; - $setting['search_box_id'] = $specialMode; - $this->doCronjobUpdateStatus($setting, $uid, $torrentId, $ignoreTime); - $this->checkAndDisableUser($setting); + if ($setting['mode'] != HitAndRun::MODE_DISABLED) { + $setting['diff_in_section'] = $diffInSection; + $setting['search_box_id'] = $specialMode; + $this->doCronjobUpdateStatus($setting, $uid, $torrentId, $ignoreTime); + $this->checkAndDisableUser($setting); + } } } @@ -342,6 +345,10 @@ class HitAndRunRepository extends BaseRepository { $logPrefix = "setting: " . json_encode($setting); $disableCounts = HitAndRun::getConfig('ban_user_when_counts_reach', $setting['search_box_id']); + if ($disableCounts <= 0) { + do_log("$logPrefix, disableCounts: $disableCounts <= 0, invalid, return", 'error'); + return; + } $query = HitAndRun::query() ->selectRaw("count(*) as counts, uid") ->where('status', HitAndRun::STATUS_UNREACHED) diff --git a/public/catmanage.php b/public/catmanage.php index 1d343ed3..7248f98a 100644 --- a/public/catmanage.php +++ b/public/catmanage.php @@ -7,6 +7,8 @@ loggedinorreturn(); if (get_user_class() < UC_ADMINISTRATOR) permissiondenied(); +$perpage = 50; +$pagerParam = '?action=view&type=' . ($_GET['type'] ?? 'searchbox') . '&'; function return_category_db_table_name($type) { switch($type) @@ -153,14 +155,13 @@ function check_valid_type($type) } function print_sub_category_list($type) { - global $lang_catmanage; + global $lang_catmanage, $perpage, $pagerParam; $dbtablename = return_category_db_table_name($type); - $perpage = 50; $num = get_row_count($dbtablename); if (!$num) print("
".$lang_catmanage['text_no_record_yet']."
"); else{ - list($pagertop, $pagerbottom, $limit) = pager($perpage, $num, "?"); + list($pagertop, $pagerbottom, $limit) = pager($perpage, $num, $pagerParam); $res = sql_query("SELECT * FROM ".$dbtablename." ORDER BY id DESC ".$limit) or sqlerr(__FILE__, __LINE__); ?>