Early spring clean: Remove trailing whitespaces, and correct licence headers

Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
This commit is contained in:
Peter Müller 2022-02-18 23:54:57 +00:00
parent b5aec71462
commit 66c3619872
511 changed files with 3702 additions and 2564 deletions

View File

@ -62,7 +62,7 @@ $settings{'IP'} = '';
$settings{'ENABLED'} = 'off'; # Every check box must be set to off
$settings{'NAME'} = '';
my @nosaved=('IP','ENABLED','NAME'); # List here ALL setting2 fields. Mandatory
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
@ -94,16 +94,16 @@ if (open(FILE, "$datafile")) {
# Remove if no Setting1 needed
#
if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
#
#Validate static Settings1 here
#
unless ($errormessage) { # Everything is ok, save settings
#map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
#map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
#&General::writehash($setting, \%settings); # Save good settings
#$settings{'ACTION'} = $Lang::tr{'save'}; # Recreate 'ACTION'
#map ($settings{$_}= '',(@nosaved,'KEY1')); # and reinit var to empty
# Rebuild configuration file if needed
&BuildConfiguration;
@ -133,14 +133,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
$temp[2] = '' if ( $temp[2] eq '' );
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
&General::log($Lang::tr{'ip alias changed'});
#Save current
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
print FILE @current;
close(FILE);
# Rebuild configuration file
&BuildConfiguration;
@ -230,7 +230,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
# Handle Suricata related actions.
&HandleSuricata();
##
## if entering data line is repetitive, choose here to not erase fields between each addition
##
@ -253,7 +253,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'edit'}) {
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
splice (@current,$settings{'KEY1'},1); # Delete line
splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
print FILE @current;
close(FILE);
@ -291,7 +291,7 @@ if ($ENV{'QUERY_STRING'} =~ /$sortstring/ ) {
if ($settings{'ACTION'} eq '' ) { # First launch from GUI
$settings{'ENABLED'} ='on';
}
&Header::openpage($Lang::tr{'external aliases configuration'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
my %checked =(); # Checkbox manipulations
@ -314,7 +314,7 @@ END
;
&Header::closebox();
}
#
# Second check box is for editing the list
#
@ -406,7 +406,7 @@ foreach my $line (@current) {
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
@ -488,7 +488,7 @@ END
sub SortDataFile
{
our %entries = ();
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
@ -527,27 +527,27 @@ sub SortDataFile
foreach my $line (@current) {
chomp( $line); #remove newline because can be on field 5 or 6 (addition of REMARK)
my @temp = split (',',$line);
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
# Exemple
# F1,F2,F3,F4,F5 only F1 F2 for sorting
# my @record = ('KEY',$key++,
# 'F1',$temp[0],
# 'F2',$temp[1],
# 'DATA',join(',',@temp[2..4]) ); #group remainning values, with separator (,)
# The KEY,key record permits doublons. If removed, then F1 becomes the key without doublon permitted.
my @record = ('KEY',$key++,'IP',$temp[0],'ENABLED',$temp[1],'NAME',$temp[2]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
# Each field value is printed , with the newline ! Don't forget separator and order of them.
@ -562,7 +562,7 @@ sub SortDataFile
close (FILE);
}
#
#
# Build the configuration file for application aliases
#
sub BuildConfiguration {

View File

@ -53,18 +53,18 @@ foreach (@modems){
my $value= `cat /sys/class/atm/$modem/parameters/$param`;
chomp($param);
chomp($value);
if (!($param =~"uevent")
if (!($param =~"uevent")
&& !($param =~"resource")
&& !($param eq "")
) {
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>";
}else{
print "<tr bgcolor='$color{'color20'}'>";
}
print "<td align='left'>$param</td><td align='left'>$value</td> ";
print "<td align='left'>$param</td><td align='left'>$value</td> ";
}
}
my @pfile = `grep . /sys/class/atm/$modem/device/* 2>/dev/null`;
@ -74,8 +74,8 @@ foreach (@modems){
my $value= `cat /sys/class/atm/$modem/device/$param`;
chomp($param);
chomp($value);
if (!($param =~"uevent")
&& !($param =~"modalias")
if (!($param =~"uevent")
&& !($param =~"modalias")
&& !($param =~"bInterface")
&& !($param =~"bAlternateSetting")
&& !($param =~"bNumEndpoints")
@ -83,14 +83,14 @@ foreach (@modems){
&& !($param =~"resource")
&& !($param eq "")
) {
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>";
}else{
print "<tr bgcolor='$color{'color20'}'>";
}
print "<td align='left'>$param</td><td align='left'>$value</td> ";
print "<td align='left'>$param</td><td align='left'>$value</td> ";
}
}
print "</table><br>\n";

View File

@ -240,7 +240,7 @@ sub readhash
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;

View File

@ -57,7 +57,7 @@ if (length ($ENV{'QUERY_STRING'}) > 0){
($name, $value) = split(/=/, $pair);
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # e.g. "%20" => " "
$value =~ s/[^a-zA-Z0-9]*//g; # a-Z 0-9 will pass
$cgiin{$name} = $value;
$cgiin{$name} = $value;
}
}
@ -96,8 +96,8 @@ if ( $cgiin{'sort_field'} ~~ [ '1','2','3','4','5','6','7','8','9' ] ) {
}
# Read and sort the connection tracking table
# do sorting
if ($SORT_FIELD and $SORT_ORDER) {
# do sorting
if ($SORT_FIELD and $SORT_ORDER) {
# field sorting when sorting arguments are sane
open(CONNTRACK, "/usr/local/bin/getconntracktable | /usr/local/bin/consort.sh $SORT_FIELD $SORT_ORDER |") or die "Unable to read conntrack table";
} else {
@ -247,13 +247,13 @@ if (-e "${General::swroot}/ovpn/settings") {
# Add OpenVPN net for custom OVPNs
if (-e "${General::swroot}/ovpn/ccd.conf") {
open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf");
open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf");
my @ovpnsub = <OVPNSUB>;
close(OVPNSUB);
foreach (@ovpnsub) {
my ($network, $mask) = split '/', (split ',', $_)[2];
$mask = ipv4_cidr2msk($mask) unless &General::validip($mask);
push(@network, $network);

View File

@ -138,7 +138,7 @@ if ( $cgiparams{'ACTION'} eq 'toggle' )
{
$CONNSCHED::config[$cgiparams{'ID'}]{'ACTIVE'} = 'on';
}
&CONNSCHED::WriteConfig;
}
@ -194,7 +194,7 @@ if ( ($cgiparams{'ACTION'} eq 'add') || ($cgiparams{'ACTION'} eq 'update') )
if ( $cgiparams{'ACTION'} eq 'edit' )
{
$i = $cgiparams{'ID'};
$selected_hour = substr($CONNSCHED::config[$i]{'TIME'},0,2);
$selected_minute = substr($CONNSCHED::config[$i]{'TIME'},3,2);
@ -412,7 +412,7 @@ END
my $col="";
for my $id ( 0 .. $#CONNSCHED::config )
{
if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) )
if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) )
{
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
@ -422,7 +422,7 @@ for my $id ( 0 .. $#CONNSCHED::config )
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else
else
{
print "<tr>";
$col="bgcolor='$color{'color22'}'";

View File

@ -47,7 +47,7 @@ my $warnNTPmessage = '';
my @nosaved=();
my %color = ();
#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS
#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS
our $OptionTypes = 'boolean|((un)?signed )?integer (8|16|32)|ip-address|text|string|encapsulate \w+|array of ip-address';
&Header::showhttpheaders();
@ -153,14 +153,14 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
goto ERROR;
}
if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"},
if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'};
goto ERROR;
}
}
if ($dhcpsettings{"END_ADDR_${itf}"}) {
if (!(&General::validip($dhcpsettings{"END_ADDR_${itf}"}))) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
@ -170,9 +170,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'};
goto ERROR;
}
if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"},
if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$netsettings{"${itf}_NETMASK"})) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
goto ERROR;
}
@ -214,7 +214,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
goto ERROR;
}
if (! $dhcpsettings{"DNS1_${itf}"}) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'};
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'};
goto ERROR;
}
}
@ -233,7 +233,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
if (! $dhcpsettings{"WINS1_${itf}"} ) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary wins without specifying primary'};
goto ERROR;
}
}
}
if ($dhcpsettings{"NEXT_${itf}"}) {
if (!(&General::validip($dhcpsettings{"NEXT_${itf}"}))) {
@ -295,14 +295,14 @@ if ($ENV{'QUERY_STRING'} =~ /^FETHER|^FIPADDR/ ) {
&General::writehash($setting, \%dhcpsettings);
&sortcurrent2;
$dhcpsettings{'ACTION'} = 'SORT'; # create an 'ACTION'
map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty
map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty
}
#Sorting of allocated leases
&Header::CheckSortOrder;
## Now manipulate the two multi-line list with Settings2.
## Now manipulate the two multi-line list with Settings2.
# '1' suffix is for ADVANCED OPTIONS
# '2' suffix is for FIXED LEASES
@ -319,12 +319,12 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'toggle enable disable'}.'1') {
open(FILE, ">$filename1") or die 'Unable to open dhcp advanced options file.';
print FILE @current1;
close(FILE);
#Write changes to dhcpd.conf.
&buildconf;
}
if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' &&
$dhcpsettings{'SUBMIT'} ne $Lang::tr{'dhcp advopt help'}) {
@ -334,7 +334,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' &&
if ($dhcpsettings{'ADVOPT_DATA'} eq '') {
$errormessage=$Lang::tr{'dhcp advopt blank value'};
}
# Test for a new option definition string (join field name & data)
if (ExistNewOptionDefinition ($dhcpsettings{'ADVOPT_NAME'} . ' ' . $dhcpsettings{'ADVOPT_DATA'})) {
#only edit permitted if option definition exists
@ -352,7 +352,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' &&
}
unless ($errormessage) {
my $scope = '';
foreach my $itf (@ITFs) { # buils "RED,GREEN,ORANGE,... based on selection
$scope .= $dhcpsettings{"ADVOPT_SCOPE_${itf}"} eq 'on' ? "\t$itf" : "\toff" ;
@ -387,7 +387,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'edit'}.'1') {
if ($itf ne 'off') # Only is an interface name is read
{
$dhcpsettings{"ADVOPT_SCOPE_${itf}"} = 'on';
}
}
}
}
@ -416,7 +416,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'toggle enable disable'}.'2') {
open(FILE, ">$filename2") or die 'Unable to open fixed leases file.';
print FILE @current2;
close(FILE);
#Write changes to dhcpd.conf.
&buildconf;
}
@ -428,7 +428,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') {
if ($dhcpsettings{'FIX_NEXTADDR'}) {
unless(&General::validip($dhcpsettings{'FIX_NEXTADDR'})) { $errormessage = $Lang::tr{'invalid fixed ip address'}; }
}
my $key = 0;
CHECK:foreach my $line (@current2) {
my @temp = split(/\,/,$line);
@ -438,13 +438,13 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') {
# Also it may be needed to put duplicate fixed lease in their right subnet definition..
foreach my $itf (@ITFs) {
my $scoped = &General::IpInSubnet($dhcpsettings{'FIX_ADDR'},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"}) &&
$dhcpsettings{"ENABLE_${itf}"} eq 'on';
if ( $scoped &&
(lc($dhcpsettings{'FIX_MAC'}) eq lc($temp[0])) &&
&General::IpInSubnet($temp[1],
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$errormessage = "$Lang::tr{'mac address in use'} $dhcpsettings{'FIX_MAC'}";
last CHECK;
@ -755,10 +755,10 @@ print <<END
END
;
# Put a checkbox for each interface. Checkbox visible disabled if interface is disabled
# Put a checkbox for each interface. Checkbox visible disabled if interface is disabled
foreach my $itf (@ITFs) {
my $lc_itf=lc($itf);
$checked{'ADVOPT_SCOPE_${itf}'}{'on'} = $dhcpsettings{"ADVOPT_SCOPE_${itf}"} ne 'on' ? '' : "checked='checked'";
$checked{'ADVOPT_SCOPE_${itf}'}{'on'} = $dhcpsettings{"ADVOPT_SCOPE_${itf}"} ne 'on' ? '' : "checked='checked'";
print "$Lang::tr{\"${lc_itf}\"} <input type='checkbox' name='ADVOPT_SCOPE_${itf}' $checked{'ADVOPT_SCOPE_${itf}'}{'on'} ";
print $dhcpsettings{"ENABLE_${itf}"} eq 'on' ? "/>" : "disabled='disabled' />";
print "&nbsp; &nbsp;";
@ -812,7 +812,7 @@ if ($dhcpsettings{'SUBMIT'} eq $Lang::tr{'dhcp advopt help'}) {
print '<tr><td>wpad</td><td>code 252=text</td></tr>';
print '<tr><td>wpad</td><td>"http://www.server.fr/path-to/proxy.pac"</td></tr>';
print '</table>';
}
print <<END
@ -838,7 +838,7 @@ foreach my $line (@current1) {
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
if ($dhcpsettings{'KEY1'} eq $key) {
@ -846,7 +846,7 @@ foreach my $line (@current1) {
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
} else {
print "<tr bgcolor='$color{'color20'}'>";
print "<tr bgcolor='$color{'color20'}'>";
}
print <<END
@ -867,8 +867,8 @@ END
} else {
$global = $Lang::tr{'dhcp advopt scope global'};
}
# Print each checked interface
for (my $key=0; $key<@ITFs; $key++) {
my $itf = $temp[3+$key];
@ -1024,18 +1024,18 @@ my %ipoutside = ();
foreach my $line (@current2) {
my @temp = split(/\,/,$line);
$macdupl{$temp[0]} += 1;
if ($macdupl{$temp[0]} > 1) {
if ($macdupl{$temp[0]} > 1) {
$ipdup = 1; # Flag up duplicates for use later
}
$ipinuse{$temp[1]} += 1;
if ($ipinuse{$temp[1]} > 1) {
if ($ipinuse{$temp[1]} > 1) {
$ipdup = 1; # Flag up duplicates for use later
}
# Mark IP addresses outwith known subnets
$ipoutside{$temp[1]} = 1;
foreach my $itf (@ITFs) {
if ( &General::IpInSubnet($temp[1],
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$ipoutside{$temp[1]} = 0;
}
@ -1055,7 +1055,7 @@ foreach my $line (@current2) {
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
# Skip all entries that do not match the search query
@ -1081,15 +1081,15 @@ foreach my $line (@current2) {
my $TAG2 = '';
my $TAG3 = '';
my $TAG4 = '';
if ($ipinuse{$temp[1]} > 1) {
if ($ipinuse{$temp[1]} > 1) {
$TAG0 = '<b>';
$TAG1 = '</b>';
}
if ($macdupl{$temp[0]} > 1) {
if ($macdupl{$temp[0]} > 1) {
$TAG2 = '<b>';
$TAG3 = '</b>';
}
if ($ipoutside{$temp[1]} > 0) {
if ($ipoutside{$temp[1]} > 0) {
$TAG4 = "bgcolor='orange'" if ($dhcpsettings{'KEY2'} ne $key);
}
@ -1230,7 +1230,7 @@ sub sortcurrent2
# use combination of ether & IP as key to allow duplicates in either but not both
$entries{$record->{FETHER} . $record->{FIPADDR}} = $record; # add this to a hash of hashes
}
open(FILE, ">$filename2") or die 'Unable to open fixed lease file.';
foreach my $entry ( sort fixedleasesort keys %entries) {
print FILE "$entries{$entry}->{FETHER},$entries{$entry}->{FIPADDR},$entries{$entry}->{DATA}\n";
@ -1243,7 +1243,7 @@ sub sortcurrent2
close (FILE);
undef (%entries); #This array is reused latter. Clear it.
}
# Build the configuration file mixing settings, fixed leases and advanced options
sub buildconf {
open(FILE, ">/${General::swroot}/dhcp/dhcpd.conf") or die "Unable to write dhcpd.conf file";
@ -1263,7 +1263,7 @@ sub buildconf {
} else {
print FILE "ddns-update-style none;\n";
}
# Write first new option definition
foreach my $line (@current1) {
chomp($line); # remove newline
@ -1276,7 +1276,7 @@ sub buildconf {
foreach my $line (@current1) {
chomp($line); # remove newline
my @temp = split(/\t/,$line);
if ($temp[0] eq 'on' && !ExistNewOptionDefinition ($temp[1] . ' ' . $temp[2])){ # active & !definition
my $global=1;
for (my $key=0; $key<@ITFs; $key++) {
@ -1289,7 +1289,7 @@ sub buildconf {
if ($global) {
print FILE "option $temp[1] $temp[2];\n";
}
}# on
}# on
}# foreach line
print FILE "\n";
@ -1329,7 +1329,7 @@ sub buildconf {
foreach my $line (@current1) {
chomp($line); # remove newline
my @temp = split(/\t/,$line); # Use TAB separator !
if ($temp[0] eq 'on'){
for (my $key=0; $key<@ITFs; $key++) {
if ($itf eq $temp[3+$key]) # Only is an interface name is read
@ -1337,7 +1337,7 @@ sub buildconf {
print FILE "\toption $temp[1] $temp[2];\n";
}
}
}# on
}# on
}# foreach line
print FILE "} #$itf\n\n";

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
# enable only the following on debugging purpose

View File

@ -100,8 +100,8 @@ END
;
&General::system("/usr/local/bin/extrahdctrl", "mount", "$extrahdsettings{'PATH'}");
}
}
elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'})
}
elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'})
{
if ( &General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) {
open( FILE, "< $devicefile" ) or die "Unable to read $devicefile";

View File

@ -100,7 +100,7 @@ my @protocols;
&General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
&General::readhash($fwoptions, \%optionsfw);
&General::readhash($fwoptions, \%optionsfw);
&General::readhash($ifacesettings, \%ifaces);
&General::readhash("$configovpn", \%ovpnsettings);
&General::readhash("$configipsecrw", \%ipsecsettings);
@ -554,7 +554,7 @@ sub checksource
if (&General::validport($_)){
push (@values,$_);
}else{
}
}
}
@ -836,7 +836,7 @@ sub checkrule
if (&General::validport($_)){
push (@values,$_);
}else{
}
}
}
@ -974,16 +974,16 @@ sub checkvpn
# A Test if manual ip is part of dynamic openvpn subnet is made in getcolor
# because if one creates a custom host with the ip, we need to check the color there!
# It does not make sense to check this here
# Test if manual IP is part of an OpenVPN N2N subnet does also not make sense here
# Is also checked in getcolor
# Test if manual ip is part of an IPsec Network is also checked in getcolor
return 1;
}
sub checkvpncolor
{
}
sub deleterule
{
@ -1247,7 +1247,7 @@ END
print"<tr><td valign='top'><input type='radio' name='$grp' id='ipsec_net_$srctgt' value='ipsec_net_$srctgt' $checked{$grp}{'ipsec_net_'.$srctgt}></td><td >$Lang::tr{'fwhost ipsec net'}</td><td align='right'><select name='ipsec_net_$srctgt' style='width:200px;'><select></td></tr>";
}
if ($show eq '1'){$show='';print"</select></td></tr>";}
print"</table>";
print"</td></tr></table><br>";
}
@ -1585,10 +1585,10 @@ sub newrule
$fwdfwsettings{'RULE_ACTION'} = $hash{$key}[0];
$fwdfwsettings{'chain'} = $hash{$key}[1];
$fwdfwsettings{'ACTIVE'} = $hash{$key}[2];
$fwdfwsettings{'grp1'} = $hash{$key}[3];
$fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4];
$fwdfwsettings{'grp2'} = $hash{$key}[5];
$fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6];
$fwdfwsettings{'grp1'} = $hash{$key}[3];
$fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4];
$fwdfwsettings{'grp2'} = $hash{$key}[5];
$fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6];
$fwdfwsettings{'USE_SRC_PORT'} = $hash{$key}[7];
$fwdfwsettings{'PROT'} = $hash{$key}[8];
$fwdfwsettings{'ICMP_TYPES'} = $hash{$key}[9];
@ -1695,7 +1695,7 @@ sub newrule
if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){
$fwdfwsettings{'oldorange'} ='on';
}
}
}
}
# Split manual source and target address and delete the subnet
my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
@ -1811,7 +1811,7 @@ END
#---TARGET------------------------------------------------------
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
print<<END;
<table width='100%' border='0'>
<table width='100%' border='0'>
<tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr' checked></td><td width='60%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16' maxlength='18'><td width='1%'><input type='radio' name='grp2' id='ipfire' value='ipfire' $checked{'grp2'}{'ipfire'}></td><td><b>Firewall</b></td>
END
print"<td align='right'><select name='ipfire' style='width:200px;'>";
@ -2031,7 +2031,7 @@ END
print"<tr><td width='12%'>$Lang::tr{'remark'}:</td><td width='88%' align='left'><input type='text' name='ruleremark' maxlength='255' value='$fwdfwsettings{'ruleremark'}' style='width:99%;'></td></tr>";
if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on'){
print "<tr><td width='12%'>$Lang::tr{'fwdfw rulepos'}:</td><td><select name='rulepos' >";
for (my $count =1; $count <= $sum; $count++){
for (my $count =1; $count <= $sum; $count++){
print"<option value='$count' ";
print"selected='selected'" if($fwdfwsettings{'oldrulenumber'} eq $count);
print">$count</option>";
@ -2110,7 +2110,7 @@ END
print "<option $selected{'TIME_FROM'}{$time}>$i:$j</option>\n";
}
}
print<<END;
print<<END;
</select> &dash;
<select name='TIME_TO'>
END
@ -2590,7 +2590,7 @@ END
$color="$color{'color14'}";
$coloryellow='';
}elsif($coloryellow eq ''){
if ($count % 2){
if ($count % 2){
$color="$color{'color22'}";
}
else{

View File

@ -145,7 +145,7 @@ if ($fwhostsettings{'ACTION'} eq 'updatenet' )
$fwhostsettings{'netremark'} = $customnetwork{$key}[3];
$fwhostsettings{'count'} = $customnetwork{$key}[4];
delete $customnetwork{$key};
}
}
&General::writehasharray("$confignet", \%customnetwork);
@ -284,7 +284,7 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
#convert ip if leading '0' exists
$fwhostsettings{'IP'} = &Network::ip_remove_zero($fwhostsettings{'IP'});
#check valid ip
#check valid ip
if (!&General::validipandmask($fwhostsettings{'IP'}."/".$fwhostsettings{'SUBNET'}))
{
$errormessage=$errormessage.$Lang::tr{'fwhost err addr'};
@ -448,7 +448,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
}
}
#only check plausi when no error till now
if (!$errormessage){
if (!$errormessage){
&plausicheck("edithost");
}
if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newhost'} ne 'on' && $errormessage){
@ -465,7 +465,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost')
$customhost{$key}[3] = $fwhostsettings{'orgremark'};
&General::writehasharray("$confighost", \%customhost);
undef %customhost;
}
}
if (!$errormessage){
#get count if host was edited
if($fwhostsettings{'actualize'} eq 'on'){
@ -560,7 +560,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
#check standard networks
if ($fwhostsettings{'grp2'} eq 'std_net'){
@target=$fwhostsettings{'DEFAULT_SRC_ADR'};
$type='Standard Network';
$type='Standard Network';
}
#check custom networks
if ($fwhostsettings{'grp2'} eq 'cust_net' && $fwhostsettings{'CUST_SRC_NET'} ne ''){
@ -626,7 +626,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
$fwhostsettings{'remark'}='';
}
#check if host/net exists in grp
my $test="$grp,$fwhostsettings{'oldremark'},@target,$type";
foreach my $key (keys %customgrp) {
my $test1="$customgrp{$key}[0],$customgrp{$key}[1],$customgrp{$key}[2],$customgrp{$key}[3]";
@ -636,7 +636,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp')
}
}
}
if (!$errormessage){
#on first save, we have an empty @target, so fill it with nothing
my $targetvalues=@target;
@ -1168,7 +1168,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpremark')
{
$customgrp{$key}[1]='';
$customgrp{$key}[1]=$fwhostsettings{'newrem'};
}
}
}
&General::writehasharray("$configgrp", \%customgrp);
$fwhostsettings{'update'}='on';
@ -1218,7 +1218,7 @@ if ($fwhostsettings{'ACTION'} eq 'changesrvgrpremark')
{
$customservicegrp{$key}[1]='';
$customservicegrp{$key}[1]=$fwhostsettings{'newsrvrem'};
}
}
}
&General::writehasharray("$configsrvgrp", \%customservicegrp);
$fwhostsettings{'updatesrvgrp'}='on';
@ -1323,7 +1323,7 @@ sub showmenu {
<tr><td colspan='6'></td></tr></table>
END
&Header::closebox();
}
# Add
sub addnet
@ -1367,11 +1367,11 @@ END
if ($fwhostsettings{'ACTION'} eq 'edithost' || $fwhostsettings{'error'} eq 'on')
{
print " <td colspan='4' align='right'><input type='submit' value='$Lang::tr{'update'}' style='min-width:100px;'/><input type='hidden' name='ACTION' value='updatehost'><input type='hidden' name='orgremark' value='$fwhostsettings{'orgremark'}' ><input type='hidden' name='orgname' value='$fwhostsettings{'orgname'}' ><input type='hidden' name='update' value='on'><input type='hidden' name='newhost' value='$fwhostsettings{'newhost'}'></form>";
}else{
print " <td colspan='4' align='right'><input type='submit' name='savehost' value='$Lang::tr{'save'}' style='min-width:100px;' /><input type='hidden' name='ACTION' value='savehost' /><input type='hidden' name='newhost' value='on'>";
}
}
print " </form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;' ><input type='hidden' name='ACTION' value='resethost'></form></td></tr></table>";
&Header::closebox();
}
@ -1397,7 +1397,7 @@ sub addgrp
$fwhostsettings{'oldgrpname'}=$fwhostsettings{'grp_name'};
my $grp=$fwhostsettings{'grp_name'};
my $rem=$fwhostsettings{'remark'};
if ($fwhostsettings{'update'} eq ''){
if ($fwhostsettings{'update'} eq ''){
print<<END;
<table width='100%' border='0'>
<tr>
@ -1869,9 +1869,9 @@ sub viewtablenet
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);
if (!keys %customnetwork)
{
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
if (!keys %customnetwork)
{
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table width='100%' cellspacing='0' class='tbl'>
@ -1885,7 +1885,7 @@ END
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count % 2)
{
{
$col="bgcolor='$color{'color20'}'";
print" <tr>";
}else
@ -1915,7 +1915,7 @@ END
}
print"</table>";
&Header::closebox();
}
}
}
sub getcolor
@ -2015,9 +2015,9 @@ sub viewtablehost
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);
&General::readhasharray("$configgrp", \%customgrp);
if (!keys %customhost)
{
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
if (!keys %customhost)
{
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table width='100%' cellspacing='0' class='tbl'>
@ -2085,7 +2085,7 @@ sub viewtablegrp
my $delflag;
my @counter;
my %hash;
if (!keys %customgrp)
if (!keys %customgrp)
{
print "<center><b>$Lang::tr{'fwhost err emptytable'}</b>";
}else{
@ -2136,7 +2136,7 @@ sub viewtablegrp
print"<tr>";
$col="bgcolor='$color{'color22'}'";
}
my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]);
my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]);
if ($ip eq ''){
print"<tr>";
$col="bgcolor='${Header::colouryellow}'";
@ -2548,7 +2548,7 @@ sub checkname
}
}
return 1;
}
sub checkgroup
{
@ -2574,7 +2574,7 @@ sub checkservice
}
sub checkip
{
my %hash=%{(shift)};
my $a=shift;
foreach my $key (keys %hash) {
@ -2603,7 +2603,7 @@ sub checkservicegroup
foreach my $key (keys %customservicegrp) {
if( $customservicegrp{$key}[0] eq $fwhostsettings{'SRVGRP_NAME'} ){
$errormessage.=$Lang::tr{'fwhost err grpexist'}."<br>";
}
}
}
@ -2667,7 +2667,7 @@ sub get_name
foreach my $network (sort keys %defaultNetworks)
{
return "$network" if ($val eq $defaultNetworks{$network}{'NAME'});
}
}
}
sub gethostcount
{
@ -2827,7 +2827,7 @@ sub deletefromgrp
}
}
&General::writehasharray("$config",\%hash);
}
sub plausicheck
{
@ -2893,13 +2893,13 @@ sub plausicheck
$errormessage=$errormessage."<br>".$Lang::tr{'fwhost err netexist'};
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;}
}
#check if network ip already exists
}
#check if network ip already exists
if (!&checkip(\%customnetwork,1))
{
$errormessage=$errormessage."<br>".$Lang::tr{'fwhost err net'};
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;}
}
}
#check if host with this name already exists
&General::readhasharray("$confighost", \%customhost);
if (!&checkname(\%customhost))
@ -2920,7 +2920,7 @@ sub getipforgroup
my $name=$_[0],
my $type=$_[1];
my $value;
#get address from IPSEC NETWORK
if ($type eq 'IpSec Network'){
foreach my $key (keys %ipsecconf) {
@ -2946,7 +2946,7 @@ sub getipforgroup
}
&deletefromgrp($name,$configgrp);
}
#get address from IPSEC HOST
if ($type eq 'IpSec Host'){
foreach my $key (keys %ipsecconf) {
@ -2956,7 +2956,7 @@ sub getipforgroup
}
&deletefromgrp($name,$configgrp);
}
#get address from ovpn ccd Net-2-Net
if ($type eq 'OpenVPN N-2-N'){
foreach my $key (keys %ccdhost) {
@ -2968,7 +2968,7 @@ sub getipforgroup
}
&deletefromgrp($name,$configgrp);
}
#get address from ovpn ccd static host
if ($type eq 'OpenVPN static host'){
foreach my $key (keys %ccdhost) {
@ -2980,7 +2980,7 @@ sub getipforgroup
}
&deletefromgrp($name,$configgrp);
}
#get address from ovpn ccd static net
if ($type eq 'OpenVPN static network'){
foreach my $key (keys %ccdnet) {
@ -2991,7 +2991,7 @@ sub getipforgroup
}
}
}
#check custom addresses
if ($type eq 'Custom Host'){
foreach my $key (keys %customhost) {
@ -3001,7 +3001,7 @@ sub getipforgroup
}
}
}
##check custom networks
if ($type eq 'Custom Network'){
foreach my $key (keys %customnetwork) {
@ -3010,7 +3010,7 @@ sub getipforgroup
}
}
}
#check standard networks
if ($type eq 'Standard Network'){
if ($name =~ /OpenVPN/i){
@ -3060,7 +3060,7 @@ sub decrease
}
}
}
if (($customgrp{$key}[0] eq $grp) && ($customgrp{$key}[3] eq 'Custom Host')){
foreach my $key2 (sort keys %customhost){
if ($customhost{$key2}[0] eq $customgrp{$key}[2]){
@ -3068,7 +3068,7 @@ sub decrease
last;
}
}
}
}
&General::writehasharray("$confignet", \%customnetwork);
@ -3079,7 +3079,7 @@ sub decreaseservice
my $grp=$_[0];
&General::readhasharray("$configsrv", \%customservice);
&General::readhasharray("$configsrvgrp", \%customservicegrp);
foreach my $key (sort keys %customservicegrp){
if ($customservicegrp{$key}[0] eq $grp ){
foreach my $key2 (sort keys %customservice){
@ -3090,7 +3090,7 @@ sub decreaseservice
}
}
&General::writehasharray("$configsrv", \%customservice);
}
sub changenameinfw
{
@ -3130,7 +3130,7 @@ sub changenameinfw
}
sub checkports
{
my %hash=%{(shift)};
#check empty fields
if ($fwhostsettings{'SRV_NAME'} eq '' ){
@ -3145,7 +3145,7 @@ sub checkports
}
#change dashes with :
$fwhostsettings{'SRV_PORT'}=~ tr/-/:/;
if ($fwhostsettings{'SRV_PORT'} eq "*") {
$fwhostsettings{'SRV_PORT'} = "1:65535";
}

View File

@ -52,8 +52,8 @@ my $range = lc $query{'range'}; # lower case
unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~ @Graphs::time_ranges)) {
# Send HTTP headers
_start_svg_output();
_print_error("URL parameters missing or malformed.");
_print_error("URL parameters missing or malformed.");
exit;
}
@ -62,13 +62,13 @@ unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~
unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) {
# Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range]
my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}";
# Send HTTP redirect
print "Status: 302 Found\n";
print "Location: $location\n";
print "Content-type: text/html; charset=UTF-8\n";
print "\n"; # End of HTTP headers
print "Unsupported origin, request redirected to '$location'";
exit;
}

