Files
nexusphp/public/takeflush.php
2025-09-08 03:05:55 +07:00

30 lines
722 B
PHP

<?php
require_once("../include/bittorrent.php");
dbconn();
require_once(get_langfile_path());
loggedinorreturn();
function bark($msg)
{
stdhead();
stdmsg($lang_takeflush['std_failed'], $msg);
stdfoot();
exit;
}
$id = intval($_GET['id'] ?? 0);
int_check($id,true);
if (get_user_class() >= UC_MODERATOR || $CURUSER['id'] == "$id")
{
$deadtime = deadtime();
$lastAction = date("Y-m-d H:i:s", $deadtime);
sql_query("DELETE FROM peers WHERE last_action < '$lastAction' AND userid=" . sqlesc($id));
$effected = mysql_affected_rows();
stderr($lang_takeflush['std_success'], "$effected ".$lang_takeflush['std_ghost_torrents_cleaned']);
}
else
{
bark($lang_takeflush['std_cannot_flush_others']);
}