Passkey System
Hello!
Working TBDEV Passkey system would be being asked! With detailed description. Thank You! Sorry very small speak in English. Have a nice day :smile: |
Passkey by Skorpios, Original passkey split from main topic
The files that must be modified are:
announce.php download.php modtask.php my.php takeprofedit.php userdetails.php First of all, create the field 'passkey' in the 'users' and 'peers' tables. Code:
ALTER TABLE users ADD passkey VARCHAR(32) NOT NULL; Now we need to set each users passkey and add it to the downloaded torrent. Both of these are done in download.php by replacing the lines: Code:
header("Content-Type: application/x-bittorrent"); Code:
require_once "include/benc.php"; To allow users to reset their passkey if they suspect it has been leaked, we modify my.php and takeprofedit.php. In my.php, wherever you want the passkey reset box to appear, add the line: Code:
tr("Reset passkey"," Code:
if ($_POST['resetpasskey']) $updateset[] = "passkey=''"; Code:
print(" Code:
if ($_POST['resetpasskey']) $updateset[] = "passkey=''"; Replace the section that starts and ends: Code:
$req = "info_hash:peer_id:!ip:port:uploaded:downloaded:left:!event"; Code:
foreach (array("passkey","info_hash","peer_id","ip","event") as $x) Next we need to verify the passkey is actually valid. After the lines: Code:
dbconn(false); Code:
$valid = @mysql_fetch_row(@mysql_query("SELECT COUNT(*) FROM users WHERE passkey=" . sqlesc($passkey))); Code:
//// Up/down stats //////////////////////////////////////////////////////////// Code:
//// Up/down stats //////////////////////////////////////////////////////////// The last change in the code already has some restrictions coded in. It will allow the torrent to be leeched from only one location at a time, as long as it is not currently being seeded elsewhere. This should prevent a torrent from being leeched by multiple users from the same account, for instance, if a passkey was leaked. On the other hand, some users like to seed from home and from work at the same time, in an attempt to improve their ratio. This code restricts users to seeding from a maximum of three locations simultaneously. For these checks to work, one final change is required, which is to insert the passkey into the peers table when the user connects. To do this, replace the line: Code:
$ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, uploadoffset, downloadoffset) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, NOW(), NOW(), '$seeder', $userid, " . sqlesc($agent) . ", $uploaded, $downloaded)"); Code:
$ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, uploadoffset, downloadoffset, passkey) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, NOW(), NOW(), '$seeder', $userid, " . sqlesc($agent) . ", $uploaded, $downloaded, " . sqlesc($passkey) . ")"); |
Installed this mod...but how can i make
When i go to upload.php to show my passkey : ex : Your announce url is : http://site/announce.php?passkey=blabla :| ?:sos: |
Kinda late but hope this will be helpful to someone.
Put this code: Code:
Code:
= $announce_urls[0] ?> in upload.php find: Code:
if (get_user_class() < UC_UPLOADER) Code:
if (strlen($CURUSER['passkey']) != 32) { Code:
Code:
|
All times are GMT +2. The time now is 19:21. |
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.