seedBox record alert + destroy disabled account

This commit is contained in:
xiaomlove
2022-10-16 04:52:44 +08:00
parent 871e3637ea
commit be29509cff
17 changed files with 96 additions and 31 deletions
+11 -3
View File
@@ -11,6 +11,7 @@ header("Pragma: no-cache" );
$torrentRep = new \App\Repositories\TorrentRepository();
$claimRep = new \App\Repositories\ClaimRepository();
$seedBoxRep = new \App\Repositories\SeedBoxRepository();
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
$id = intval($_GET['userid'] ?? 0);
$type = $_GET['type'];
@@ -22,7 +23,7 @@ if(!user_can('torrenthistory') && $id != $CURUSER["id"])
function maketable($res, $mode = 'seeding')
{
global $lang_getusertorrentlistajax,$CURUSER,$smalldescription_main, $lang_functions, $id;
global $torrentRep, $claimRep, $claimTorrentTTL;
global $torrentRep, $claimRep, $claimTorrentTTL, $seedBoxRep;
$showActionClaim = $showClient = false;
switch ($mode)
{
@@ -107,6 +108,10 @@ function maketable($res, $mode = 'seeding')
}
default: break;
}
$shouldShowClient = false;
if ($showClient && (user_can('userprofile') || $CURUSER['id'] == $id)) {
$shouldShowClient = true;
}
$results = $torrentIdArr = [];
while ($row = mysql_fetch_assoc($res)) {
$results[] = $row;
@@ -131,7 +136,7 @@ function maketable($res, $mode = 'seeding')
$ret = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td class=\"colhead\" style=\"padding: 0px\">".$lang_getusertorrentlistajax['col_type']."</td><td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_name']."</td><td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_added']."</td>".
($showsize ? "<td class=\"colhead\" align=\"center\"><img class=\"size\" src=\"pic/trans.gif\" alt=\"size\" title=\"".$lang_getusertorrentlistajax['title_size']."\" /></td>" : "").($showsenum ? "<td class=\"colhead\" align=\"center\"><img class=\"seeders\" src=\"pic/trans.gif\" alt=\"seeders\" title=\"".$lang_getusertorrentlistajax['title_seeders']."\" /></td>" : "").($showlenum ? "<td class=\"colhead\" align=\"center\"><img class=\"leechers\" src=\"pic/trans.gif\" alt=\"leechers\" title=\"".$lang_getusertorrentlistajax['title_leechers']."\" /></td>" : "").($showuploaded ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_uploaded']."</td>" : "") . ($showdownloaded ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_downloaded']."</td>" : "").($showratio ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_ratio']."</td>" : "").($showsetime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_se_time']."</td>" : "").($showletime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_le_time']."</td>" : "").($showcotime ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_time_completed']."</td>" : "").($showanonymous ? "<td class=\"colhead\" align=\"center\">".$lang_getusertorrentlistajax['col_anonymous']."</td>" : "");
if ($showClient) {
if ($shouldShowClient) {
$ret .= sprintf('<td class="colhead" align="center">%s</td><td class="colhead" align="center">IP</td>', $lang_getusertorrentlistajax['col_client']);
}
$ret .= sprintf('<td class="colhead" align="center">%s</td>', $lang_functions['std_action']);
@@ -217,8 +222,11 @@ function maketable($res, $mode = 'seeding')
$ret .= "<td class=\"rowfollow\" align=\"center\">"."". str_replace("&nbsp;", "<br />", gettime($arr['completedat'],false)). "</td>";
if ($showanonymous)
$ret .= "<td class=\"rowfollow\" align=\"center\">".$arr['anonymous']."</td>";
if ($showClient) {
if ($shouldShowClient) {
$ipArr = array_filter([$arr['ipv4'], $arr['ipv6']]);
foreach ($ipArr as &$_ip) {
$_ip = sprintf('<span class="nowrap">%s</span>', $_ip . $seedBoxRep->renderIcon($_ip, $arr['userid']));
}
$ret .= sprintf(
'<td class="rowfollow" align="center">%s<br/>%s</td><td class="rowfollow" align="center">%s</td>',
get_agent($arr['peer_id'], $arr['agent']), $arr['port'],
+10 -3
View File
@@ -134,7 +134,7 @@ elseif ($action == 'savesettings_account') // save account
'exutime', 'exudl', \App\Models\User::CLASS_EXTREME_USER . '_min_seed_points', 'exuprratio', 'exuderatio', \App\Models\User::CLASS_EXTREME_USER . '_alias',
'uutime', 'uudl', \App\Models\User::CLASS_ULTIMATE_USER . '_min_seed_points', 'uuprratio', 'uuderatio', \App\Models\User::CLASS_ULTIMATE_USER . '_alias',
'nmtime', 'nmdl', \App\Models\User::CLASS_NEXUS_MASTER . '_min_seed_points', 'nmprratio', 'nmderatio', \App\Models\User::CLASS_NEXUS_MASTER . '_alias',
'getInvitesByPromotion'
'getInvitesByPromotion', 'destroy_disabled'
);
GetVar($validConfig);
$ACCOUNT = [];
@@ -486,8 +486,12 @@ elseif ($action == 'authoritysettings') //Authority settings
tr($lang_settings['row_see_banned_torrents'], $lang_settings['text_minimum_class'].classlist('seebanned',$maxclass,$AUTHORITY['seebanned'],0,true).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).$lang_settings['text_see_banned_torrents_note'],1);
tr($lang_settings['row_vote_against_offers'], $lang_settings['text_minimum_class'].classlist('againstoffer',$maxclass,$AUTHORITY['againstoffer'],0,true).$lang_settings['text_default'].get_user_class_name(UC_USER,false,true,true).$lang_settings['text_vote_against_offers_note'],1);
tr($lang_settings['row_allow_userbar'], $lang_settings['text_minimum_class'].classlist('userbar',$maxclass,$AUTHORITY['userbar'],0,true).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_allow_userbar_note'],1);
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
print ("</form>");
// tr(nexus_trans('permission.not-counting-downloaded.text'), $lang_settings['text_minimum_class'].classlist('not-counting-downloaded',$maxclass,$AUTHORITY['not-counting-downloaded'] ?? '',0,true).nexus_trans('permission.not-counting-downloaded.desc'),1);
// tr(nexus_trans('permission.not-counting-hit-and-run.text'), $lang_settings['text_minimum_class'].classlist('not-counting-hit-and-run',$maxclass,$AUTHORITY['not-counting-hit-and-run'] ?? '',0,true).nexus_trans('permission.not-counting-hit-and-run.desc'),1);
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
print ("</form>");
}
elseif ($action == 'basicsettings') // basic settings
{
@@ -651,6 +655,9 @@ elseif ($action == 'accountsettings'){
tr($lang_settings['row_delete_packed'],$lang_settings['text_delete_packed_note_one']."<input type='text' style=\"width: 50px\" name=deletepacked value='".(isset($ACCOUNT["deletepacked"]) ? $ACCOUNT["deletepacked"] : 400 )."'>".$lang_settings['text_delete_packed_note_two'], 1);
tr($lang_settings['row_delete_unpacked'],$lang_settings['text_delete_unpacked_note_one']."<input type='text' style=\"width: 50px\" name=deleteunpacked value='".(isset($ACCOUNT["deleteunpacked"]) ? $ACCOUNT["deleteunpacked"] : 150 )."'>".$lang_settings['text_delete_unpacked_note_two'], 1);
tr($lang_settings['row_delete_no_transfer'],$lang_settings['text_delete_transfer_note_one']."<input type='text' style=\"width: 50px\" name=deletenotransfer value='".(isset($ACCOUNT["deletenotransfer"]) ? $ACCOUNT["deletenotransfer"] : 60 )."'>".$lang_settings['text_delete_transfer_note_two']."<input type='text' style=\"width: 50px\" name=deletenotransfertwo value='".(isset($ACCOUNT["deletenotransfertwo"]) ? $ACCOUNT["deletenotransfertwo"] : 0 )."'>".$lang_settings['text_delete_transfer_note_three'], 1);
tr($lang_settings['row_destroy_disabled'],$lang_settings['text_destroy_disabled_note_one']."<input type='text' style=\"width: 50px\" name=destroy_disabled value='".(isset($ACCOUNT["destroy_disabled"]) ? $ACCOUNT["destroy_disabled"] : 500 )."'>".$lang_settings['text_destroy_disabled_note_two'], 1);
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_user_promotion_demotion']."</b></td></tr>");
tr($lang_settings['row_ban_peasant_one'].get_user_class_name(UC_PEASANT,false,false,true).$lang_settings['row_ban_peasant_two'],get_user_class_name(UC_PEASANT,false,true,true).$lang_settings['text_ban_peasant_note_one']."<input type='text' style=\"width: 50px\" name=deletepeasant value='".(isset($ACCOUNT["deletepeasant"]) ? $ACCOUNT["deletepeasant"] : 30 )."'>".$lang_settings['text_ban_peasant_note_two'], 1);
$inputAlias = "0_alias";
+2 -2
View File
@@ -13,7 +13,7 @@ begin_main_frame();
$torrent_name = get_single_value("torrents", "name", "WHERE id = ".sqlesc($id));
print("<h1 align=center>".$lang_viewsnatches['text_snatch_detail_for'] . "<a href=details.php?id=" . htmlspecialchars($id) . "><b>".htmlspecialchars($torrent_name)."</b></a></h1>");
$count = get_row_count("snatched", "WHERE finished = 'yes' AND torrentid = ".sqlesc($id));
$seedBoxRep = new \App\Repositories\SeedBoxRepository();
if ($count){
$perpage = 25;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["SCRIPT_NAME"] . "?id=" . htmlspecialchars($id) . "&" );
@@ -53,7 +53,7 @@ if ($count){
}
else $username = get_username($arr['userid']);
$reportImage = "<img class=\"f_report\" src=\"pic/trans.gif\" alt=\"Report\" title=\"".$lang_viewsnatches['title_report']."\" />";
print("<tr$highlight><td class=rowfollow align=center>" . $username ."</td>".(user_can('userprofile') ? "<td class=rowfollow align=center>".$arr['ip']."</td>" : "")."<td class=rowfollow align=center>".$uploaded."@".$uprate.$lang_viewsnatches['text_per_second']."<br />".$downloaded."@".$downrate.$lang_viewsnatches['text_per_second']."</td><td class=rowfollow align=center>$ratio</td><td class=rowfollow align=center>$seedtime</td><td class=rowfollow align=center>$leechtime</td><td class=rowfollow align=center>".gettime($arr['completedat'],true,false)."</td><td class=rowfollow align=center>".gettime($arr['last_action'],true,false)."</td><td class=rowfollow align=center style='padding: 0px'>".($userrow['privacy'] != 'strong' || user_can('viewanonymous') ? "<a href=report.php?user={$arr['userid']}>$reportImage</a>" : $reportImage)."</td></tr>\n");
print("<tr$highlight><td class=rowfollow align=center>" . $username ."</td>".(user_can('userprofile') || $arr['userid'] == $CURUSER['id'] ? "<td class=rowfollow align=center><span class='nowrap'>".$arr['ip'].$seedBoxRep->renderIcon($arr['ip'], $arr['userid'])."</span></td>" : "")."<td class=rowfollow align=center>".$uploaded."@".$uprate.$lang_viewsnatches['text_per_second']."<br />".$downloaded."@".$downrate.$lang_viewsnatches['text_per_second']."</td><td class=rowfollow align=center>$ratio</td><td class=rowfollow align=center>$seedtime</td><td class=rowfollow align=center>$leechtime</td><td class=rowfollow align=center>".gettime($arr['completedat'],true,false)."</td><td class=rowfollow align=center>".gettime($arr['last_action'],true,false)."</td><td class=rowfollow align=center style='padding: 0px'>".($userrow['privacy'] != 'strong' || user_can('viewanonymous') ? "<a href=report.php?user={$arr['userid']}>$reportImage</a>" : $reportImage)."</td></tr>\n");
}
print("</table>\n");
print($pagerbottom);