Files
nexusphp/public/takeflush.php

30 lines
722 B
PHP
Raw Normal View History

2020-12-26 01:42:23 +08:00
<?php
2021-01-13 19:32:26 +08:00
require_once("../include/bittorrent.php");
2020-12-26 01:42:23 +08:00
dbconn();
require_once(get_langfile_path());
loggedinorreturn();
function bark($msg)
{
stdhead();
stdmsg($lang_takeflush['std_failed'], $msg);
stdfoot();
exit;
}
$id = intval($_GET['id'] ?? 0);
2020-12-26 01:42:23 +08:00
int_check($id,true);
2021-03-30 00:03:10 +08:00
if (get_user_class() >= UC_MODERATOR || $CURUSER['id'] == "$id")
2025-09-08 03:05:55 +07:00
{
2020-12-26 01:42:23 +08:00
$deadtime = deadtime();
2025-09-08 03:05:55 +07:00
$lastAction = date("Y-m-d H:i:s", $deadtime);
sql_query("DELETE FROM peers WHERE last_action < '$lastAction' AND userid=" . sqlesc($id));
2020-12-26 01:42:23 +08:00
$effected = mysql_affected_rows();
stderr($lang_takeflush['std_success'], "$effected ".$lang_takeflush['std_ghost_torrents_cleaned']);
}
else
{
bark($lang_takeflush['std_cannot_flush_others']);
}