mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Merge branch 'next'
This commit is contained in:
@@ -21,8 +21,6 @@
|
||||
|
||||
use strict;
|
||||
|
||||
use Locale::Codes::Country;
|
||||
|
||||
my $col;
|
||||
my $lines = '1';
|
||||
my $lines2 = '';
|
||||
@@ -32,6 +30,8 @@ require "${General::swroot}/location-functions.pl";
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
|
||||
require "${General::swroot}/location-functions.pl";
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
&Header::openpage($Lang::tr{'countries'}, 1, '');
|
||||
@@ -52,8 +52,11 @@ print<<END;
|
||||
</tr>
|
||||
END
|
||||
|
||||
# Init libloc database connection.
|
||||
my $db_handle = &Location::Functions::init();
|
||||
|
||||
# Get a list of all supported country codes.
|
||||
my @countries = Locale::Codes::Country::all_country_codes();
|
||||
my @countries = &Location::database_countries($db_handle);
|
||||
|
||||
# Loop through whole country list.
|
||||
foreach my $country (@countries) {
|
||||
|
||||
@@ -83,8 +83,8 @@ Timo Eissler,
|
||||
Jan Lentfer,
|
||||
Marcus Scholz,
|
||||
Ersan Yildirim,
|
||||
Jörn-Ingo Weigert,
|
||||
Stéphane Pautrel,
|
||||
Joern-Ingo Weigert,
|
||||
Alexander Koch,
|
||||
Wolfgang Apolinarski,
|
||||
Alfred Haas,
|
||||
@@ -108,7 +108,6 @@ David Kleuker,
|
||||
Hans Horsten,
|
||||
Jakub Ratajczak,
|
||||
Jorrit de Jonge,
|
||||
Jörn-Ingo Weigert,
|
||||
Przemek Zdroik,
|
||||
Ramax Lo,
|
||||
Alexander Rudolf Gruber,
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
###############################################################################
|
||||
|
||||
use strict;
|
||||
use Locale::Codes::Country;
|
||||
use Guardian::Socket;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
|
||||
@@ -64,6 +64,7 @@ if (&General::validip($addr)) {
|
||||
# enumerate location information for IP address...
|
||||
my $db_handle = &Location::Functions::init();
|
||||
my $ccode = &Location::Functions::lookup_country_code($db_handle, $addr);
|
||||
my @network_flags = &Location::Functions::address_has_flags($addr);
|
||||
|
||||
# Try to get the continent of the country code.
|
||||
my $continent = &Location::get_continent_code($db_handle, $ccode);
|
||||
@@ -108,6 +109,53 @@ if (&General::validip($addr)) {
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', $addr . " <a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a> (" . $hostname . ') : '.$whois_server);
|
||||
|
||||
# Check if the address has a flag.
|
||||
if (@network_flags) {
|
||||
# Get amount of flags for this network.
|
||||
my $flags_amount = @network_flags;
|
||||
my $processed_flags;
|
||||
|
||||
# The message string which will be displayed.
|
||||
my $message_string = "This address is marked as";
|
||||
|
||||
# Loop through the array of network_flags.
|
||||
foreach my $network_flag (@network_flags) {
|
||||
# Increment value of processed flags.
|
||||
$processed_flags++;
|
||||
|
||||
# Get the network flag name.
|
||||
my $network_flag_name = &Location::Functions::get_full_country_name($network_flag);
|
||||
|
||||
# Add the flag name to the message string.
|
||||
$message_string = "$message_string" . " $network_flag_name";
|
||||
|
||||
# Check if multiple flags are set for this network.
|
||||
if ($flags_amount gt "1") {
|
||||
# Check if the the current flag is the next-to-last one.
|
||||
if ($processed_flags eq $flags_amount - 1) {
|
||||
$message_string = "$message_string" . " and ";
|
||||
|
||||
# Check if the current flag it the last one.
|
||||
} elsif ($processed_flags eq $flags_amount) {
|
||||
# The message is finished add a dot for ending the sentence.
|
||||
$message_string = "$message_string" . ".";
|
||||
|
||||
# Otherwise add a simple comma to the message string.
|
||||
} else {
|
||||
$message_string = "$message_string" . ", ";
|
||||
}
|
||||
} else {
|
||||
# Nothing special to do, simple add a dot to finish the sentence.
|
||||
$message_string = "$message_string" . ".";
|
||||
}
|
||||
}
|
||||
|
||||
# Display the generated notice.
|
||||
print "<h3>$message_string</h3>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
print "<pre>\n";
|
||||
foreach my $line (@lines) {
|
||||
print &Header::cleanhtml($line,"y");
|
||||
|
||||
@@ -71,7 +71,7 @@ if ( $querry[0] eq "conntrack") {
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'connnection tracking'}");
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'connection tracking'}");
|
||||
&Graphs::makegraphbox("netother.cgi", "conntrack", "day");
|
||||
&Header::closebox();
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ END
|
||||
}
|
||||
print <<END;
|
||||
</pre>
|
||||
<tr><td colspan='2'>$Lang::tr{'pakfire accept all'}
|
||||
<tr><td colspan='2'>$Lang::tr{'pakfire uninstall all'}
|
||||
<tr><td colspan='2'>
|
||||
<tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='DELPAKS' value='$cgiparams{'DELPAKS'}' />
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
###############################################################################
|
||||
|
||||
use strict;
|
||||
use Locale::Codes::Country;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
#use warnings;
|
||||
@@ -31,6 +30,9 @@ require "${General::swroot}/location-functions.pl";
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
|
||||
# Init libloc database connection.
|
||||
my $db_handle = &Location::Functions::init();
|
||||
|
||||
#workaround to suppress a warning when a variable is used only once
|
||||
my @dummy = ( ${Header::colouryellow} );
|
||||
undef (@dummy);
|
||||
@@ -321,10 +323,14 @@ END
|
||||
<option value=''>- $Lang::tr{'tor exit country any'} -</option>
|
||||
END
|
||||
|
||||
my @country_names = Locale::Codes::Country::all_country_names();
|
||||
foreach my $country_name (sort @country_names) {
|
||||
my $country_code = Locale::Codes::Country::country2code($country_name);
|
||||
my @country_codes = &Location::database_countries();
|
||||
foreach my $country_code (@country_codes) {
|
||||
# Convert country code into upper case format.
|
||||
$country_code = uc($country_code);
|
||||
|
||||
# Get country name.
|
||||
my $country_name = &Location::Functions::get_country_name($country_code);
|
||||
|
||||
print "<option value='$country_code'";
|
||||
|
||||
if ($settings{'TOR_EXIT_COUNTRY'} eq $country_code) {
|
||||
|
||||
@@ -689,12 +689,12 @@ END
|
||||
my $test = `/usr/bin/openssl verify -CAfile ${General::swroot}/ca/$cahash{$cgiparams{'KEY'}}[0]cert.pem ${General::swroot}/certs/$confighash{$key}[1]cert.pem`;
|
||||
if ($test =~ /: OK/) {
|
||||
# Delete connection
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $key) if (&vpnenabled);
|
||||
unlink ("${General::swroot}/certs/$confighash{$key}[1]cert.pem");
|
||||
unlink ("${General::swroot}/certs/$confighash{$key}[1].p12");
|
||||
delete $confighash{$key};
|
||||
&General::writehasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $key) if (&vpnenabled);
|
||||
}
|
||||
}
|
||||
unlink ("${General::swroot}/ca/$cahash{$cgiparams{'KEY'}}[0]cert.pem");
|
||||
@@ -1227,10 +1227,10 @@ END
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'S', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
} else {
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
$confighash{$cgiparams{'KEY'}}[0] = 'off';
|
||||
&General::writehasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
}
|
||||
sleep $sleepDelay;
|
||||
} else {
|
||||
@@ -1261,12 +1261,12 @@ END
|
||||
&General::readhasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
|
||||
if ($confighash{$cgiparams{'KEY'}}) {
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
unlink ("${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem");
|
||||
unlink ("${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1].p12");
|
||||
delete $confighash{$cgiparams{'KEY'}};
|
||||
&General::writehasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
} else {
|
||||
$errormessage = $Lang::tr{'invalid key'};
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ END
|
||||
;
|
||||
}
|
||||
print<<END
|
||||
<tr><td width='25%' class='base'>$Lang::tr{'wlanap neighbor scan'}: </td><td class='base' >on <input type='radio' name='NOSCAN' value='off' $checked{'NOSCAN'}{'off'} /> | <input type='radio' name='NOSCAN' value='on' $checked{'NOSCAN'}{'on'} /> off</td><td class='base' colspan='2'>$Lang::tr{'wlanap neighbor scan warning'}</td></tr>
|
||||
<tr><td width='25%' class='base'>$Lang::tr{'wlanap neighbor scan'}: </td><td class='base' >$Lang::tr{'on'} <input type='radio' name='NOSCAN' value='off' $checked{'NOSCAN'}{'off'} /> | <input type='radio' name='NOSCAN' value='on' $checked{'NOSCAN'}{'on'} /> $Lang::tr{'off'}</td><td class='base' colspan='2'>$Lang::tr{'wlanap neighbor scan warning'}</td></tr>
|
||||
<tr><td colspan='4'><br></td></tr>
|
||||
<tr><td width='25%' class='base'>$Lang::tr{'wlanap encryption'}: </td><td class='base' colspan='3'>
|
||||
<select name='ENC'>
|
||||
|
||||
Reference in New Issue
Block a user