approval allow automatic

This commit is contained in:
xiaomlove
2022-10-04 18:43:00 +08:00
parent bb000fb67a
commit 2737302281
9 changed files with 41 additions and 7 deletions
+18 -5
View File
@@ -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 '<h1>'.$title.'</h1>';
//print '<ul class="menu" style="padding-inline-start: 0">';
//foreach ($tabs as $item) {
// echo sprintf('<li class="%s"><a href="?tab=%s&page=%s">%s</a></li>', $tab == $item ? 'selected' : '', $item, $page, $item);
//}
//print '</ul>';
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 = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
$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("<tr$utc><td align=left>" . get_username($arr["id"])."</td>
@@ -64,7 +77,7 @@ if (get_user_class() >= UC_MODERATOR || $CURUSER["guard"] == "yes")
<td align=center>$downloaded</td>
<td align=center>$uploaded</td>
<td align=center>$ratio</td>
<td align=center><a href=\"http://www.whois.sc/$arr[ip]\" target=\"_blank\">$arr[ip]</a></td>\n<td align=center>" .
<td align=center><a href=\"http://www.whois.sc/$arr[ip]\" target=\"_blank\">$arr[ip]</a></td>\n<td align=center>" .
($peer_row[0] ? "ja" : "nein") . "</td></tr>\n");
$ip = $arr["ip"];
}
+3 -1
View File
@@ -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);
+3
View File
@@ -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']) . ")");
+3
View File
@@ -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);