View File

@ -57,7 +57,7 @@ print <<END;
$Lang::tr{'gpl please read carefully the general public license and accept it below'}.
<br /><br />
END
;
;
if ( -e "/usr/share/doc/licenses/GPLv3" ) {
print '<textarea rows=\'25\' cols=\'75\' readonly=\'readonly\'>';

View File

@ -54,7 +54,7 @@ $settings{'HOST'} = '';
$settings{'DOM'} = '';
$settings{'PTR'} = '';
my @nosaved=('EN','IP','HOST','DOM','PTR'); # List here ALL setting2 fields. Mandatory
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
@ -101,14 +101,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
$temp[0] = $temp[0] ne '' ? '' : 'on'; # Toggle the field
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
&General::log($Lang::tr{'hosts config changed'});
#Save current
open(FILE, ">$datafile") or die 'hosts datafile error';
print FILE @current;
close(FILE);
# Rebuild configuration file
&BuildConfiguration;
}
@ -140,7 +140,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
&BuildConfiguration; # then re-build new host
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
@ -162,7 +162,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'edit'}) {
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
splice (@current,$settings{'KEY1'},1); # Delete line
splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'hosts datafile error';
print FILE @current;
close(FILE);
@ -331,7 +331,7 @@ foreach my $line (@current) {
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
if ($temp[4] eq '' || $temp[4] eq 'on') {
@ -418,7 +418,7 @@ END
sub SortDataFile
{
our %entries = ();
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
@ -462,13 +462,13 @@ sub SortDataFile
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
my @record = ('KEY',$key++,'EN',$temp[0],'IP',$temp[1],'HOST',$temp[2],'DOM',$temp[3],'PTR',$temp[4]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
open(FILE, ">$datafile") or die 'hosts datafile error';
# Each field value is printed , with the newline ! Don't forget separator and order of them.

View File

@ -113,7 +113,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'dial profile'})
chmod 0600, "${General::swroot}/ppp/secrets";
close FILE;
&General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}");
&General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}");
$cgiparams{'ACTION'} = "$Lang::tr{'dial'}";
}
@ -138,7 +138,7 @@ for ($c = 1; $c <= $maxprofiles; $c++)
}
my %selected;
for ($c = 1; $c <= $maxprofiles; $c++) {
$selected{'PROFILE'}{$c} = '';
$selected{'PROFILE'}{$c} = '';
}
$selected{'PROFILE'}{$pppsettings{'PROFILE'}} = "selected='selected'";
my $dialButtonDisabled = "disabled='disabled'";
@ -572,7 +572,7 @@ foreach my $line (@df) {
# and root size should not vary during time
$warnmessage .= "<li>$Lang::tr{'filesystem full'}: $temp[0] <b>$Lang::tr{'free'}=$1M</b> !</li>";
}
} else {
# $line =~ m/^.* (\d+)m.*$/;
$line =~ m/^.* (\d+)\%.*$/;

View File

@ -100,7 +100,7 @@ END
}
$chainname = $chainstring[1];
$chains{$chainname."start"} = $lines;
$chains{$chainname."start"} = $lines;
}
$lines++;
@ -222,11 +222,11 @@ END
}
$chainname = $chainstring[1];
$chainsman{$chainname."start"} = $manlines;
$chainsman{$chainname."start"} = $manlines;
}
$manlines++;
}
$chainsman{$chainname."end"} = $manlines-1;
close (FILE);
@ -349,11 +349,11 @@ END
}
$chainname = $chainstring[1];
$chainsnat{$chainname."start"} = $natlines;
$chainsnat{$chainname."start"} = $natlines;
}
$natlines++;
}
$chainsnat{$chainname."end"} = $natlines-1;
close (FILE);

