Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Detect VPN [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-07-06 17:24:13
This is from TT fr so credit to original author
Mod detects vpn and you can config whether to disallow  on login and signup. I use it on signup so members cant make multiple accounts with different ips

[color=rgb(251, 160, 38)]config.php add[/color]
// vpn
$site_config['vpnlogin'] = false;                                                                                /* ban vpn on login */
$site_config['vpnsignup'] = true;                                                                                /* ban vpn on signup */


[color=rgb(251, 160, 38)]functions.php before last ?>[/color]
// vpn detection
function detection_vpn(){
   $ip = gethostbyname($_SERVER["REMOTE_ADDR"]);
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_URL, 'http://proxy.mind-media.com/block/proxycheck.php?ip='.$ip);
   $result = curl_exec($ch);
   curl_close($ch);
   if($result == 'N')
       return false;
   else if($result == 'Y')
       return true;
   else
       return false;
   }


[color=rgb(251, 160, 38)]account-signup.php find[/color]
// Disable checks if we're signing up with an invite


add before
// Detect vpn and disallow
if ($site_config["vpnsignup"])
   if (detection_vpn()){
       // Disconnect database
       dbconn(false);
       // Destruction of the User Cookie
       logoutcookie();
       show_error_msg(T_("SORRY"), "<br /><br /><center>Please turn vpn off to signup after you first login you may turn it back on<br /><br /></center>",1);
       die;
       }


[color=rgb(251, 160, 38)]account-login.php find[/color]
dbconn();


add after
        // Detect vpn and disallow
if ($site_config["vpnlogin"])
   if (detection_vpn()){
       // Disconnect database
       dbconn(false);
       // Destruction of the User Cookie
       logoutcookie();
       show_error_msg(T_("SORRY"), "<br /><br /><center>Please turn vpn off to signup after you first login you may turn it back on<br /><br /></center>",1);
       die;
       }
Unknown User
2019-07-06 18:53:48
Thanks
2019-07-06 19:19:25
If you hide blocks on login you may need to move this line to under dbconn(); so blocks don't show on error page

$site_config["LEFTNAV"] = $site_config["MIDDLENAV"] = $site_config["RIGHTNAV"] = false;
Unknown User
2019-07-06 19:25:10
"m-jay, post: 66855, member: 20288":

If you hide blocks on login you may need to move this line to under dbconn(); so blocks don't show on error page

$site_config["LEFTNAV"] = $site_config["MIDDLENAV"] = $site_config["RIGHTNAV"] = false;

If using a cloudflare, make sure to set [ICODE]$_SERVER["HTTP_CF_CONNECTING_IP"] [/ICODE] because [ICODE]$_SERVER["REMOTE_ADDR"][/ICODE] can be spoofed.
2019-07-07 11:12:11
thanks you yours[USER=20288] m-jay[/USER]!
Unknown User
2019-10-06 16:15:53
beware that proxy.mind-media.com will have all your requests to their server and access to your backend server ip. (if you run some bigger torrent site do not use anything which requests remote url requests)

Edit: workaround would be to set chain-reverse proxy servers to redirect requests from server 1 to server 2 but it could be a bit expensive.
2019-10-12 10:45:58
no work for me
Unknown User
2019-11-25 21:31:54
Hello, does not work for me :( with nordvpn I still have access
2020-08-02 05:45:13
The script can be pinged too for set interval to DOM load form, once their VPN if turned off. Or just refresh.

Just automates a bit.
2021-02-16 10:59:18
^^ Bump ^^

Some better solution or update for that hack/fix


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728