Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- module/vara.pl.orig 2013-11-05 15:18:21.000000000 +0900
- +++ module/vara.pl 2017-11-04 00:33:43.000000000 +0900
- @@ -7,6 +7,7 @@
- use strict;
- #use warnings;
- +use LWP::Simple;
- #------------------------------------------------------------------------------------------------------------
- #
- @@ -341,6 +342,41 @@
- $Form->Set('FROM', "</b>[´+ω+`] $host <b>$from");
- }
- }
- +
- + # VPNGate
- + {
- + my $path = $Sys->Get('BBSPATH') . '/' . $Sys->Get('BBS') . "/info/vpngate.cgi";
- + my $now = time;
- + if (!(-f $path) || (($now - (stat $path)[9]) > 600)) {
- + my $url = 'http://www.vpngate.net/api/iphone/';
- + my $data = get($url);
- + if (defined($data)) {
- + my $addrs = '';
- + while ($data =~ /,(([0-9]{1,3}\.){3}[0-9]{1,3}),/g) {
- + $addrs = $addrs . $1 . "\n";
- + }
- + if (($addrs ne '') && open(my $fh, (-f $path ? '+<' : '>'), $path)) {
- + flock($fh, 2);
- + seek($fh, 0, 0);
- + binmode($fh);
- + print $fh "$addrs";
- + truncate($fh, tell($fh));
- + close($fh);
- + }
- + }
- + }
- +
- + if (open(my $fh, '<', $path)) {
- + while (<$fh>) {
- + chomp($_);
- + if ($addr eq $_) {
- + close($fh);
- + return $ZP::E_REG_NGUSER;
- + }
- + }
- + close($fh);
- + }
- + }
- }
- # pluginに渡す値を設定
Advertisement
Add Comment
Please, Sign In to add comment