View File

@ -39,7 +39,7 @@ my $hintcolour='#FFFFCC';
my $commandline='';
my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'},
@ -350,7 +350,7 @@ print <<END
<select name='DAY_BEGIN'>
END
;
for ($day_begin = 1; $day_begin <= 31; $day_begin++)
for ($day_begin = 1; $day_begin <= 31; $day_begin++)
{
print "\t<option ";
if ($day_begin == $reportsettings{'DAY_BEGIN'}) {
@ -364,7 +364,7 @@ print <<END
<select name='YEAR_BEGIN'>
END
;
for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
{
print "\t<option ";
if ($year_begin == $reportsettings{'YEAR_BEGIN'}) {
@ -393,7 +393,7 @@ print <<END
<select name='DAY_END'>
END
;
for ($day_end = 1; $day_end <= 31; $day_end++)
for ($day_end = 1; $day_end <= 31; $day_end++)
{
print "\t<option ";
if ($day_end == $reportsettings{'DAY_END'}) {
@ -407,7 +407,7 @@ print <<END
<select name='YEAR_END'>
END
;
for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
{
print "\t<option ";
if ($year_end == $reportsettings{'YEAR_END'}) {

View File

@ -122,7 +122,7 @@ my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{
{
my $xday;
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
@ -216,7 +216,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
print "$time $3\r\n";
}
exit 0;
}
@ -248,7 +248,7 @@ for (my $month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@ -261,11 +261,11 @@ print <<END
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
@ -298,7 +298,7 @@ if ($start == 0) {
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
my $next;
if ($start == $lastPageIndex) {
$next = -1;
@ -339,7 +339,7 @@ foreach $_ (@log)
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
my $chain = $3;
my $chain = $3;
my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
if ($packet =~ /PHYSIN=(\w+)/) { $iface=$1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
@ -364,7 +364,7 @@ foreach $_ (@log)
my $servi = uc(getservbyport($srcport, lc($proto)));
if ($servi ne '' && $srcport < 1024) {
$srcport = "$srcport($servi)";
$srcport = "$srcport($servi)";
}
$servi = uc(getservbyport($dstport, lc($proto)));
if ($servi ne '' && $dstport < 1024) {
@ -375,11 +375,11 @@ foreach $_ (@log)
my $col="";
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
$col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
$col="bgcolor='$color{'color22'}'";
}
print <<END
@ -428,21 +428,21 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'first'} $Lang::tr{'older'}";
print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";

View File

@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@ -150,7 +150,7 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
my $day = $cgiparams{'DAY'};
my $daystr='';
if ($day <= 9) {
$daystr = " $day";
$daystr = " $day";
}
else {
$daystr = $day;
@ -182,7 +182,7 @@ if (!$skip)
$lines++;
}
}
close (FILE);
close (FILE);
}
$skip=0;
@ -249,7 +249,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -386,7 +386,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];

View File

@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@ -181,7 +181,7 @@ if (!$skip)
$lines++;
}
}
close (FILE);
close (FILE);
}
$skip=0;
@ -237,7 +237,7 @@ for ($month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@ -249,11 +249,11 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
@ -359,7 +359,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];
@ -437,7 +437,7 @@ for($s=0;$s<$lines;$s++)
# Get country code.
my $ccode = &Location::Functions::lookup_country_code($key[$s]);
$color++;
print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";

View File

@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@ -249,7 +249,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -360,7 +360,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];

View File

@ -71,7 +71,7 @@ if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
my @temp = split(',',$ ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@ -116,7 +116,7 @@ if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
my $lastleap=($year-1)%4;
my $lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$doy+366;
@ -158,7 +158,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "IPFire IPS log\r\n";
print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
@ -231,7 +231,7 @@ print <<END
<select name='DAY'>
END
;
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {

View File

@ -329,7 +329,7 @@ unless ($errormessage) {
}
# If nothing has been fetched, the amount of lines is still zero.
# In this case display a hint about no data.
# In this case display a hint about no data.
unless ($lines) {
print "<tr><td bgcolor='$color{'color22'}' colspan='6' align='center'>$Lang::tr{'no entries'}</td></tr>\n";
}

View File

@ -50,7 +50,7 @@ my $doy = $now[7]; # day of year (0..364)
my $tdoy = $now[7];
my $year = $now[5]+1900;
$cgiparams{'DAY'} = $now[3];
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'SOURCE_IP'} = 'ALL';
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
@ -70,7 +70,7 @@ if ($cgiparams{'ACTION'} eq '')
if ($cgiparams{'ACTION'} eq $Lang::tr{'restore defaults'})
{
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
$cgiparams{'ENABLE_FILTER'} = 'off';
$cgiparams{'ENABLE_FILTER'} = 'off';
}
{
@ -88,7 +88,7 @@ if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
my @temp = split(',',$ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'SOURCE_IP'} = $temp[3];
$cgiparams{'USERNAME'} = &Header::escape($temp[4]);
}
@ -151,7 +151,7 @@ my $daystr = $cgiparams{'DAY'} == 0 ? '' :$cgiparams{'DAY'} <= 9 ? "0$cgiparams{
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$daystr = "$longmonths[$cgiparams{'MONTH'}] $daystr, ". int($year-1);
} else {
@ -210,14 +210,14 @@ if ($@ ne '')
$temp_now[2] = $temp_now[1] = $temp_now[0] = 0; # start at 00:00:00
$temp_now[3] = 1 if ($cgiparams{'DAY'}==0); # All days selected, start at '1'
my $mintime = POSIX::mktime(@temp_now);
my $mintime = POSIX::mktime(@temp_now);
my $maxtime;
if ($cgiparams{'DAY'}==0) { # full month
if ($temp_now[4]++ == 12){
$temp_now[4] = 0;
$temp_now[5]++;
};
$maxtime = POSIX::mktime(@temp_now);
$maxtime = POSIX::mktime(@temp_now);
} else {
$maxtime = $mintime + 86400; # full day
}
@ -248,7 +248,7 @@ if ($@ ne '')
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
}
}
}
# finish loop when date of lines are past maxtime
@ -278,7 +278,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "IPFire proxy log\r\n";
print "$Lang::tr{'date'}: $daystr\r\n";
print "$Lang::tr{'date'}: $daystr\r\n";
print "Source IP: $cgiparams{'SOURCE_IP'}\r\n";
print "Username: $cgiparams{'USERNAME'}\r\n";
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
@ -350,7 +350,7 @@ print <<END
END
;
print "<option value='0'>$Lang::tr{'all'}</option>";
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -464,7 +464,7 @@ foreach $_ (@log)
$url =~ /(^.{0,60})/;
my $part = $1;
unless (length($part) < 60) { $part = "${part}..."; }
unless (length($part) < 60) { $part = "${part}..."; }
$url = &Header::cleanhtml($url,"y");
$part = &Header::cleanhtml($part,"y");
if ($cgiparams{'DAY'}==0) { # full month

View File

@ -3,7 +3,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
@ -168,7 +168,7 @@ if (!$skip)
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
# Extract ipv4 and ipv6 addresses
if (($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
$srcaddr = $1;
$srcaddr = $1;
}
if($iface eq $country) {
@ -186,7 +186,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@ -257,7 +257,7 @@ for ($month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@ -269,7 +269,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -295,7 +295,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@ -336,9 +336,9 @@ foreach $_ (@slice)
if (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=.*)$/) {}
elsif (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {};
my $packet = $4;
my $iface = '';
my $iface = '';
# If ipv6 uses bridge, use PHYSIN otherwise use IN
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
if ( $1 =~ /2./ ){ $iface=""; }
my $srcaddr = '';
# Extract ipv4 and ipv6 addresses
@ -377,10 +377,10 @@ foreach $_ (@slice)
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@ -432,19 +432,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@ -3,7 +3,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
@ -162,7 +162,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@ -230,7 +230,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -256,7 +256,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@ -320,10 +320,10 @@ foreach $_ (@slice) {
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@ -375,19 +375,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@ -4,14 +4,14 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
#Aug 28 14:54:30 shite kernel: IN=ppp0 OUT= MAC= SRC=213.48.150.1
#DST=213.208.115.234 LEN=110 TOS=0x00 PREC=0x00 TTL=60 ID=30699 DF PROTO=TCP
#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
use strict;
@ -170,7 +170,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@ -238,7 +238,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -264,7 +264,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@ -330,10 +330,10 @@ foreach $_ (@slice)
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@ -385,19 +385,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@ -152,7 +152,7 @@ print <<END
<select name='DAY'>
END
;
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {

View File

@ -107,8 +107,8 @@ if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
@temp = split(',',$ ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'LOGTYPE'} = $temp[3];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'LOGTYPE'} = $temp[3];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@ -153,7 +153,7 @@ if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
$lastleap=($year-1)%4;
$lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$tdoy+366;
@ -180,7 +180,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
print "Content-type: text/plain\n\n";
print "IPCop URL filter log\r\n";
print "Section: $cgiparams{'LOGTYPE'}\r\n";
print "Date: $daystr $longmonthstr\r\n";
print "Date: $daystr $longmonthstr\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
@ -258,7 +258,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@ -434,7 +434,7 @@ sub processevent
close(LOG);
}
}
@log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
@log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
}
}

View File

@ -45,11 +45,11 @@ my $errormessage = '';
if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
$macsettings{'MAC'} =~ s/\-/:/g;
my @mac = split(/:/,$macsettings{"MAC"});
if ($#mac == 5) {
if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
last;
last;
}
}
} else {
@ -58,11 +58,11 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
$macsettings{'MAC1'} =~ s/\-/:/g;
if ( not ($macsettings{'MAC1'} eq "" )) {
my @mac = split(/:/,$macsettings{"MAC1"});
if ($#mac == 5) {
if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
last;
last;
}
}
} else {
@ -72,11 +72,11 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
$macsettings{'MAC2'} =~ s/\-/:/g;
if ( not ($macsettings{'MAC2'} eq "" )) {
my @mac = split(/:/,$macsettings{"MAC2"});
if ($#mac == 5) {
if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
last;
last;
}
}
} else {
@ -87,8 +87,8 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
$macsettings{'MAC'} =~ s/\:/-/g;
$macsettings{'MAC1'} =~ s/\:/-/g;
$macsettings{'MAC2'} =~ s/\:/-/g;
&General::writehash("${General::swroot}/mac/settings", \%macsettings);
&Header::openbox('100%', 'left', $Lang::tr{'mac address saved'});
&General::writehash("${General::swroot}/mac/settings", \%macsettings);
&Header::openbox('100%', 'left', $Lang::tr{'mac address saved'});
print "<font class='base'>$Lang::tr{'mac address saved txt'}</font>\n";
&Header::closebox();
}
@ -97,13 +97,13 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'reconnect'}) {
&General::system_background("/usr/local/bin/redctrl", "restart");
&Header::openbox('100%', 'left', $Lang::tr{'mac address recon'} );
print "<font class='base'>$Lang::tr{'mac address done'}</font>\n";
&Header::closebox();
&Header::closebox();
}
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
system("cat /dev/null > ${General::swroot}/mac/settings &");
&Header::openbox('100%', 'left', $Lang::tr{'mac address deleted'} );
print "<font class='base'>$Lang::tr{'mac address deleted txt'}</font>\n";
&Header::closebox();
&Header::closebox();
}
if ($macsettings{'ACTION'} eq $Lang::tr{'reboot'}) {
&General::log($Lang::tr{'rebooting ipfire'});
@ -138,17 +138,17 @@ print <<END
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
print <<END
print <<END
<input type="text" name="MAC" maxlength="17" value=''/></td>
END
;
} else {
} else {
print <<END
<input type="text" name="MAC" maxlength="17" value='$macsettings{"MAC"}'/></td>
END
;
}
print <<END
;
}
print <<END
</tr>
<tr>
<td>&nbsp;</td>
@ -158,17 +158,17 @@ print <<END
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
print <<END
print <<END
<input type="text" name="MAC1" maxlength="17" value=''/></td>
END
;
} else {
} else {
print <<END
<input type="text" name="MAC1" maxlength="17" value='$macsettings{"MAC1"}'/></td>
END
;
}
print <<END
;
}
print <<END
</tr>
<tr>
<td>&nbsp;</td>
@ -178,18 +178,18 @@ print <<END
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
print <<END
print <<END
<input type="text" name="MAC2" maxlength="17" value=''/></td>
END
;
} else {
} else {
print <<END
<input type="text" name="MAC2" maxlength="17" value='$macsettings{"MAC2"}'/></td>
END
;
}
;
}
print <<END
print <<END
</tr>
<tr>
<td colspan="2"><br><hr /></td>
@ -208,7 +208,7 @@ print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' />
END
;
} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") {
} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
&nbsp;&nbsp;&nbsp;&nbsp;
@ -217,12 +217,12 @@ print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'reconnect'}' />
END
;
} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
END
;
} else {
} else {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
&nbsp;&nbsp;&nbsp;&nbsp;

View File

@ -18,9 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use MIME::Lite;
#enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
@ -157,14 +157,14 @@ sub configsite{
$selected{'mail_tls'}{'explicit'} = 'selected' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'implicit'} = 'selected' if (exists $dma{'SECURETRANSFER'}) and (not exists $dma{'STARTTLS'});
$selected{'mail_tls'}{'disabled'} = 'selected' if (not exists $dma{'SECURETRANSFER'}) and (not exists $dma{'STARTTLS'});
#Open site
&Header::openpage($Lang::tr{'email settings'}, 1, '');
&Header::openbigbox('100%', 'center');
&error;
&info;
&Header::openbox('100%', 'left', $Lang::tr{'email config'});
#### JAVA SCRIPT ####
print<<END;
<script>
@ -257,7 +257,7 @@ END
</form>
END
&Header::closebox();
&Header::closebigbox();
&Header::closebigbox();
&Header::closepage();
exit 0;
}

