change token for direct downloads

JoeGamers

Member
YetiShare User
Feb 16, 2019
37
1
8
30
Hi, can you tell me how to change the token for direct file downloads, I want to specify a certain amount of days for each ip
 

vnxbug

New Member
YetiShare User
YetiShare Supporter
Jun 25, 2018
15
1
3
28
ME TOO, i need clear or change or one token is affected for 1 IP, because my member using token link for direct download, i need to fix it !
 

vnxbug

New Member
YetiShare User
YetiShare Supporter
Jun 25, 2018
15
1
3
28
For IP address restriction on download tokens, it can be enabled by following this guidance:
In /core/includes/file.class.php, change this:
PHP:
// check token
// $tokenData = $db->getRow('SELECT id, user_id, ip_address, file_id, download_speed, max_threads FROM download_token WHERE file_id = ' . $db->escape($this->id) . ' AND ip_address=' . $db->quote(coreFunctions::getUsersIPAddress()) . ' AND token = ' . $db->quote($downloadToken) . ' LIMIT 1');
$tokenData = $db->getRow('SELECT id, user_id, ip_address, file_id, download_speed, max_threads FROM download_token WHERE file_id = ' . $db->escape($this->id) . ' AND  token = ' . $db->quote($downloadToken) . ' LIMIT 1');
to
PHP:
// check token
$tokenData = $db->getRow('SELECT id, user_id, ip_address, file_id, download_speed, max_threads FROM download_token WHERE file_id = ' . $db->escape($this->id) . ' AND ip_address=' . $db->quote(coreFunctions::getUsersIPAddress()) . ' AND token = ' . $db->quote($downloadToken) . ' LIMIT 1');
//$tokenData = $db->getRow('SELECT id, user_id, ip_address, file_id, download_speed, max_threads FROM download_token WHERE file_id = ' . $db->escape($this->id) . ' AND  token = ' . $db->quote($downloadToken) . ' LIMIT 1');