passkey showing on upload page help

Started by bhast2, February 16, 2016, 09:15:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bhast2

WOW it works great thank you for your help mate.

whocares

I would probably do something like

Code (php) Select
$testann = preg_replace('/?passkey=[[:xdigit:]]{32}/i', '', $ann);
if (!in_array($testann, $TBDEV['announce_urls'], 1))
      stderr($lang['takeupload_failed'], sprintf($lang['takeupload_url'], $TBDEV['announce_urls'][0]));


If you wanted to verify that it was that user's passkey not just a random one use this instead

Code (php) Select
$testann = str_replace("?passkey={$CURUSER['passkey']}", '', $ann);
if (!in_array($testann, $TBDEV['announce_urls'], 1))
      stderr($lang['takeupload_failed'], sprintf($lang['takeupload_url'], $TBDEV['announce_urls'][0]));


FYI both of these are untested
Unless stated otherwise code is untested

bhast2

I am trying to get the passkey to show up on the upload page

So I added this code
?passkey={$CURUSER['passkey']}

to this

$HTMLOUT .="
                 <div class='cblock'>
                 <div class='cblock-header'>{$lang['upload_title']}</div>
                 <div class='cblock-lb'>{$lang['upload_announce_url']} {$TBDEV['announce_urls'][0]}</div>
                 <div class='cblock-content'>";


So now it looks like this

    $HTMLOUT .="
                 <div class='cblock'>
                 <div class='cblock-header'>{$lang['upload_title']}</div>
                 <div class='cblock-lb'>{$lang['upload_announce_url']} {$TBDEV['announce_urls'][0]}?passkey={$CURUSER['passkey']}</div>
                 <div class='cblock-content'>";


And it shows the passkey on the upload page

My problem is that if you make a torrent with the url with the passkey the tracker won't take it
So I know I have to edit take upload.php but I am not sure what I need to add

I am thinking it needs to be added here
if (!in_array($ann, $TBDEV['announce_urls'], 1))
      stderr($lang['takeupload_failed'], sprintf($lang['takeupload_url'], $TBDEV['announce_urls'][0]));

but I'm not sure fully what the code should look like


THANK YOU FOR YOUR HELP