View File

@ -40,13 +40,13 @@ $modemsettings{'VALID'} = '';
&Header::getcgihash(\%modemsettings);
if ($modemsettings{'ACTION'} eq $Lang::tr{'save'})
{
{
if (!($modemsettings{'TIMEOUT'} =~ /^\d+$/))
{
$errormessage = $Lang::tr{'timeout must be a number'};
goto ERROR;
}
ERROR:
ERROR:
if ($errormessage) {
$modemsettings{'VALID'} = 'no'; }
else {

View File

@ -83,13 +83,13 @@ if ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} e
if ($dhcpinfo{'dhcp_lease_time'} ne "") {
$lsetme=$dhcpinfo{'dhcp_lease_time'};
$lsetme=($lsetme/60);
if ($lsetme > 59) {
$lsetme=($lsetme/60); $leasetime=$lsetme." Hour";
}else{
$leasetime=$lsetme." Minute";
}
if ($lsetme > 1) {
$leasetime=$leasetime."s";
}
@ -101,13 +101,13 @@ if ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} e
if ($dhcpinfo{'dhcp_renewal_time'} ne "") {
$rentme=$dhcpinfo{'dhcp_renewal_time'};
$rentme=($rentme/60);
if ($rentme > 59){
$rentme=($rentme/60); $rnwltime=$rentme." Hour";
}else{
$rnwltime=$rentme." Minute";
}
if ($rentme > 1){
$rnwltime=$rnwltime."s";
}

File diff suppressed because it is too large Load Diff

View File

@ -3606,7 +3606,7 @@ END
print ASNBLFILE<<END
TESTDATA = (10.0.0.1, 0) (127.0.0.1, 0) (fe80::1, 0)
ACTIVE_ASNBLS =
ACTIVE_ASNBLS =
END
;

View File

@ -72,7 +72,7 @@ if ( (($remotesettings{'ACTION'} eq $Lang::tr{'save'}) || ($remotesettings{'ACTI
&General::log($Lang::tr{'ssh is disabled'});
unlink "${General::swroot}/remote/enablessh";
}
if ($remotesettings{'SSH_PORT'} eq 'on')
{
&General::log("SSH Port 22");
@ -81,7 +81,7 @@ if ( (($remotesettings{'ACTION'} eq $Lang::tr{'save'}) || ($remotesettings{'ACTI
{
&General::log("SSH Port 222");
}
if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} || $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){
if ($remotesettings{'ENABLE_SSH'} eq 'off')
{
@ -90,7 +90,7 @@ if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} || $remotesetting
}
if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ) { $counter = 900;}
elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ) { $counter = 1800;}
system("/usr/local/bin/sshctrl tempstart $counter >/dev/null");
}
else {

View File

@ -49,7 +49,7 @@ $settings{'IP'} = '';
$settings{'GATEWAY'} = '';
$settings{'REMARK'} = '';
my @nosaved=('EN','IP','GATEWAY','REMARK'); # List here ALL setting2 fields. Mandatory
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
@ -105,14 +105,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
$temp[0] = $temp[0] ne '' ? '' : 'on'; # Toggle the field
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
&General::log($Lang::tr{'routing config changed'});
#Save current
open(FILE, ">$datafile") or die 'routing datafile error';
print FILE @current;
close(FILE);
# Rebuild configuration file
&BuildConfiguration;
}
@ -174,7 +174,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
&BuildConfiguration; # then re-build routing
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
@ -192,7 +192,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'edit'}) {
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
splice (@current,$settings{'KEY1'},1); # Delete line
splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'route datafile error';
print FILE @current;
close(FILE);
@ -315,7 +315,7 @@ foreach my $line (@current) {
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
@ -405,7 +405,7 @@ if ( $output != "" ) {
sub SortDataFile
{
our %entries = ();
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
@ -449,13 +449,13 @@ sub SortDataFile
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
my @record = ('KEY',$key++,'EN',$temp[0],'IP',$temp[1],'GATEWAY',$temp[2],'REMARK',$temp[3]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
open(FILE, ">$datafile") or die 'routing datafile error';
# Each field value is printed , with the newline ! Don't forget separator and order of them.

View File

@ -142,7 +142,7 @@ if ($sambasettings{'ACTION'} eq $Lang::tr{'save'}) {
}
&General::readhash("${General::swroot}/samba/settings", \%sambasettings);
if ($errormessage)
{
@ -759,7 +759,7 @@ sub isrunning
{
if (/^Name:\W+(.*)/)
{
$testcmd = $1;
$testcmd = $1;
}
}
close FILE;
@ -775,7 +775,7 @@ sub isrunning
sub writeconfiguration() {
open (FILE, ">${General::swroot}/samba/global") or die "Can't save the global settings: $!";
flock (FILE, 2);
print FILE <<END;
# global.settings by IPFire Project

View File

@ -43,7 +43,7 @@ my $data_last = $ENV{'QUERY_STRING'};
my $rxb_last = 0;
my $txb_last = 0;
my (@fields, $field, $name, $value);
my (@fields, $field, $name, $value);
@fields = split(/&/, $data_last);
foreach $field (@fields) {
($name, $value) = split(/=/, $field);

View File

@ -50,7 +50,7 @@ $timesettings{'ENABLESETONBOOT'} = 'off';
&Header::getcgihash(\%timesettings);
if ($timesettings{'ACTION'} eq $Lang::tr{'save'})
{
{
if ($timesettings{'ENABLENTP'} eq 'on')
{
if ( ! ( &General::validfqdn($timesettings{'NTP_ADDR_1'}) ||
@ -144,7 +144,7 @@ ERROR:
} else {
unlink "${General::swroot}/time/allowclients";
}
}
else
{
@ -222,7 +222,7 @@ $selected{'UPDATE_PERIOD'}{'weekly'} = '';
$selected{'UPDATE_PERIOD'}{'monthly'} = '';
$selected{'UPDATE_PERIOD'}{$timesettings{'UPDATE_PERIOD'}} = "selected='selected'";
# added to v0.0.4 to refresh screen if syncro event queued
# added to v0.0.4 to refresh screen if syncro event queued
my $refresh = '';
if ( -e "/var/lock/time/settimenow") {
$refresh = "<meta http-equiv='refresh' content='60;' />";

View File

@ -80,7 +80,7 @@ my @vendors=();
my %vendorstats=();
my $repository = "/var/updatecache/";
my $webhome = "/srv/web/ipfire/html";
my $webhome = "/srv/web/ipfire/html";
my $hintcolour = '#FFFFCC';
my $colourgray = '#808080';

View File

@ -2954,10 +2954,10 @@ sub writeconfigfile
foreach $category (@categories) {
$blacklist = $category;
$category =~ s/\//_/g;
if ( $filtersettings{"FILTER_".uc($category)} ne "on" ){
my $constraintrule = "false";
foreach (@tclist){
chomp;
@tc = split(/\,/);
@ -2966,12 +2966,12 @@ sub writeconfigfile
$constraintrule = "true";
}
}
if ( $constraintrule eq "false"){
next;
}
}
print FILE "dest $category {\n";
if (-e "$dbdir/$blacklist/domains") {
print FILE " domainlist $blacklist\/domains\n";

View File

@ -239,7 +239,7 @@ sub check_status($) {
if ($status =~ /^(Vulnerable|Mitigation): (.*)$/) {
return ($1, $2);
}
}
return $status;
}

View File

@ -86,7 +86,7 @@ if ( $cgiparams{'ACTION'} eq 'add' )
unless( &General::validmac($cgiparams{'CLIENT_MAC'}) )
{
$errormessage = $Lang::tr{'invalid mac address'};
$errormessage = $Lang::tr{'invalid mac address'};
goto ADDEXIT;
}
@ -122,7 +122,7 @@ if ( $cgiparams{'ACTION'} eq 'update' )
unless( &General::validmac($cgiparams{'CLIENT_MAC'}) )
{
$errormessage = $Lang::tr{'invalid mac address'};
$errormessage = $Lang::tr{'invalid mac address'};
goto UPDATEEXIT;
}
@ -241,11 +241,11 @@ END
;
print "<option value='green' $selected{'CLIENT_IFACE'}{'green'}>$Lang::tr{'green'}</option>";
if (&haveBlueNet())
if (&haveBlueNet())
{
print "<option value='blue' $selected{'CLIENT_IFACE'}{'blue'}>$Lang::tr{'blue'}</option>";
}
if (&haveOrangeNet())
if (&haveOrangeNet())
{
print "<option value='orange' $selected{'CLIENT_IFACE'}{'orange'}>$Lang::tr{'orange'}</option>";
}
@ -269,7 +269,7 @@ print <<END
END
;
if ( ($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update') )
if ( ($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update') )
{
print "<input type='hidden' name='ID' value='$cgiparams{'ID'}' />\n";
print "<input type='hidden' name='ACTION' value='update' />";
@ -309,12 +309,12 @@ for $i ( 0 .. $#wol_devices )
my $wol_iface = $wol_devices[$i]{'IFace'};
my $wol_txt = &Header::cleanhtml($wol_devices[$i]{'Comment'});
if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) )
if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) )
{
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
elsif ( $i % 2)
elsif ( $i % 2)
{
print "<tr>";
$col="bgcolor='$color{'color20'}'";
@ -332,7 +332,7 @@ for $i ( 0 .. $#wol_devices )
<td align='center' $col>
END
;
if ( (($wol_iface eq 'blue') && ! &haveBlueNet())
if ( (($wol_iface eq 'blue') && ! &haveBlueNet())
|| (($wol_iface eq 'orange') && ! &haveOrangeNet()) )
{
# configured IFace (momentarily) not available -> now wakeup button/image
@ -384,7 +384,7 @@ sub ReadConfig
{
# datafileformat:
# ID,MAC,IFACE,,Comment
#
#
my @tmpfile = ();
if ( open(FILE, "$datafile") )
{
@ -421,14 +421,14 @@ sub WriteConfig
unless(&General::validmac($wol_devices[$i]{'MAC'})) { next; }
unshift (@tmp_clients, uc($wol_devices[$i]{'MAC'}).",$wol_devices[$i]{'IFace'},,$wol_devices[$i]{'Comment'}");
}
# sort tmp_clients on MAC
@tmp_clients = sort ( @tmp_clients );
open(FILE, ">$datafile") or die 'hosts datafile error';
my $count = 0;
foreach $line (@tmp_clients)
foreach $line (@tmp_clients)
{
print FILE "$count,$line\n";
$count++;

View File

@ -82,7 +82,7 @@ if ((-e $svhosts_file) && (!-z $svhosts_file))
if (($cgiparams{'ACTION'} eq 'submit') && ($is_supervisor))
{
if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) ||
if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) ||
((defined($proxysettings{'SUPERVISOR_PASSWORD'})) && ($proxysettings{'SUPERVISOR_PASSWORD'} eq '')))
{
&write_acl;
@ -269,7 +269,7 @@ sub readhash
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;

View File

@ -39,7 +39,7 @@ my %checked=();
my $errormessage = '';
my $filename = "${General::swroot}/wireless/config";
my $hostsfile = "${General::swroot}/main/hosts";
our %dhcpsettings=();
our %dhcpsettings=();
our %netsettings=();
$cgiparams{'ENABLED'} = 'off';
@ -92,9 +92,9 @@ if ($cgiparams{'ACTION'} eq 'add')
{
$cgiparams{'SOURCE_IP'} = 'NONE';
} else {
unless(&General::validipormask($cgiparams{'SOURCE_IP'}))
unless(&General::validipormask($cgiparams{'SOURCE_IP'}))
{
$errormessage = $Lang::tr{'invalid fixed ip address'};
$errormessage = $Lang::tr{'invalid fixed ip address'};
goto ADDERROR;
}
}
@ -102,9 +102,9 @@ if ($cgiparams{'ACTION'} eq 'add')
{
$cgiparams{'SOURCE_MAC'} = 'NONE';
} else {
unless(&General::validmac($cgiparams{'SOURCE_MAC'}))
{
$errormessage = $Lang::tr{'invalid fixed mac address'};
unless(&General::validmac($cgiparams{'SOURCE_MAC'}))
{
$errormessage = $Lang::tr{'invalid fixed mac address'};
}
}
@ -323,7 +323,7 @@ foreach my $line (@current)
}
if ( $hname eq "" ) {
my ($aliases, $addrtype, $length, @addrs);
($hname, $aliases, $addrtype, $length, @addrs) =
($hname, $aliases, $addrtype, $length, @addrs) =
gethostbyaddr(pack("C4", split(/\./, $sourceip)), 2);
}
}

View File

@ -303,7 +303,7 @@ END
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
$gdesc = $Lang::tr{'click to enable'};
}
# Colorize each line
@ -576,7 +576,7 @@ sub showEditBox() {
<br>
<hr>
<strong>
$Lang::tr{'wlan client advanced settings'}:
</strong>

View File

@ -67,7 +67,7 @@ my $extraHead = <<END
#zoneconf td.heading {
background-color: lightgrey;
color: white;
}
}
#zoneconf td.heading.bold::first-line {
font-weight: bold;
line-height: 1.6;
@ -310,7 +310,7 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
}
$VALIDATE_nic_check{"VLAN $mac $vlan_tag"} = 1;
# check VLAN tag range: 1..4094 (0, 4095 are reserved)
unless (looks_like_number($vlan_tag) && ($vlan_tag >= 1) && ($vlan_tag <= 4094)) {
$VALIDATE_error = $Lang::tr{"zoneconf val vlan tag range error"};
@ -507,7 +507,7 @@ END
if ($access_selected{"NONE"} eq "") {
$highlight = $_;
}
print <<END
<td class="$highlight">
<select name="ACCESS $uc $mac" data-zone="$uc" data-mac="$mac" onchange="highlightAccess(this)">
@ -542,7 +542,7 @@ foreach (@zones) { # load settings and prepare form elements for each zone
my $stp_available = $ethsettings{"${uc}_MODE"} eq "bridge"; # STP is only available in bridge mode
my $stp_enabled = $ethsettings{"${uc}_STP"} eq "on";
my $stp_priority = $ethsettings{"${uc}_STP_PRIORITY"};
# set priority to default value if no numerical value is configured
$stp_priority = 32768 unless looks_like_number($stp_priority);

View File

@ -27,8 +27,8 @@ function rrdimage_selectRange(buttonObj) {
// Get selected time range from button
const range = buttonObj.dataset.range;
// Get surrounding div box and select new range
// Get surrounding div box and select new range
let graphBox = $(buttonObj).closest('div');
_rrdimg_setRange(graphBox, range);
}
@ -60,7 +60,7 @@ function _rrdimg_setRange(graphBox, range, initMode = false) {
// Check if the time range is changed
if((graphBox.data('range') !== range) || initMode) {
graphBox.data('range', range); //Store new range
// Update button highlighting
graphBox.find('button').removeClass('selected');
graphBox.find(`button[data-range="${range}"]`).addClass('selected');
@ -105,7 +105,7 @@ function _rrdimg_setRange(graphBox, range, initMode = false) {
// graphBox: jQuery object (graph element must be valid)
function _rrdimg_reload(graphBox) {
const origin = graphBox.data('origin');
const graph = graphBox.data('graph');
const graph = graphBox.data('graph');
const timestamp = Date.now();
// Get user selected range or fall back to default

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ACCESS MESSAGE</title>
<style content="text/css">
td.image {

View File

@ -103,7 +103,7 @@ sub readhash {
if ($var) {
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;

View File

@ -39,7 +39,7 @@ require "${General::swroot}/lang.pl";
# @param submenu entries
sub showsubmenu() {
my $submenus = shift;
print "<ul>";
foreach my $item (sort keys %$submenus) {
$link = getlink($submenus->{$item});

View File

@ -73,7 +73,7 @@ $(patsubst %,$(DIR_DL)/%,$(objects)) :
$(subst %,%_MD5,$(objects)) :
@$(MD5)
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -244,7 +244,7 @@ endef
# Common Macro Definitions
###############################################################################
# For each package we create a list of files that it installed under
# For each package we create a list of files that it installed under
# log/<TARGET> name. Modified files are not identified
#
define FIND_FILES

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -67,7 +67,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################
@ -106,10 +106,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Install initscript
$(call INSTALL_INITSCRIPTS,$(SERVICES))
#install backup definition
install -v -m 644 ${DIR_SRC}/config/backup/includes/avahi \
/var/ipfire/backup/addons/includes/avahi
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -44,13 +44,13 @@ SERVICES =
install : $(TARGET)
check :
check :
download :
md5 :
md5 :
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -61,7 +61,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -62,7 +62,7 @@ ifeq "$(PASS)" "1"
--with-lib-path=$(TOOLS_DIR)/lib \
--disable-nls
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_INSTALL =
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools2
EXTRA_ENV = \
@ -76,8 +76,8 @@ else
--with-lib-path=$(TOOLS_DIR)/lib \
--with-sysroot \
--disable-nls
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_MAKE =
EXTRA_INSTALL =
endif
endif

View File

@ -60,7 +60,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -35,11 +35,11 @@ TARGET = $(DIR_INFO)/$(THISAPP)
install : $(TARGET)
check :
check :
download :
md5 :
md5 :
###############################################################################
# Installation Details

View File

@ -59,7 +59,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -36,11 +36,11 @@ TARGET = $(DIR_INFO)/$(THISAPP)
install : $(TARGET)
check :
check :
download :
download :
md5 :
md5 :
###############################################################################
# Installation Details

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -24,7 +24,7 @@
include Config
SUMMARY = Antivirus Toolkit
SUMMARY = Antivirus Toolkit
VER = 0.104.2
@ -60,7 +60,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
$(PAK)
###############################################################################

View File

@ -40,11 +40,11 @@ GCC_VER = 4.1.2
# Top-level Rules
###############################################################################
objects =
objects =
install : $(TARGET)
check :
check :
download :

View File

@ -126,8 +126,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn
chown nobody.nobody /var/ipfire/ovpn/collectd.vpn
ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn
ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@ -66,7 +66,7 @@ core/%:
#remove excluded files from ROOTFILES
grep -f $(DIR_SRC)/config/rootfiles/$@/exclude -v /tmp/ROOTFILES.tmp > /tmp/ROOTFILES
rm -rf /tmp/ROOTFILES.tmp
#Change KVER to Kernelversion
sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES

View File

@ -24,7 +24,7 @@
include Config
SUMMARY = Tools to Determine and Set CPUfreq Settings
SUMMARY = Tools to Determine and Set CPUfreq Settings
VER = 008
@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -60,7 +60,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -24,7 +24,7 @@
include Config
SUMMARY = Data Copying in the Presence of I/O Errors
SUMMARY = Data Copying in the Presence of I/O Errors
VER = 1.25
@ -59,7 +59,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -62,7 +62,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -24,7 +24,7 @@
include Config
SUMMARY = Higher-level library to access ELF files
SUMMARY = Higher-level library to access ELF files
VER = 0.186

View File

@ -71,7 +71,7 @@ $(patsubst %,$(DIR_DL)/%,$(objects)) :
$(subst %,%_MD5,$(objects)) :
@$(MD5)
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -59,7 +59,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -36,11 +36,11 @@ TARGET = $(DIR_INFO)/$(THISAPP)-tools
install : $(TARGET)
check :
check :
download :
download :
md5 :
md5 :
###############################################################################
# Installation Details

View File

@ -96,7 +96,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
#Create Placeholder files
echo "Place scripts run minutely here ..." > /etc/fcron.minutely/info.txt
echo "Place scripts run cyclic here ..." > /etc/fcron.cyclic/info.txt
echo "Place scripts run cyclic here ..." > /etc/fcron.cyclic/info.txt
echo "Place scripts run hourly here ..." > /etc/fcron.hourly/info.txt
echo "Place scripts run daily here ..." > /etc/fcron.daily/info.txt
echo "Place scripts run weekly here ..." > /etc/fcron.weekly/info.txt

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
$(PAK)
###############################################################################

View File

@ -66,7 +66,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -59,7 +59,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -36,8 +36,8 @@ DIR_APP = $(DIR_SRC)/$(THISAPP)
ifeq "$(ROOT)" ""
TARGET = $(DIR_INFO)/$(THISAPP)
EXTRA_CONFIG = --prefix=/usr --disable-nls
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_MAKE =
EXTRA_INSTALL =
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools

View File

@ -74,7 +74,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -60,7 +60,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

12
lfs/gcc
View File

@ -105,8 +105,8 @@ ifeq "$(PASS)" "1"
--without-ppl \
--without-cloog \
--enable-languages=c,c++
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_MAKE =
EXTRA_INSTALL =
else
ifeq "$(PASS)" "2"
TARGET = $(DIR_INFO)/$(THISAPP)-tools2
@ -125,8 +125,8 @@ ifeq "$(PASS)" "2"
--disable-libstdcxx-pch \
--disable-multilib \
--disable-libgomp
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_MAKE =
EXTRA_INSTALL =
ifeq "$(FULL_BOOTSTRAP)" "1"
EXTRA_CONFIG += --enable-bootstrap
@ -149,8 +149,8 @@ else
--disable-libstdcxx-threads \
--disable-libstdcxx-pch \
--with-gxx-include-dir=$(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER)
EXTRA_MAKE =
EXTRA_INSTALL =
EXTRA_MAKE =
EXTRA_INSTALL =
endif
endif
endif

View File

@ -64,7 +64,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
$(PAK)
###############################################################################

View File

@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -35,7 +35,7 @@ TARGET = $(DIR_INFO)/$(THISAPP)
PROG = gptfdisk
PAK_VER = 1
DEPS =
DEPS =
###############################################################################
# Top-level Rules
@ -55,7 +55,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

View File

@ -24,7 +24,7 @@
include Config
SUMMARY = Printer drivers for CUPS from the Gutenprint project
SUMMARY = Printer drivers for CUPS from the Gutenprint project
VER = 5.2.9
@ -58,7 +58,7 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
dist:
@$(PAK)
###############################################################################

Some files were not shown because too many files have changed in this diff Show More