diff --git a/include/constants.php b/include/constants.php index 3be91f9e..7ffc5c54 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ User::CLASS_ADMINISTRATOR, 'user-change-class' => User::CLASS_ADMINISTRATOR, 'torrent-set-special-tag' => User::CLASS_ADMINISTRATOR, + 'torrent-approval-allow-automatic' => User::CLASS_UPLOADER, ), 'tweak' => array ( diff --git a/public/ipcheck.php b/public/ipcheck.php index 415b54d7..e7168110 100644 --- a/public/ipcheck.php +++ b/public/ipcheck.php @@ -5,8 +5,21 @@ loggedinorreturn(); if (get_user_class() < UC_MODERATOR) stderr("Sorry", "Access denied."); -stdhead("Duplicate IP users"); -begin_frame("Duplicate IP users:", true); + +$tabs = ['users', 'peers']; +$tab = 'users'; +if (!empty($_REQUEST['tab']) && in_array($_REQUEST['tab'], $tabs)) { + $tab = $_REQUEST['tab']; +} +$page = $_REQUEST['page'] ?? 0; +$title = 'Duplicate IP users'; +stdhead($title); +print '

'.$title.'

'; +//print ''; begin_table(); if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes") @@ -44,7 +57,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes") $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3); else $ratio="---"; - + $ratio = "$ratio"; $uploaded = mksize($arr["uploaded"]); $downloaded = mksize($arr["downloaded"]); @@ -54,7 +67,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes") $utc = ""; else $utc = " bgcolor=\"ECE9D8\""; - + $peer_res = sql_query("SELECT count(*) FROM peers WHERE ip = " . sqlesc($ras['ip']) . " AND userid = " . $arr['id']); $peer_row = mysql_fetch_row($peer_res); print("" . get_username($arr["id"])." @@ -64,7 +77,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes") $downloaded $uploaded $ratio - $arr[ip]\n" . + $arr[ip]\n" . ($peer_row[0] ? "ja" : "nein") . "\n"); $ip = $arr["ip"]; } diff --git a/public/settings.php b/public/settings.php index 005d9ede..081737b9 100644 --- a/public/settings.php +++ b/public/settings.php @@ -224,7 +224,7 @@ elseif ($action == 'savesettings_authority') // save user authority 'torrentstructure','sendinvite','viewhistory','topten','log','confilog','userprofile', 'torrenthistory','prfmanage', 'cruprfmanage', 'uploadsub','delownsub','submanage','updateextinfo', 'viewanonymous','beanonymous','addoffer','offermanage', 'upload','uploadspecial', 'view_special_torrent','movetorrent','chrmanage','viewinvite', 'buyinvite','seebanned','againstoffer','userbar', 'torrent-approval', - 'torrent-delete', 'user-delete', 'user-change-class', 'torrent-set-special-tag' + 'torrent-delete', 'user-delete', 'user-change-class', 'torrent-set-special-tag', 'torrent-approval-allow-automatic' ); GetVar($validConfig); $AUTHORITY = []; @@ -454,6 +454,8 @@ elseif ($action == 'authoritysettings') //Authority settings tr($lang_settings['row_torrent_hr'], $lang_settings['text_minimum_class'].classlist('torrent_hr',$maxclass,$AUTHORITY['torrent_hr'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_hr_note'],1); tr(nexus_trans('permission.torrent-set-special-tag.text'), $lang_settings['text_minimum_class'].classlist('torrent-set-special-tag',$maxclass,$AUTHORITY['torrent-set-special-tag'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).nexus_trans('permission.torrent-set-special-tag.desc'),1); tr(nexus_trans('permission.torrent-approval.text'), $lang_settings['text_minimum_class'].classlist('torrent-approval',$maxclass,$AUTHORITY['torrent-approval'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).nexus_trans('permission.torrent-approval.desc'),1); + tr(nexus_trans('permission.torrent-approval-allow-automatic.text'), $lang_settings['text_minimum_class'].classlist('torrent-approval-allow-automatic',$maxclass,$AUTHORITY['torrent-approval-allow-automatic'] ?? '',0,true).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).nexus_trans('permission.torrent-approval-allow-automatic.desc'),1); + tr($lang_settings['row_ask_for_reseed'], $lang_settings['text_minimum_class'].classlist('askreseed',$maxclass,$AUTHORITY['askreseed'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_ask_for_reseed_note'],1); tr($lang_settings['row_view_nfo'], $lang_settings['text_minimum_class'].classlist('viewnfo',$maxclass,$AUTHORITY['viewnfo'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_view_nfo_note'],1); tr($lang_settings['row_view_torrent_structure'], $lang_settings['text_minimum_class'].classlist('torrentstructure',$maxclass,$AUTHORITY['torrentstructure'],0,true).$lang_settings['text_default'].get_user_class_name(UC_ULTIMATE_USER,false,true,true).$lang_settings['text_view_torrent_structure_note'],1); diff --git a/public/staffbox.php b/public/staffbox.php index b865cab5..764a53ee 100644 --- a/public/staffbox.php +++ b/public/staffbox.php @@ -239,6 +239,9 @@ header("Refresh: 0; url=staffbox.php?action=viewpm&pmid=$id"); ////////////////////////// if ($action == "takecontactanswered") { + if (empty($_POST['setanswered'])) { + stderr($lang_staffbox['std_sorry'], nexus_trans('nexus.select_one_please')); + } if ($_POST['setdealt']){ $res = sql_query ("SELECT * FROM staffmessages WHERE answered=0 AND id IN (" . implode(", ", $_POST['setanswered']) . ")"); diff --git a/public/takeupload.php b/public/takeupload.php index 1deef989..08bfdcdb 100644 --- a/public/takeupload.php +++ b/public/takeupload.php @@ -367,6 +367,9 @@ if(user_can('torrentmanage') && ($CURUSER['picker'] == 'yes' || get_user_class() } } } +if (user_can('torrent-approval-allow-automatic')) { + $insert['approval_status'] = \App\Models\Torrent::APPROVAL_STATUS_ALLOW; +} do_log("[INSERT_TORRENT]: " . nexus_json_encode($insert)); $id = \Nexus\Database\NexusDB::insert('torrents', $insert); diff --git a/resources/lang/en/permission.php b/resources/lang/en/permission.php index 3555f17e..fa0c5a1c 100644 --- a/resources/lang/en/permission.php +++ b/resources/lang/en/permission.php @@ -9,6 +9,10 @@ return [ 'text' => 'Set torrent special tags', 'desc' => 'Set the Official/Zero bonus tag to torrents', ], + 'torrent-approval-allow-automatic' => [ + 'text' => 'Torrent approval allow automatically', + 'desc' => 'Torrent is the approval allow status after upload automatically', + ], 'defaultclass' => [ 'text' => 'Default Class', 'desc' => ' Class upon registration', diff --git a/resources/lang/zh_CN/permission.php b/resources/lang/zh_CN/permission.php index 8d85f91f..5d1dbb7b 100644 --- a/resources/lang/zh_CN/permission.php +++ b/resources/lang/zh_CN/permission.php @@ -9,6 +9,10 @@ return [ 'text' => '设定种子特殊标签', 'desc' => '设定种子的官方、零魔标签', ], + 'torrent-approval-allow-automatic' => [ + 'text' => '种子自动通过审核', + 'desc' => '种子发布即为审核通过状态', + ], 'defaultclass' => [ 'text' => '默认等级', 'desc' => '注册时获得的等级', diff --git a/resources/lang/zh_TW/permission.php b/resources/lang/zh_TW/permission.php index c0a254bb..95cb74ca 100644 --- a/resources/lang/zh_TW/permission.php +++ b/resources/lang/zh_TW/permission.php @@ -9,6 +9,10 @@ return [ 'text' => '設定種子特殊標簽', 'desc' => '設定種子的官方、零魔標簽', ], + 'torrent-approval-allow-automatic' => [ + 'text' => '種子自動通過審核', + 'desc' => '種子發布即為審核通過狀態', + ], 'defaultclass' => [ 'text' => '預設等級', 'desc' => '註冊時獲得的等級',