Guest User

Untitled

a guest
Nov 3rd, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.31 KB | None | 0 0
  1. --- module/vara.pl.orig 2013-11-05 15:18:21.000000000 +0900
  2. +++ module/vara.pl  2017-11-04 00:33:43.000000000 +0900
  3. @@ -7,6 +7,7 @@
  4.  
  5.  use strict;
  6.  #use warnings;
  7. +use LWP::Simple;
  8.  
  9.  #------------------------------------------------------------------------------------------------------------
  10.  #
  11. @@ -341,6 +342,41 @@
  12.                 $Form->Set('FROM', "</b>[´+ω+`] $host <b>$from");
  13.             }
  14.         }
  15. +      
  16. +       # VPNGate
  17. +       {
  18. +           my $path = $Sys->Get('BBSPATH') . '/' . $Sys->Get('BBS') . "/info/vpngate.cgi";
  19. +           my $now = time;
  20. +           if (!(-f $path) || (($now - (stat $path)[9]) > 600)) {
  21. +               my $url = 'http://www.vpngate.net/api/iphone/';
  22. +               my $data = get($url);
  23. +               if (defined($data)) {
  24. +                   my $addrs = '';
  25. +                   while ($data =~ /,(([0-9]{1,3}\.){3}[0-9]{1,3}),/g) {
  26. +                       $addrs = $addrs . $1 . "\n";
  27. +                   }
  28. +                   if (($addrs ne '') && open(my $fh, (-f $path ? '+<' : '>'), $path)) {
  29. +                       flock($fh, 2);
  30. +                       seek($fh, 0, 0);
  31. +                       binmode($fh);
  32. +                       print $fh "$addrs";
  33. +                       truncate($fh, tell($fh));
  34. +                       close($fh);
  35. +                   }
  36. +               }
  37. +           }
  38. +          
  39. +           if (open(my $fh, '<', $path)) {
  40. +               while (<$fh>) {
  41. +                   chomp($_);
  42. +                   if ($addr eq $_) {
  43. +                       close($fh);
  44. +                       return $ZP::E_REG_NGUSER;
  45. +                   }
  46. +               }
  47. +               close($fh);
  48. +           }
  49. +       }
  50.     }
  51.    
  52.     # pluginに渡す値を設定
Advertisement
Add Comment
Please, Sign In to add comment